python manage.py migrate
时,我遇到了这个错误:django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
<appname>.0016_auto_<date2>_<time2> is applied before its dependency
<appname>.0001_squashed_0015_auto_<date1>_<time1>
运行 python manage.py showmigrations
命令返回:
<appname>
[X] 0001_squashed_0015_auto_<date1>_<time1> (15 squashed migrations)
[X] 0016_auto_<date2>_<time2>
[ ] 0017_<modelname>_squashed_0019_auto_<date3>_<time3> (3 squashed migrations)
昨天我在尝试使用
django-extensions
时,因为运行了一些直接的SQL查询并使用git进行了硬重置,结果一切都乱了。由于我还在学习迁移,所以我不明白出了什么问题,因为在我看来,两个迁移已经被应用了。感谢您的帮助!