django.db.migrations.exceptions.InconsistentMigrationHistory

后端 未结 25 1179
耶瑟儿~
耶瑟儿~ 2020-12-04 08:16

When I run python manage.py migrate on my Django project, I get the following error:

Traceback (most recent call last):
File \"manage.py\", line         


        
25条回答
  •  猫巷女王i
    2020-12-04 08:58

    This Problem will come most of the time if you extend the User Model post initial migration. Because whenever you extend the Abstract user it will create basic fields which were present un the model like email, first_name, etc.

    Even this is applicable to any abstract model in django.

    So a very simple solution for this is either create a new database then apply migrations or delete [You all data will be deleted in this case.] the same database and reapply migrations.

提交回复
热议问题