From 8fd4321944a40a0a011ec82ef7dcbc5e694f6dd9 Mon Sep 17 00:00:00 2001 From: Neshura Date: Sat, 2 Sep 2023 20:23:13 +0200 Subject: [PATCH] DB Schema Update --- src/db/schemas.rs | 11 ++++++----- src/v2/mod.rs | 4 ++-- src/v2/schemas.rs | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/db/schemas.rs b/src/db/schemas.rs index a988eec..0294935 100644 --- a/src/db/schemas.rs +++ b/src/db/schemas.rs @@ -13,7 +13,7 @@ pub struct Portrait { pub id: i32, pub group_id: i32, pub hires: String, - pub lores: Option, + pub lores: String, } #[derive(Serialize, ToSchema, Debug, FromRow)] @@ -39,12 +39,13 @@ pub struct Ethic { #[derive(Serialize, ToSchema, Debug, FromRow)] pub struct Empire { pub id: i32, - pub discord_user: Option, pub group_id: i32, - pub gestalt: Option, // TODO: make nn in DB schema - pub empire_portrait_id: i32, - pub empire_portrait_group_id: i32, pub group_game_id: i32, + pub name: String, + pub discord_user: Option, + pub gestalt: bool, + pub empire_portrait_id: Option, + pub empire_portrait_group_id: Option, } #[derive(Serialize, ToSchema, Debug, FromRow)] diff --git a/src/v2/mod.rs b/src/v2/mod.rs index 80c9353..e2f27f6 100644 --- a/src/v2/mod.rs +++ b/src/v2/mod.rs @@ -74,7 +74,7 @@ pub(crate) async fn empires( empire_portrait_id: entry.empire_portrait_id, group_game_id: entry.group_game_id, discord_user: None, - gestalt: entry.gestalt + gestalt: Some(entry.gestalt) }; if let Some(auth_token) = params.token.clone() { @@ -249,7 +249,7 @@ pub(crate) async fn portraits( id: entry.id, group_id: entry.group_id, hires: entry.hires.clone(), - lores: entry.lores.clone() + lores: Some(entry.lores.clone()) }; parsed_data.push(new_data); diff --git a/src/v2/schemas.rs b/src/v2/schemas.rs index 03c37ad..859911a 100644 --- a/src/v2/schemas.rs +++ b/src/v2/schemas.rs @@ -47,8 +47,8 @@ pub struct Empire { pub discord_user: Option, pub group_id: i32, pub gestalt: Option, // TODO: make nn in DB schema - pub empire_portrait_id: i32, - pub empire_portrait_group_id: i32, + pub empire_portrait_id: Option, + pub empire_portrait_group_id: Option, pub group_game_id: i32, }