Django migrations : relation already exists

前端 未结 6 934
南笙
南笙 2021-02-06 18:46

I have trouble with django model migrations. I have some models in my app, and I already have some data inside. When I added some models in my application, and I run mak

6条回答
  •  悲哀的现实
    2021-02-06 19:17

    the possible cause or this is that you have another migration in the same folder starts with the same prefix... maybe you make another migration on the same table on another branch or commit so it's saved to the db with the same prefix ie: 00010_migration_from_commit_#10, 00010_migration_from_commit_#11

    the solution for this is to rename the migration file like this 00011_migration_from_commit_#11

提交回复
热议问题