forked from Hanabi/hanabi-league
introduce endgames table
This commit is contained in:
parent
4e459c4888
commit
d717a9df36
1 changed files with 16 additions and 0 deletions
|
@ -359,3 +359,19 @@ CREATE TABLE user_statistics (
|
||||||
average_game_moves REAL GENERATED ALWAYS AS (CASE WHEN games_played != 0 THEN CAST(total_game_moves AS REAL) / games_played ELSE NULL END) STORED,
|
average_game_moves REAL GENERATED ALWAYS AS (CASE WHEN games_played != 0 THEN CAST(total_game_moves AS REAL) / games_played ELSE NULL END) STORED,
|
||||||
PRIMARY KEY (user_id, variant_type)
|
PRIMARY KEY (user_id, variant_type)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS endgames;
|
||||||
|
CREATE TABLE endgames (
|
||||||
|
game_id INTEGER NOT NULL REFERENCES games (id),
|
||||||
|
turn SMALLINT NOT NULL,
|
||||||
|
/**
|
||||||
|
* We want to be able to store probabilities for different actions that can be taken.
|
||||||
|
* We use the same encoding as in the game_actions table, except that for clues, we do not store values.
|
||||||
|
*/
|
||||||
|
action_type SMALLINT NOT NULL,
|
||||||
|
action_target SMALLINT NOT NULL,
|
||||||
|
enumerator INTEGER NOT NULL,
|
||||||
|
denominator INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (game_id, turn, action_type, action_target)
|
||||||
|
);
|
Loading…
Reference in a new issue