From d717a9df36c4b56e0401baa3447be4dbbee1d3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 9 Jan 2024 15:10:15 +0100 Subject: [PATCH] introduce endgames table --- install/database_schema.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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