~starkingdoms/starkingdoms

ref: 46f8a043009f416bb9780fc44c0b888127e1cd30 starkingdoms/api/starkingdoms_api_entities/src/entity/user_auth_realm.rs -rw-r--r-- 1019 bytes
46f8a043 — c0repwn3r fix! fix! fix! fix! fix! fix! fix! fix! infra overhaul 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.2

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "user_auth_realm")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: String,
    pub realm: String,
    pub realm_native_id: String,
    pub user: String,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "super::user::Entity",
        from = "Column::User",
        to = "super::user::Column::Id",
        on_update = "NoAction",
        on_delete = "NoAction"
    )]
    User,
    #[sea_orm(has_many = "super::user_savefile::Entity")]
    UserSavefile,
}

impl Related<super::user::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::User.def()
    }
}

impl Related<super::user_savefile::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::UserSavefile.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}