Skip to content
Clone
903589c
28 lines 845 B Rust
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "admin_user")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub user_id: Uuid,
pub tag: Option<String>,
pub note: Option<String>,
pub created_by: Uuid,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, relation_enum = "User", from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::user::users::Entity>,
#[sea_orm(
belongs_to,
relation_enum = "CreatedBy",
from = "created_by",
to = "uid"
)]
pub creator: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}