开发者

Migrate down with only one migration

开发者 https://www.devze.com 2023-02-02 09:30 出处:网络
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 migrate

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:migrat开发者_StackOverflowe:down wants a version number. What should I provide? It is the only migration and VERSION=0 doesn't work.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消