DB Schema Update

This commit is contained in:
Neshura 2023-09-02 20:23:13 +02:00
parent 07e6df6b64
commit 8fd4321944
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
3 changed files with 10 additions and 9 deletions

View file

@ -13,7 +13,7 @@ pub struct Portrait {
pub id: i32, pub id: i32,
pub group_id: i32, pub group_id: i32,
pub hires: String, pub hires: String,
pub lores: Option<String>, pub lores: String,
} }
#[derive(Serialize, ToSchema, Debug, FromRow)] #[derive(Serialize, ToSchema, Debug, FromRow)]
@ -39,12 +39,13 @@ pub struct Ethic {
#[derive(Serialize, ToSchema, Debug, FromRow)] #[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct Empire { pub struct Empire {
pub id: i32, pub id: i32,
pub discord_user: Option<String>,
pub group_id: i32, pub group_id: i32,
pub gestalt: Option<bool>, // TODO: make nn in DB schema
pub empire_portrait_id: i32,
pub empire_portrait_group_id: i32,
pub group_game_id: i32, pub group_game_id: i32,
pub name: String,
pub discord_user: Option<String>,
pub gestalt: bool,
pub empire_portrait_id: Option<i32>,
pub empire_portrait_group_id: Option<i32>,
} }
#[derive(Serialize, ToSchema, Debug, FromRow)] #[derive(Serialize, ToSchema, Debug, FromRow)]

View file

@ -74,7 +74,7 @@ pub(crate) async fn empires(
empire_portrait_id: entry.empire_portrait_id, empire_portrait_id: entry.empire_portrait_id,
group_game_id: entry.group_game_id, group_game_id: entry.group_game_id,
discord_user: None, discord_user: None,
gestalt: entry.gestalt gestalt: Some(entry.gestalt)
}; };
if let Some(auth_token) = params.token.clone() { if let Some(auth_token) = params.token.clone() {
@ -249,7 +249,7 @@ pub(crate) async fn portraits(
id: entry.id, id: entry.id,
group_id: entry.group_id, group_id: entry.group_id,
hires: entry.hires.clone(), hires: entry.hires.clone(),
lores: entry.lores.clone() lores: Some(entry.lores.clone())
}; };
parsed_data.push(new_data); parsed_data.push(new_data);

View file

@ -47,8 +47,8 @@ pub struct Empire {
pub discord_user: Option<String>, pub discord_user: Option<String>,
pub group_id: i32, pub group_id: i32,
pub gestalt: Option<bool>, // TODO: make nn in DB schema pub gestalt: Option<bool>, // TODO: make nn in DB schema
pub empire_portrait_id: i32, pub empire_portrait_id: Option<i32>,
pub empire_portrait_group_id: i32, pub empire_portrait_group_id: Option<i32>,
pub group_game_id: i32, pub group_game_id: i32,
} }