Django Migrate-行具有无效的外键,但行不存在

Django Migrate-行具有无效的外键,但行不存在,django,sqlite,django-models,django-admin,Django,Sqlite,Django Models,Django Admin,迁移数据库时,出现以下错误: The row in table 'project_obicase' with primary key '2325' has an invalid foreign key: project_obicase.ckId_id contains a value '2443' that does not have a corresponding value in project_pupiladdressck.id. 在我的/admin/site中找不到此记录“2325”。

迁移数据库时,出现以下错误:

The row in table 'project_obicase' with primary key '2325' has an invalid foreign key: project_obicase.ckId_id contains a value '2443' that does not have a corresponding value in project_pupiladdressck.id.
在我的/admin/site中找不到此记录“2325”。它从2324跳到2333

项目案例表:

如果我找不到对象,有没有办法解决外键问题?如果我能找到2325记录,我很乐意删除它


谢谢

我通过从DB shell中手动删除记录解决了这个问题。(因为记录没有出现在前端)

manage.py dbshell


显示所有模型
delete from table
WHERE  NOT EXISTS (SELECT 1 FROM other_table t WHERE table.id = other_table.foreign_key)