database: add entry for starting_player

This commit is contained in:
Maximilian Keßler 2023-06-24 17:22:37 +02:00
parent 19501aa4da
commit 205380d1fa
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 13 additions and 11 deletions

View file

@ -0,0 +1 @@
from .database import cur, conn

View file

@ -12,17 +12,18 @@ CREATE INDEX seeds_variant_idx ON seeds (variant_id);
DROP TABLE IF EXISTS games CASCADE; DROP TABLE IF EXISTS games CASCADE;
CREATE TABLE games ( CREATE TABLE games (
id INT PRIMARY KEY, id INT PRIMARY KEY,
seed TEXT NOT NULL REFERENCES seeds, seed TEXT NOT NULL REFERENCES seeds,
num_players SMALLINT NOT NULL, num_players SMALLINT NOT NULL,
score SMALLINT NOT NULL, starting_player SMALLINT NOT NULL DEFAULT 0,
variant_id SMALLINT NOT NULL, score SMALLINT NOT NULL,
deck_plays BOOLEAN, variant_id SMALLINT NOT NULL,
one_extra_card BOOLEAN, deck_plays BOOLEAN,
one_less_card BOOLEAN, one_extra_card BOOLEAN,
all_or_nothing BOOLEAN, one_less_card BOOLEAN,
num_turns SMALLINT, all_or_nothing BOOLEAN,
actions TEXT num_turns SMALLINT,
actions TEXT
); );
CREATE INDEX games_seed_score_idx ON games (seed, score); CREATE INDEX games_seed_score_idx ON games (seed, score);
CREATE INDEX games_var_seed_idx ON games (variant_id, seed); CREATE INDEX games_var_seed_idx ON games (variant_id, seed);