ech19
ech19

Reputation: 35

django heroku makemigrations ignoring changes in models

I deleted two models from models.py, and when I run makemigrations and migrate locally, everything is fine. When I run makemigrations on Heroku, I get the following message, where Building and BuildingInstance are the models I deleted:

Migrations for 'hello':
0002_building_buildinginstance.py:
- Create model Building
- Create model BuildingInstance

When I run migrate, I get:

Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

I followed the steps here and also tried squashing the migrations locally and on Heroku as suggested here. How can I fix this problem?

Upvotes: 1

Views: 955

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599470

As I have written many times here, you must not run makemigrations on Heroku. Run it locally, commit the result, and then​ run migrate on Heroku.

Upvotes: 1

Related Questions