X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=sql%2Fccbs.sql;h=c13c666774d872d199351fe59b01ba43fa468f3d;hp=e0b62840e2a78a63994a78038fc91d0b9aec9812;hb=c73f95e10416d77bea35c2e409f3d6cd4b81143a;hpb=aee1f77ca1957086ed876b49e1b5e4f744eef2f2 diff --git a/sql/ccbs.sql b/sql/ccbs.sql index e0b6284..c13c666 100644 --- a/sql/ccbs.sql +++ b/sql/ccbs.sql @@ -69,11 +69,30 @@ CREATE TABLE tournaments ( UNIQUE ( season, tournamentname ) ); +CREATE TABLE tournamentparticipation ( + tournament INTEGER NOT NULL REFERENCES tournaments, + player INTEGER NOT NULL REFERENCES players, + paid BOOLEAN NOT NULL, + + PRIMARY KEY ( tournament, player ) +); + +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, randomsongs INTEGER NOT NULL, chosensongs INTEGER NOT NULL, + numqualifying INTEGER, PRIMARY KEY (tournament, round) );