From: Steinar H. Gunderson Date: Sun, 13 Feb 2005 16:22:07 +0000 (+0000) Subject: Changes to adjust better to the old SQL schemas. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=f3d6b9c93f0615a9d6a50d19f257cab6e88bfe2c;hp=52fe6d6e5996a5d8270dc524a776b45dbf11ce2c Changes to adjust better to the old SQL schemas. --- diff --git a/ccbs.sql b/ccbs.sql index 74fa439..64b7942 100644 --- a/ccbs.sql +++ b/ccbs.sql @@ -1,13 +1,30 @@ -- vim:set tw=0: +CREATE TABLE machines ( + machine SERIAL PRIMARY KEY, + name VARCHAR NOT NULL +); + +CREATE TABLE countries ( + country SERIAL PRIMARY KEY, + name VARCHAR NOT NULL +); + CREATE TABLE songs ( song SERIAL PRIMARY KEY, title VARCHAR NOT NULL, artist VARCHAR NOT NULL ); +-- CREATE TABLE machinesongs etc. + +CREATE TABLE scoringsystems ( + scoringsystem SERIAL PRIMARY KEY, + name VARCHAR NOT NULL +); + CREATE TABLE songratings ( - song INTEGER NOT NULL REFERENCES songs, + song INTEGER NOT NULL REFERENCES songs, -- strictly song+machine playmode VARCHAR NOT NULL CHECK (playmode IN ('single','double')), difficulty VARCHAR NOT NULL CHECK (difficulty IN ('beginner','standard','difficult','expert','challenge')), feetrating INTEGER NOT NULL CHECK (feetrating >= 0 AND feetrating <= 10), @@ -28,7 +45,12 @@ CREATE TABLE seasons ( CREATE TABLE tournaments ( tournament SERIAL PRIMARY KEY, season INTEGER NOT NULL REFERENCES seasons, - name VARCHAR NOT NULL + name VARCHAR NOT NULL, + country INTEGER NOT NULL REFERENCES countries, + location VARCHAR NOT NULL, + "date" DATE NOT NULL, + machine INTEGER NOT NULL REFERENCES machines, + scoringsystem INTEGER NOT NULL REFERENCES scoringsystems ); CREATE TABLE rounds (