This repository has been archived on 2024-08-06. You can view files and clone it, but cannot push or open issues or pull requests.
chellaris-rust-api/src/db/schemas.rs

57 lines
1.1 KiB
Rust

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: 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 group_id: i32,
pub game_id: i32,
pub name: String,
pub discord_user: Option<String>,
pub gestalt: bool,
pub portrait_id: i32,
pub portrait_group_id: i32,
}
#[derive(Serialize, ToSchema, Debug, FromRow)]
pub struct EmpireEthic {
pub empire_id: i32,
pub empire_game_id: i32,
pub ethics_id: i32,
pub fanatic: bool,
}