From f3d6b9c93f0615a9d6a50d19f257cab6e88bfe2c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 13 Feb 2005 16:22:07 +0000 Subject: [PATCH] Changes to adjust better to the old SQL schemas. --- ccbs.sql | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) 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 ( -- 2.39.2