From ae57359353cf31ff374a8932999742920878bf00 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 12 Oct 2022 22:52:15 +0200 Subject: upgrade to diesel 2.0 --- planetwars-server/src/schema.rs | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'planetwars-server/src/schema.rs') diff --git a/planetwars-server/src/schema.rs b/planetwars-server/src/schema.rs index adc6555..27ebebe 100644 --- a/planetwars-server/src/schema.rs +++ b/planetwars-server/src/schema.rs @@ -1,7 +1,15 @@ // This file is autogenerated by diesel #![allow(unused_imports)] -table! { +// @generated automatically by Diesel CLI. + +pub mod sql_types { + #[derive(diesel::sql_types::SqlType)] + #[diesel(postgres_type(name = "match_state"))] + pub struct MatchState; +} + +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -14,7 +22,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -26,7 +34,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -37,7 +45,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -48,13 +56,14 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; + use super::sql_types::MatchState; matches (id) { id -> Int4, - state -> Match_state, + state -> MatchState, log_path -> Text, created_at -> Timestamp, winner -> Nullable, @@ -63,7 +72,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -73,7 +82,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -84,7 +93,7 @@ table! { } } -table! { +diesel::table! { use diesel::sql_types::*; use crate::db_types::*; @@ -96,14 +105,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)); +diesel::joinable!(bots -> users (owner_id)); +diesel::joinable!(match_players -> bot_versions (bot_version_id)); +diesel::joinable!(match_players -> matches (match_id)); +diesel::joinable!(matches -> maps (map_id)); +diesel::joinable!(ratings -> bots (bot_id)); +diesel::joinable!(sessions -> users (user_id)); -allow_tables_to_appear_in_same_query!( +diesel::allow_tables_to_appear_in_same_query!( bot_versions, bots, maps, -- cgit v1.2.3