Rudolf Adamkovič Personal site


Propagating changes

  1. Enable PRAGMA foreign_keys = ON
  2. Add k PRIMARY KEY to the parent table t 40
  3. Add FOREIGN KEY(k) REFERENCES t(k) to the child table
  4. Optionally specify
    • FOREIGN KEY … ON DELETE action
    • FOREIGN KEY … ON UPDATE action

    with action being one of:

    • RESTRICT
    • SET NULL
    • SET DEFAULT
    • CASCADE

Footnotes

(40)

The parent column must be PRIMARY KEY, or “foreign key mismatch” error is shown.


© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.