fix database schema: add number of players

This commit is contained in:
Maximilian Keßler 2023-11-22 17:12:45 +01:00
parent 38b9db5b8f
commit cc8dd2a90c
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -244,8 +244,11 @@ CREATE TABLE seeds (
*/ */
DROP TABLE IF EXISTS variant_base_ratings CASCADE; DROP TABLE IF EXISTS variant_base_ratings CASCADE;
CREATE TABLE variant_base_ratings ( CREATE TABLE variant_base_ratings (
variant_id SMALLINT PRIMARY KEY, /* Note that a variant already includes the number of suits, so we do not have to add this here. */
rating REAL NOT NULL variant_id SMALLINT,
player_count SMALLINT NOT NULL
rating REAL NOT NULL,
PRIMARY KEY (variant_id, player_count)
); );
/** /**
@ -257,6 +260,7 @@ CREATE TABLE variant_ratings (
league_id INTEGER PRIMARY KEY REFERENCES games, league_id INTEGER PRIMARY KEY REFERENCES games,
variant_id SMALLINT NOT NULL, variant_id SMALLINT NOT NULL,
player_count SMALLINT NOT NULL,
change REAL NOT NULL, change REAL NOT NULL,
value_after REAL NOT NULL, value_after REAL NOT NULL,