Ruby-on-rails 删除 Rails 应用程序并将其重新部署到 heroku
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22043111/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Delete and Redeploy Rails app to heroku
提问by Luigi
I have a rails app that is deployed to Heroku. I recently made a ton of changes, deleted old migrations, recreated new migrations, rebased and dealt with merge conflicts....the list goes on.
我有一个部署到 Heroku 的 rails 应用程序。我最近进行了大量更改,删除了旧迁移,重新创建了新迁移,重新定位并处理了合并冲突......列表还在继续。
Now, I want to wipe my entire heroku "production" app from heroku and redeploy my code from my github masterbranch to Heroku.
现在,我想从 heroku 擦除我的整个 heroku“生产”应用程序,并将我的代码从我的 githubmaster分支重新部署到 Heroku。
Is there an easy or "right" way to delete my app on Heroku, wipe it clean, and then redeploy?
是否有一种简单或“正确”的方法可以在 Heroku 上删除我的应用程序,将其擦干净,然后重新部署?
回答by Damien MATHIEU
回答by Carlos Ramirez III
If you don't want to delete the entire application (perhaps you want to keep your add-ons and other configuration the same), you can reset the database and force update the code.
如果您不想删除整个应用程序(也许您想保持加载项和其他配置不变),您可以重置数据库并强制更新代码。
Deploy your new code, forcing the update by using the -fflag:
部署新代码,使用-f标志强制更新:
git push heroku master -f
Drop and recreate the database:
删除并重新创建数据库:
heroku pg:reset <DATABASE>
Migrate the fresh database:
迁移新数据库:
heroku run rake db:migrate


