django迁移数据库错误问题解决

爱蒂网

django迁移数据库错误问题解决

2020-03-15 21:31:17 分类 / 代码专栏 来源 / 互联网

这篇文章主要介绍了django迁移数据库错误问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

django.db.migrations.graph.NodeNotFoundError: Migration order.0002_auto_20181209_0031 dependencies reference nonexistent parent node ('user', '0001_initial')

删除所有的pyc文件,迁移文件 然后重新运行

python manage.py makemigrations

django.db.utils.InternalError: (1060, "Duplicate column name 'addr_id'")

运行

python manage.py migrate --fake

然后重新运行

python manage.py migrate

成功!

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持爱蒂网。

猜你喜欢