Rails-如何解决孤立迁移的问题? [英] Rails - how to solve this issue of an orphaned migration?
问题描述
在rake db:migrate:rollback STEP = 1之后,rake db:migrate:reset,rake db:migrate:setup,rake db:migrate:up VERSION = XXXXXXXXX我得到以下条目:
After rake db:migrate:rollback STEP=1, rake db:migrate:reset, rake db:migrate:setup, rake db:migrate:up VERSION=XXXXXXXXX I get the following entry:
Status Migration ID Migration Name
------------------------------------------------------
up 0 *********NO FILE**********
up 20120209023430 Create tasks
如何摆脱孤立的条目?与上面类似,在耙分贝后,我几次遇到了这个问题.有人可以解释一下到底是什么引起的.
How can I get rid of the orphaned entry? I have encountered this problem a few times after raking the db similar to above. Could somebody please explain what exactly causes this.
提前. 莎拉姆
推荐答案
您可以使用rake db:migrate:reset db:seed
.它稍微冗长一些,它将完全擦除您的数据库,重新运行所有迁移,然后从db/seeds.rb
文件中为您的数据库添加种子.
You could use rake db:migrate:reset db:seed
. It's a little less verbose and will completely wipe your database, re-run all migrations, and then seed your database from the db/seeds.rb
file.
这篇关于Rails-如何解决孤立迁移的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!