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

2019-07-3007:02:51数据库教程Comments2,254 views字数 393阅读模式
django迁移数据库错误问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下.
django.db.migrations.graph.NodeNotFoundError: Migration order.0002_auto_20181209_0031 dependencies reference nonexistent parent node ('user', '0001_initial')

删除所有的pyc文件,迁移文件 然后重新运行文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html

python manage.py makemigrations

django.db.utils.InternalError: (1060, "Duplicate column name 'addr_id'")文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html

运行文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html

python manage.py migrate --fake

然后重新运行文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html

python manage.py migrate

成功!文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html

文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sjk/14505.html
  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/sjk/14505.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定