From 52fe6d6e5996a5d8270dc524a776b45dbf11ce2c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 13 Feb 2005 16:05:57 +0000 Subject: [PATCH] Even more SQL syntax fixes (the schemas import into psql now). --- ccbs.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ccbs.sql b/ccbs.sql index 95ed22e..74fa439 100644 --- a/ccbs.sql +++ b/ccbs.sql @@ -25,7 +25,7 @@ CREATE TABLE seasons ( name VARCHAR NOT NULL ); -CREATE TABLE tournament ( +CREATE TABLE tournaments ( tournament SERIAL PRIMARY KEY, season INTEGER NOT NULL REFERENCES seasons, name VARCHAR NOT NULL @@ -77,14 +77,14 @@ CREATE TABLE scores ( player INTEGER NOT NULL REFERENCES players, song INTEGER NOT NULL REFERENCES songs, - playmode VARCHAR CHECK playmode IS NULL OR playmode IN ('single','double'), - difficulty VARCHAR CHECK difficulty IS NULL OR difficulty IN ('beginner','standard','difficult','expert','challenge'), + playmode VARCHAR CHECK (playmode IS NULL OR playmode IN ('single','double')), + difficulty VARCHAR CHECK (difficulty IS NULL OR difficulty IN ('beginner','standard','difficult','expert','challenge')), chosen BOOLEAN NOT NULL, score INTEGER NOT NULL CHECK (score >= 0 AND score <= 10000), FOREIGN KEY (song) REFERENCES songs (song), - FOREIGN KEY (song, playmode, difficulty) REFERENCES songs (song, playmode, difficulty), + FOREIGN KEY (song, playmode, difficulty) REFERENCES songratings (song, playmode, difficulty), FOREIGN KEY (tournament, round, parallel, player) REFERENCES roundparticipation (tournament, round, parallel, player), PRIMARY KEY (tournament, round, parallel, player, song) ); -- 2.39.2