django.db.migrations.exceptions.InconsistentMigrationHistory

后端 未结 25 1029
耶瑟儿~
耶瑟儿~ 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条回答
  • 2020-12-04 09:17

    first of all backup your data. (copy your db file).

    delete sqlite.db and also the migration folder.

    then, run these commands:

    ./manage.py makemigrations APP_NAME
    ./manage.py migrate APP_NAME
    

    after deleting the DB file and migration folder make sure that write the application name after the migration commands.

    0 讨论(0)
提交回复
热议问题