I have a few migrations for my users table and it has become a mess that I don’t really follow myself 🙂
Ideally, what I want to do is use the Devise library for auth, and create my users table through that.
Should I do a drop table users, and merge my accumulated migrate files into one, and then run rake db:migrate ? Or is there a better way to do it? What is the good practice way of doing this?
Also, I’d like to add 3 more columns to the new migration for fistName,lastName,company fields to the users table. Where should I add that so those fields get created?
Thanks,
Alex
When you’re in dev, and alone, you can change your migration files the way you want (I’m still not convinced it’s that useful, see my comment above).
Well, once you’ve edited everything as you want:
delete your current database:
rake db:droprecreate it:
rake db:createmigrate:
rake db:migrateThe process of migrations is traced in the database itself:
one table is created and named
schema_migrations, each entry is an already made migration with the timestamp as an id.Because you dump the db, there is no more trace and you can remigrate.