AbstractUser 替换user Model,在migrate时报错
...
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.
...
解决方法:
- 注释掉admin app
INSTALLED_APPS = [
# 'django.contrib.admin',
...
]
- Migrate
python manage.py migrate
- 取消注释
INSTALLED_APPS = [
'django.contrib.admin',
...
]
PS: 百度出来的全是删库重建,看到我心惊胆跳,心中只有一个念头:删库跑路。。。
django.db.migrations.exceptions.InconsistentMigrationHistory