django.db.migrations.exceptions.InconsistentMigrationHistory

后端 未结 25 1099
耶瑟儿~
耶瑟儿~ 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条回答
  •  Happy的楠姐
    2020-12-04 09:06

    when you create a new project and with no apps, you run the

    python manage.py migrate
    

    the Django will create 10 tables by default.

    If you want create a customer user model which inherit from AbstractUser after that, you will encounter this problem as follow message:

    django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency account.0001_initial on database 'default'.

    finally, I drop my entire databases and run

提交回复
热议问题