django.db.migrations.exceptions.InconsistentMigrationHistory

后端 未结 25 1105
耶瑟儿~
耶瑟儿~ 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:08

    Okay, before you do anything weird or nuclear, first just drop your database and rebuild it.

    If using POsgres -

    DROP SCHEMA public CASCADE;
    CREATE SCHEMA PUBLIC;
    

    Then just remake your migrations

    ./manage.py migrate
    

    This is the most basic solution, which typically will clear things up. Don't just go remaking the migrations until absolutely neccessary.

提交回复
热议问题