aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/schema.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-05 20:34:20 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-05 20:34:20 +0200
commitb3df5c6f8cc59e099a2f1db3df8089af4abca02e (patch)
tree8b717834ab72165610b1548bb080a3299d936936 /planetwars-server/src/schema.rs
parent8a47b948eb88f1e0ff649880a70f9416306bac92 (diff)
downloadplanetwars.dev-b3df5c6f8cc59e099a2f1db3df8089af4abca02e.tar.xz
planetwars.dev-b3df5c6f8cc59e099a2f1db3df8089af4abca02e.zip
migrate code_bundles to bot_versions
Diffstat (limited to 'planetwars-server/src/schema.rs')
-rw-r--r--planetwars-server/src/schema.rs21
1 files changed, 11 insertions, 10 deletions
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<Int4>,
- name -> Text,
+ bot_id -> Nullable<Int4>,
+ code_bundle_path -> Nullable<Text>,
+ created_at -> Timestamp,
+ container_digest -> Nullable<Text>,
}
}
@@ -16,11 +18,10 @@ table! {
use diesel::sql_types::*;
use crate::db_types::*;
- code_bundles (id) {
+ bots (id) {
id -> Int4,
- bot_id -> Nullable<Int4>,
- path -> Text,
- created_at -> Timestamp,
+ owner_id -> Nullable<Int4>,
+ 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,