Can create couple
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user