]> git.sesse.net Git - ccbs/blobdiff - sql/ccbs.sql
Add a table for tournament ranking to the SQL schema.
[ccbs] / sql / ccbs.sql
index e0b62840e2a78a63994a78038fc91d0b9aec9812..44dcdf98a6617e01ac5f35a284fce98e218a765b 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,