diff --git a/install/database_schema.sql b/install/database_schema.sql index f468e43..fb66f2a 100644 --- a/install/database_schema.sql +++ b/install/database_schema.sql @@ -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, 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) +); \ No newline at end of file