From 5ee66c9c9b4156692c739a861c9cdbaf0c65aec8 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Fri, 10 Jun 2022 21:09:33 +0200 Subject: allow match_player code_bundle_id to be null --- planetwars-server/src/schema.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index be3e858..92acc8e 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -31,7 +31,7 @@ table! { match_players (match_id, player_id) { match_id -> Int4, player_id -> Int4, - code_bundle_id -> Int4, + code_bundle_id -> Nullable, } } -- cgit v1.2.3 From b3df5c6f8cc59e099a2f1db3df8089af4abca02e Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 5 Jul 2022 20:34:20 +0200 Subject: migrate code_bundles to bot_versions --- planetwars-server/src/schema.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index 92acc8e..d632a32 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -5,10 +5,12 @@ table! { use diesel::sql_types::*; use crate::db_types::*; - bots (id) { + bot_versions (id) { id -> Int4, - owner_id -> Nullable, - name -> Text, + bot_id -> Nullable, + code_bundle_path -> Nullable, + created_at -> Timestamp, + container_digest -> Nullable, } } @@ -16,11 +18,10 @@ table! { use diesel::sql_types::*; use crate::db_types::*; - code_bundles (id) { + bots (id) { id -> Int4, - bot_id -> Nullable, - path -> Text, - created_at -> Timestamp, + owner_id -> Nullable, + name -> Text, } } @@ -81,16 +82,16 @@ table! { } } +joinable!(bot_versions -> bots (bot_id)); joinable!(bots -> users (owner_id)); -joinable!(code_bundles -> bots (bot_id)); -joinable!(match_players -> code_bundles (code_bundle_id)); +joinable!(match_players -> bot_versions (code_bundle_id)); joinable!(match_players -> matches (match_id)); joinable!(ratings -> bots (bot_id)); joinable!(sessions -> users (user_id)); allow_tables_to_appear_in_same_query!( + bot_versions, bots, - code_bundles, match_players, matches, ratings, -- cgit v1.2.3 From d7b7585dd70f9d41184cf88c2ecbd88341898c38 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 6 Jul 2022 22:41:27 +0200 Subject: rename code_bundle to bot_version --- planetwars-server/src/schema.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index d632a32..0606ac4 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -32,7 +32,7 @@ table! { match_players (match_id, player_id) { match_id -> Int4, player_id -> Int4, - code_bundle_id -> Nullable, + bot_version_id -> Nullable, } } @@ -84,7 +84,7 @@ table! { joinable!(bot_versions -> bots (bot_id)); joinable!(bots -> users (owner_id)); -joinable!(match_players -> bot_versions (code_bundle_id)); +joinable!(match_players -> bot_versions (bot_version_id)); joinable!(match_players -> matches (match_id)); joinable!(ratings -> bots (bot_id)); joinable!(sessions -> users (user_id)); -- cgit v1.2.3