1.把项目的所有migrations的迁移文件删除,保留init.py
2.删除虚拟环境中django的admin和auth的migrations的迁移文件删除,保留init.py
3.makemigrations项目中继承AbstractUser的model表
python manage.py makemigrations userProfile
4.执行迁移文件
python manage.py migrate userProfile
Django迁移报错——django.db.migrations.exceptions.InconsistentMigrationHistory
阅读 40
2022-02-11
1.把项目的所有migrations的迁移文件删除,保留init.py
2.删除虚拟环境中django的admin和auth的migrations的迁移文件删除,保留init.py
3.makemigrations项目中继承AbstractUser的model表
python manage.py makemigrations userProfile
4.执行迁移文件
python manage.py migrate userProfile
相关推荐
精彩评论(0)