You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
570 B
20 lines
570 B
1 year ago
|
CREATE TABLE IF NOT EXISTS periods (
|
||
|
id SERIAL PRIMARY KEY NOT NULL,
|
||
|
-- which kind of period is it: 1st, 2nd, third, SO, OT, 5OT, etc.
|
||
|
period_type INTEGER NOT NULL,
|
||
|
-- length of period in seconds
|
||
|
period_length INTEGER NOT NULL,
|
||
|
-- which game does this period refer to
|
||
|
game INTEGER NOT NULL,
|
||
|
-- period type must exists
|
||
|
CONSTRAINT period_type_fk
|
||
|
FOREIGN KEY(period_type)
|
||
|
REFERENCES period_types(id)
|
||
|
ON DELETE RESTRICT,
|
||
|
-- game must exist
|
||
|
CONSTRAINT game_fk
|
||
|
FOREIGN KEY(game)
|
||
|
REFERENCES games(id)
|
||
|
ON DELETE RESTRICT
|
||
|
);
|