Automatically delete members when families are deleted

This commit is contained in:
2023-08-04 19:17:51 +02:00
parent f344765dd8
commit 8f5131429f
6 changed files with 34 additions and 9 deletions

View File

@ -46,8 +46,8 @@ CREATE TABLE members (
sex VARCHAR(1) NULL,
time_create BIGINT NOT NULL,
time_update BIGINT NOT NULL,
mother integer NULL REFERENCES members,
father integer NULL REFERENCES members,
mother integer NULL REFERENCES members ON DELETE SET NULL,
father integer NULL REFERENCES members ON DELETE SET NULL,
birth_year smallint NULL,
birth_month smallint NULL,
birth_day smallint NULL,