我有三个表:organization,organization_teams和org_users.这里organization_teams是从组织继承的.所以假设如果在organizational_teams中添加了一个记录,那么它将在organization_teams中将组织表id作为id列的值.
org_users在组织的id列上有外键.现在,当我尝试在org_users中插入数据时,会给出如下错误
insert or update on table "org_users" violates foreign key constraint "org_users_organizations" DETAIL: Key (org_id)=(12) is not present in table "organizations"
为什么?