Django makemigrations wants to delete everything it just created

Viewed 1392

I just followed this procedure:

  • makemigrations (success)
  • migrate (success)
  • Copy the app on another server (with the migration files)
  • Create a new empty database on that server
  • migrate (success, it creates the correct schema)
  • Fill the new database with data
  • Just to test: migrate ....

At this point Django says I 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"

But when I run makemigrations, it creates a new one that wants to "Remove field" every foreign key and "Delete model" all of my models. If I run it it empties my database. My models.py are intact.

What is happening ??

2 Answers
Related