🚀 Patch auto

This commit is contained in:
karim hassan
2025-08-24 23:00:40 +00:00
parent 92e6afff00
commit f1103d67a0
1314 changed files with 2511 additions and 562 deletions

31
sql/schema.sql Normal file
View File

@@ -0,0 +1,31 @@
-- Schema for Super Sunday
CREATE TABLE IF NOT EXISTS tournaments (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
location TEXT,
start_date DATE,
end_date DATE,
description TEXT,
created_at TIMESTAMP DEFAULT now()
);
CREATE TABLE IF NOT EXISTS participants (
id SERIAL PRIMARY KEY,
tournament_id INTEGER REFERENCES tournaments(id) ON DELETE CASCADE,
name TEXT NOT NULL,
rating NUMERIC,
created_at TIMESTAMP DEFAULT now()
);
CREATE TABLE IF NOT EXISTS matches (
id SERIAL PRIMARY KEY,
tournament_id INTEGER REFERENCES tournaments(id) ON DELETE CASCADE,
court TEXT,
start_time TIMESTAMP,
team_a TEXT,
team_b TEXT,
score_a INTEGER,
score_b INTEGER,
finished BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT now()
);