Propagating changes
- Enable
PRAGMA foreign_keys = ON - Add
k PRIMARY KEYto the parent tablet1 - Add
FOREIGN KEY(k) REFERENCES t(k)to the child table Optionally specify
FOREIGN KEY … ON DELETE actionFOREIGN KEY … ON UPDATE action
with
actionbeing one of:RESTRICTSET NULLSET DEFAULTCASCADE
Footnotes:
1
The parent column must be PRIMARY KEY, or “foreign key mismatch” error is shown.