Why does rake db:rollback rollback three steps?

我们两清 提交于 2019-12-10 12:41:44

问题


Normally when I do

$ rake db:rollback

it rolls back one migration. But now, repeatedly times, it has rollbacked 3 steps.

How come this behaviour?

I'm on Rails 3.2.13.


回答1:


You can specify the number of steps like this:

rake db:rollback STEP=3

The STEP parameter is actually an environment variable here. If, in your terminal, you run the command echo $STEP, does it return 3? If it does, you can execute export STEP=1 to get back to expected behaviour. If it happens again, try to find out where this environment variable is being set.




回答2:


bundle exec rails db:rollback STEP=3


来源:https://stackoverflow.com/questions/19805637/why-does-rake-dbrollback-rollback-three-steps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!