Last Updated: February 25, 2016
·
397
· gamebit07

When you have screwed your south migrations

It is easiest to start over.

1 Delete all migrations/* files.

2 Remove the changes in models.py which I want to migrate at the moment (by the help of version control tools, or just comment out your new fields).

3 Then initialize migration from scratch.

manage.py migrate my_app --delete-ghost-migrations
manage.py schemamigration my_app --init
manage.py migrate my_app --fake

4 Then restore my changes to models.py and begin new clean migration:

manage.py schemamigration my_app --auto
manage.py migrate my_app