Questions

Django Heroku Error: Your models have changes that are not yet reflected in a migration, and so won't be applied.

0

I am getting this error whenever I am trying to do

heroku run python manage.py migrate

Heroku Error



asked 1 year, 11 months ago
Reputation: 1





1 Answer

0

This error usually comes when we have different versions of migrations file on heroku and local.

For example we have 0004_somename.py on local and say 0005_somename on heroku and this happens when we accidently run the command heroku run python manage.py migrations.

Never Run

heroku run python manage.py migrations

First do makemigrations and migrate locally and then add those newly created migrations file using git and run only migrate command on heroku.

Solution

Just rollback the version of app before that mistake was done and then again do migrate.
You can see the version of your app at different time from heroku website.
For example rollback to v30 using below command

$ heroku rollback v30

That’s it.

Thanks

answered 1 year, 11 months ago
Reputation: 1





Your Answer

Nothing to preview

Post Answer



Asked:  1 year, 11 months ago
Viewed:  1366 times
Active:  1 year, 11 months ago