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, pub note: Option, pub created_by: Uuid, pub created_at: OffsetDateTime, pub updated_at: Option, #[sea_orm(belongs_to, relation_enum = "User", from = "user_id", to = "uid")] pub user: BelongsTo, #[sea_orm( belongs_to, relation_enum = "CreatedBy", from = "created_by", to = "uid" )] pub creator: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}