【发布时间】:2014-07-30 17:57:50
【问题描述】:
尝试运行:
python manage.py migrate
收到此错误:
django.db.utils.IntegrityError: insert or update on table "my_class" violates foreign key constraint "content_type_id_refs_id_bc63f081"
DETAIL: Key (content_type_id)=(0) is not present in table "django_content_type".
我真的不太清楚这里出了什么问题...谁能帮助我?
【问题讨论】:
-
完整性错误表示外键受到影响,或者存在重复键。如果您在数据库中有以前的数据条目,则最好删除数据库并重建该过程。如果错误仍然存在,请显示模型结构。
标签: database django heroku django-south