python
config_error
ai_generated
true
Django迁移历史不一致:迁移admin.0001_initial在其依赖myapp.0001_initial之前应用于数据库'default'。
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency myapp.0001_initial on database 'default'.
ID: python/django-migration-merge-conflict
80%修复率
82%置信度
0证据数
2024-12-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
迁移依赖顺序错误,通常是由于合并分支不正确。
English
Migration dependencies are out of order, often due to merging branches incorrectly.
解决方案
-
85% 成功率
Use 'python manage.py makemigrations --merge' to resolve conflicts.
无效尝试
常见但无效的做法:
-
70% 失败
Can hide real inconsistencies and cause data loss.
-
60% 失败
Loses migration history and may break existing databases.