All checks were successful
Build Crate / build (push) Successful in 1m45s
54 lines
1.4 KiB
Rust
54 lines
1.4 KiB
Rust
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "team_result")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
pub place: i32,
|
|
pub score: Option<i32>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(has_many = "super::game_to_team_result::Entity")]
|
|
GameToTeamResult,
|
|
#[sea_orm(has_many = "super::team_result_to_user::Entity")]
|
|
TeamResultToUser,
|
|
}
|
|
|
|
impl Related<super::game_to_team_result::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::GameToTeamResult.def()
|
|
}
|
|
}
|
|
|
|
impl Related<super::team_result_to_user::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::TeamResultToUser.def()
|
|
}
|
|
}
|
|
|
|
impl Related<super::game::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
super::game_to_team_result::Relation::Game.def()
|
|
}
|
|
fn via() -> Option<RelationDef> {
|
|
Some(super::game_to_team_result::Relation::TeamResult.def().rev())
|
|
}
|
|
}
|
|
|
|
impl Related<super::user::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
super::team_result_to_user::Relation::User.def()
|
|
}
|
|
fn via() -> Option<RelationDef> {
|
|
Some(super::team_result_to_user::Relation::TeamResult.def().rev())
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|