Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate down with only one migration

In order to test a new Rails plugin that I wrote, I'd like to check if the migration of that plugin works correctly. So I created a new test app, added the plugin, generated the migration and migrated up (which works fine). I now would also like to check the down migration. But rake db:migrate:down wants a version number. What should I provide? It is the only migration and VERSION=0 doesn't work.

like image 406
Zardoz Avatar asked Dec 31 '10 02:12

Zardoz


1 Answers

See the Official Guides

rake db:rollback
rake db:rollback STEP=3
rake db:migrate:down

# rollback-then-migrate-forward combo
rake db:migrate:redo
rake db:migrate:redo STEP=3
like image 155
yfeldblum Avatar answered Oct 16 '22 04:10

yfeldblum