我前段时间创建了一个迁移,我一定忘记了填充什么的。我只是去重新创建它并得到以下信息:
Another migration is already named add_user_id_to_comments:
foo/db/migrate/20121103004535_add_user_id_to_comments.rb
从那以后,我已经运行了很多次“rake db:migrate”,并且进行了一些新的迁移......
摆脱这种混乱的最好方法是什么?
我前段时间创建了一个迁移,我一定忘记了填充什么的。我只是去重新创建它并得到以下信息:
Another migration is already named add_user_id_to_comments:
foo/db/migrate/20121103004535_add_user_id_to_comments.rb
从那以后,我已经运行了很多次“rake db:migrate”,并且进行了一些新的迁移......
摆脱这种混乱的最好方法是什么?
If the old one is completely blank, just delete it. Its absence will not adversely affect anything. If you want to remove all traces, you'll also want to remove 20121103004535 from your schema_migrations
table, but it is not required....
只是重命名您当前的迁移呢?
add_user_id_to_comments_1.rb