This repository has been archived on 2024-08-06. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
chellaris-rust-api/src/db/schemas.rs

58 lines
1.2 KiB
Rust
Raw Normal View History

2023-08-25 03:42:19 +02:00
use serde::Serialize;
use sqlx::FromRow;
use utoipa::ToSchema;
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct PortraitGroup {
pub id: i32,
pub name: String,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct Portrait {
pub id: i32,
pub group_id: i32,
pub hires: String,
pub lores: Option<String>,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct Game {
pub id: i32,
pub name: String,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct GameGroup {
pub id: i32,
pub game_id: i32,
pub name: String,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct Ethic {
pub id: i32,
pub name: String,
pub machine_ethic: bool,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct Empire {
pub id: i32,
pub discord_user: Option<String>,
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,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct EmpireEthic {
pub empires_id: i32,
pub empires_group_id: i32,
pub empires_group_game_id: i32,
pub ethics_id: i32,
pub ethics_fanatic: bool,
}