aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/schema.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-02 16:14:03 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-02 16:14:03 +0100
commit85dcf3ba2fd0cf907610625399db691b274118bb (patch)
tree3fd041b1de19a9d3130be2045a7f9b9bd3a85fe0 /planetwars-server/src/schema.rs
parentbdb77f97d6af5a59e80d2b2552cd6994754cbf29 (diff)
downloadplanetwars.dev-85dcf3ba2fd0cf907610625399db691b274118bb.tar.xz
planetwars.dev-85dcf3ba2fd0cf907610625399db691b274118bb.zip
store matches in database
Diffstat (limited to 'planetwars-server/src/schema.rs')
-rw-r--r--planetwars-server/src/schema.rs20
1 files changed, 19 insertions, 1 deletions
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
@@ -16,6 +16,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,
user_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,);