I made a rookie mistake with a migration yesterday. I amended a migration that had already been uploaded and run, and I forgot to rollback before uploading the new version. Now, the migration is failing because either a column already exists (up) or there is no column to delete (down)!
Is it possible to get a migration to force its changes one time from the console, having to write :force => true
within the document first, migrating, and then removing it again? :force => true
在文档中写入:force => true
,迁移,然后再次删除它?
回到稳定状态的一种简单方法是在数据库中手动更改添加列以使回滚工作,然后执行回滚并再次向上迁移。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.