]> git.sesse.net Git - ccbs/blobdiff - sql/ccbs.sql
Add a template and functions for signalling user errors (as opposed to internal errors).
[ccbs] / sql / ccbs.sql
index e0b62840e2a78a63994a78038fc91d0b9aec9812..b7d342a91551b4bcd9d5185031b39c7906327352 100644 (file)
@@ -69,6 +69,16 @@ CREATE TABLE tournaments (
        UNIQUE ( season, tournamentname )
 );
 
+CREATE TABLE tournamentrankings (
+       tournament INTEGER NOT NULL REFERENCES tournaments,
+       ranking INTEGER NOT NULL,
+       player INTEGER NOT NULL REFERENCES players,
+       points INTEGER,
+
+       UNIQUE (tournament, player),
+       PRIMARY KEY (tournament, ranking)
+);
+
 CREATE TABLE rounds (
        tournament INTEGER NOT NULL REFERENCES tournaments,
        round INTEGER NOT NULL,