What is causing this sqlite foreign key mismatch?

拥有回忆 提交于 2019-12-01 16:05:40

The documentation says:

Usually, the parent key of a foreign key constraint is the primary key of the parent table. If they are not the primary key, then the parent key columns must be collectively subject to a UNIQUE constraint or have a UNIQUE index.

In the pipelines table, neither the name nor the owner columns are, by themselves, unique.

I guess you actually want to have a two-column foreign key in the tasks table:

FOREIGN KEY(pipeline, owner) REFERENCES pipelines(name, owner)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!