I had just installed devise so the table didn't have any data on it except one user (me).
I was re-doing the database all over again so I dropped it all. I did rails g scaffold
to generate 6 new models and controllers and did rake db:migrate
In my /db/migrate
directory I have the devise file with the filename 20130603211907_devise_create_users.rb
Here is the issue: If I do rake db:migrate:down VERSION=20130603211907
it will delete all the new migrations.
How do I run a migration again, without deleting all the newer migrations?
No it does not. unless you edited your old migrations you already ran on the server, which will change the order of how changes to the db are applied. Migrations are applied to the database sequentially.
It will run the down and then the up step (This command can drop your table!):
rake db:migrate:redo VERSION=xxxxxxx
To prevent your table from being deleted you could do this in conjunction with commenting out the down
step temporarily.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With