Skip to content
Snippets Groups Projects
Commit 30287377 authored by Nikita Pettik's avatar Nikita Pettik Committed by Kirill Yukhin
Browse files

sql: prohibit creation of FK on unexisting tables

Originally, SQLite allows to create table with foreign keys constraint
which refers to yet not created parent table. For instance:

CREATE TABLE child(id INT PRIMARY KEY REFERENCES parent);
CREATE TABLE parent(id INT PRIMARY KEY);

This patch bans such ability since it contradicts SQL ANSI.
Moreover, SQLite allows to drop parent table if deletion of all rows
wouldn't result in FK constraint violations. This feature has been
removed since in such situation child table would become inconsistent.

Finally, within current patch ability to create FK constraints on VIEWs
is banned as well.

Part of #3271
parent 52bbfc7d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment