Can create couple

This commit is contained in:
2023-08-07 16:50:22 +02:00
parent 75438f4ae0
commit 29c503a6b0
10 changed files with 367 additions and 15 deletions

View File

@ -68,17 +68,20 @@ CREATE TABLE members (
);
CREATE TABLE couples (
wife integer NOT NULL REFERENCES members,
husband integer NOT NULL REFERENCES members,
id SERIAL PRIMARY KEY,
family_id integer NOT NULL REFERENCES families,
wife integer NULL REFERENCES members,
husband integer NULL REFERENCES members,
state varchar(1) NULL,
photo_id INTEGER NULL REFERENCES photos ON DELETE SET NULL,
time_create BIGINT NOT NULL,
time_update BIGINT NOT NULL,
wedding_year smallint NULL,
wedding_month smallint NULL,
wedding_day smallint NULL,
divorce_year smallint NULL,
divorce_month smallint NULL,
divorce_day smallint NULL,
PRIMARY KEY(wife, husband)
divorce_day smallint NULL
);
-- Create views