[英]Updating prod postgresql db with Flask Heroku
I have ran the following command in my dev db:我在我的开发数据库中运行了以下命令:
flask db migrate -m "updated the schema"
flask db upgrade
Which successfully did the migration and updated the schema.哪个成功完成了迁移并更新了架构。 However, when I pushed the commit to heroku the prod schema didn't change.
但是,当我将提交推送到 heroku 时,产品架构没有改变。 How can I do the same update in heroku prod postgresql?
如何在 heroku 产品 postgresql 中进行相同的更新?
I tried switching my profile code from:我尝试从以下位置切换我的个人资料代码:
web: gunicorn run:app --log-file=-
to:至:
web: flask db upgrade; gunicorn run:app --log-file=-
& even adding:甚至添加:
heroku config:set FLASK_APP=run.py
for restarting.用于重新启动。 However, the prod db schema remains unchanged.
但是,prod db 架构保持不变。
The following commands did the job:以下命令完成了这项工作:
Heroku run bash
flask db migrate
flask db upgrade
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.