//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.5 use crate::serialization; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] #[sea_orm(table_name = "user")] pub struct Model { #[sea_orm(primary_key)] pub id: u64, #[sea_orm(unique)] #[serde(serialize_with = "serialization::vec_as_address")] pub address: Vec, pub description: Option, pub email: Option, pub user_tier_id: u64, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm(has_many = "super::login::Entity")] Login, #[sea_orm(has_many = "super::rpc_key::Entity")] RpcKey, #[sea_orm(has_many = "super::secondary_user::Entity")] SecondaryUser, #[sea_orm( belongs_to = "super::user_tier::Entity", from = "Column::UserTierId", to = "super::user_tier::Column::Id", on_update = "NoAction", on_delete = "NoAction" )] UserTier, } impl Related for Entity { fn to() -> RelationDef { Relation::Login.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::RpcKey.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::SecondaryUser.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::UserTier.def() } } impl ActiveModelBehavior for ActiveModel {}