From a7d56ba0f54273920743109fe1a6541030f3c003 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Mon, 9 May 2022 19:41:33 +0200 Subject: add ratings table --- planetwars-server/src/schema.rs | 21 ++++++++++++++++++++- 1 file changed, 20 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 ae2e60c..812e05e 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -47,6 +47,16 @@ table! { } } +table! { + use diesel::sql_types::*; + use crate::db_types::*; + + ratings (bot_id) { + bot_id -> Int4, + rating -> Float8, + } +} + table! { use diesel::sql_types::*; use crate::db_types::*; @@ -74,6 +84,15 @@ joinable!(bots -> users (owner_id)); joinable!(code_bundles -> bots (bot_id)); joinable!(match_players -> code_bundles (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!(bots, code_bundles, match_players, matches, sessions, users,); +allow_tables_to_appear_in_same_query!( + bots, + code_bundles, + match_players, + matches, + ratings, + sessions, + users, +); -- cgit v1.2.3