0

Background

Migrating a Django app from Digital Ocean to Heroku. I had problems migrating the data, so I used pg_dump to get the schema and the data of each table. Then ran those scripts in heroku. I loaded my website and I can see the new data coming through.

Problem

Now when I push new code with the Heroku CLI that auto runs the deployment, it fails for this reason: psycopg2.errors.DuplicateTable: relation "django_content_type" already exists

The commands I run are

git add .
git commit -m "some message"
git push heroku master"

The Procfile has release: python manage.py migrate which runs the commands, which I thought about taking it out but when I have migrations to run in the future this will cause an issue.

Any thoughts?

1 Answers1

0

This sent me down a rabbit hole this morning, and I figured it out. I am going to leave the question up since I could not find a similar one.

The issue came down to migrations being out of sync locally and remotely. Following the instructions for the top answer on this post cleared up the issue: Django Heroku Error "Your models have changes that are not yet reflected in a migration"