读书人

关于rake下令撤销 migrations

发布时间: 2013-01-04 10:04:13 作者: rapoo

关于rake命令撤销 migrations
我这里遇到一个难题:
a.) ruby script/generation migration add_price_to_product_99 price:decimal
b.) ruby script/generation migration add_price_to_product price:decimal
c.) rake db:migrate 出错:表product_99不存在。
现在我怎么撤销或回滚Version都无法清除下面两条命令。
rake
You have 2 pending migrations:
20120119024640 AddPriceToProduct_99
20120119024819 AddPriceToProduct

rake db:migrate VERSION=20120119015819
rake db:reset
rake db:schema:load
rake db:migrate:up
都试了,始终在无法正常执行 rake db:migrate

[解决办法]
在 项目>db>migrate>目录下,将错误的文件删除即可了。

读书人网 >Ruby Rails

热点推荐