magnetar/ext_calckey_model/entity_ck/src/entities/reversi_game.rs

65 lines
1.9 KiB
Rust

//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "reversi_game")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
#[sea_orm(column_name = "createdAt")]
pub created_at: DateTimeWithTimeZone,
#[sea_orm(column_name = "startedAt")]
pub started_at: Option<DateTimeWithTimeZone>,
#[sea_orm(column_name = "user1Id")]
pub user1_id: String,
#[sea_orm(column_name = "user2Id")]
pub user2_id: String,
#[sea_orm(column_name = "user1Accepted")]
pub user1_accepted: bool,
#[sea_orm(column_name = "user2Accepted")]
pub user2_accepted: bool,
pub black: Option<i32>,
#[sea_orm(column_name = "isStarted")]
pub is_started: bool,
#[sea_orm(column_name = "isEnded")]
pub is_ended: bool,
#[sea_orm(column_name = "winnerId")]
pub winner_id: Option<String>,
pub surrendered: Option<String>,
pub logs: Json,
pub map: Vec<String>,
pub bw: String,
#[sea_orm(column_name = "isLlotheo")]
pub is_llotheo: bool,
#[sea_orm(column_name = "canPutEverywhere")]
pub can_put_everywhere: bool,
#[sea_orm(column_name = "loopedBoard")]
pub looped_board: bool,
pub form1: Option<Json>,
pub form2: Option<Json>,
pub crc32: Option<String>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::user::Entity",
from = "Column::User2Id",
to = "super::user::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
User2,
#[sea_orm(
belongs_to = "super::user::Entity",
from = "Column::User1Id",
to = "super::user::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
User1,
}
impl ActiveModelBehavior for ActiveModel {}