【发布时间】:2020-11-19 17:35:31
【问题描述】:
我有一个在 Heroku 中运行的 Django 应用程序。在初始部署时,我使用 heroku run 手动迁移了数据库架构。
下次我需要将迁移推送到应用程序时,发布没有任何抱怨。 然而,当我去现场查看它时,我收到了一个编程错误:新列不存在。从未运行过迁移。
这是我的 Procfile:
web: gunicorn APP_NAME.wsgi --log-file -
release: python manage.py migrate
release: python manage.py collectstatic --noinput
worker: celery worker -A APP_NAME -B -E -l info
collectstatic 版本运行成功,但 migrate 版本似乎被忽略或忽略了。当我手动迁移时,它们迁移没有错误。在迁移文件夹中有一个空的__init__.py 文件。
如果有人知道什么可能会阻碍迁移版本的运行,那就太棒了。
【问题讨论】:
标签: python django heroku django-migrations