简体   繁体   中英

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. How can I do the same update in heroku prod 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.

The following commands did the job:

Heroku run bash
flask db migrate
flask db upgrade

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM