【发布时间】:2021-05-17 02:55:17
【问题描述】:
背景
将 Django 应用程序从 Digital Ocean 迁移到 Heroku。我在迁移数据时遇到了问题,所以我使用 pg_dump 来获取每个表的架构和数据。然后在heroku中运行这些脚本。我加载了我的网站,我可以看到新数据正在通过。
问题
现在,当我使用自动运行部署的 Heroku CLI 推送新代码时,它会因此失败:psycopg2.errors.DuplicateTable: relation "django_content_type" already exists
我运行的命令是
git add .
git commit -m "some message"
git push heroku master"
Procfile 具有运行命令的 release: python manage.py migrate,我曾想过将其删除,但当我将来要运行迁移时,这会导致问题。
有什么想法吗?
【问题讨论】:
标签: django heroku heroku-postgres heroku-cli