From aa066ef5bb9ed043feafd0e87e219cb34cce35c5 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 23 Aug 2022 20:00:21 +0200 Subject: create maps table --- planetwars-server/src/schema.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index 70889b1..adc6555 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -26,6 +26,17 @@ table! { } } +table! { + use diesel::sql_types::*; + use crate::db_types::*; + + maps (id) { + id -> Int4, + name -> Text, + file_path -> Text, + } +} + table! { use diesel::sql_types::*; use crate::db_types::*; @@ -48,6 +59,7 @@ table! { created_at -> Timestamp, winner -> Nullable, is_public -> Bool, + map_id -> Nullable, } } @@ -87,12 +99,14 @@ table! { joinable!(bots -> users (owner_id)); joinable!(match_players -> bot_versions (bot_version_id)); joinable!(match_players -> matches (match_id)); +joinable!(matches -> maps (map_id)); joinable!(ratings -> bots (bot_id)); joinable!(sessions -> users (user_id)); allow_tables_to_appear_in_same_query!( bot_versions, bots, + maps, match_players, matches, ratings, -- cgit v1.2.3