[Answer]-Why does schemamigration –auto creates a spurious migration?

1👍

The problem comes from the “frozen” model states not being consistent between your first two migrations. If you look at your migration files, you’ll see that the Migration class has a models attributes which is the “frozen” representation of the models at the moment the migration was generated. South then uses this representation – the one in the last applied migration file – to detect changes and generate a new migration. Since your two “0001_XXX” migrations have diverging “frozen” models, any new migration will be generated against a wrong representation of the models.

The solution is, obviously, to fix your “0001_XXX” migration’s models manually.

And, yes, South + parallel branches can be a kind of a pain, but I fail to see how South could do a better job ATM anyway.

Leave a comment