все остальные апдейты на Кубок России
This commit is contained in:
17
sql/007_match_penalties.sql
Normal file
17
sql/007_match_penalties.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE IF NOT EXISTS match_penalty_settings (
|
||||
match_id INTEGER PRIMARY KEY REFERENCES matches(id) ON DELETE CASCADE,
|
||||
max_rounds INTEGER NOT NULL DEFAULT 5,
|
||||
created_at TIMESTAMP DEFAULT NOW(),
|
||||
updated_at TIMESTAMP DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS match_penalties (
|
||||
id SERIAL PRIMARY KEY,
|
||||
match_id INTEGER NOT NULL REFERENCES matches(id) ON DELETE CASCADE,
|
||||
side VARCHAR(10) NOT NULL CHECK (side IN ('home', 'away')),
|
||||
shot_number INTEGER NOT NULL CHECK (shot_number > 0),
|
||||
result VARCHAR(20) NOT NULL CHECK (result IN ('scored', 'missed')),
|
||||
created_at TIMESTAMP DEFAULT NOW(),
|
||||
updated_at TIMESTAMP DEFAULT NOW(),
|
||||
UNIQUE (match_id, side, shot_number)
|
||||
);
|
||||
Reference in New Issue
Block a user