From 85dcf3ba2fd0cf907610625399db691b274118bb Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 2 Jan 2022 16:14:03 +0100 Subject: store matches in database --- planetwars-server/src/schema.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index bf58434..413c4d1 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -15,6 +15,22 @@ table! { } } +table! { + match_players (match_id, player_id) { + match_id -> Int4, + bot_id -> Int4, + player_id -> Int4, + } +} + +table! { + matches (id) { + id -> Int4, + log_path -> Text, + created_at -> Timestamp, + } +} + table! { sessions (id) { id -> Int4, @@ -34,6 +50,8 @@ table! { joinable!(bots -> users (owner_id)); joinable!(code_bundles -> bots (bot_id)); +joinable!(match_players -> bots (bot_id)); +joinable!(match_players -> matches (match_id)); joinable!(sessions -> users (user_id)); -allow_tables_to_appear_in_same_query!(bots, code_bundles, sessions, users,); +allow_tables_to_appear_in_same_query!(bots, code_bundles, match_players, matches, sessions, users,); -- cgit v1.2.3