~starkingdoms/starkingdoms

ref: 5f350d52e4cdaabfe0b388f9ad18b7f07aba8673 starkingdoms/api/starkingdoms_api_entities/src/entity/user_savefile.rs -rw-r--r-- 874 bytes
5f350d52TerraMaster85 Favicon 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
//! `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_savefile")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: String,
    pub user: String,
    pub data: String,
    #[sea_orm(unique)]
    pub timestamp: i64,
}

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

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

impl ActiveModelBehavior for ActiveModel {}