如何在Heroku上回滚数据库迁移 [英] How to rollback database migration on Heroku
本文介绍了如何在Heroku上回滚数据库迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚部署了一些代码和数据库更改到Heroku,我想将其回滚。我的发行版附加组件能够回滚代码,但不能回滚数据库。我没有备份数据库,所以我无法进行恢复。我试过heroku rake db:rollback,但它没有做任何事情。任何人都知道?
I just deployed some code and database changes to Heroku and I would like to roll it back. I do have the releases add-on and was able to roll back the code but not the database. I didn't backup the database so I can't do a restore. I tried "heroku rake db:rollback" but it didn't do anything. Anyone knows?
推荐答案
您必须运行 heroku rake db:rollback
而将具有 .down
迁移的更新代码部署到Heroku。之后,您可以回滚代码。
You have to run heroku rake db:rollback
while the updated code that has the .down
migration is deployed to Heroku. After that, you can rollback the code.
这篇关于如何在Heroku上回滚数据库迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文