Feature Parity with python variant

This commit is contained in:
Neshura 2023-08-25 03:42:19 +02:00
parent 83bf813bb1
commit e19187d6c7
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
11 changed files with 3585 additions and 1 deletions

57
src/db/schemas.rs Normal file
View file

@ -0,0 +1,57 @@
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,
}