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_platform_bans")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub user_id: Uuid, pub reason: Option, pub duration: Option, pub banned_by: Uuid, pub revoked_by: Option, pub created_at: OffsetDateTime, pub expires_at: Option, pub revoked_at: Option, #[sea_orm(belongs_to, relation_enum = "BannedUser", from = "user_id", to = "uid")] pub user: BelongsTo, #[sea_orm(belongs_to, relation_enum = "BannedBy", from = "banned_by", to = "uid")] pub ban_actor: BelongsTo, #[sea_orm( belongs_to, relation_enum = "RevokedBy", from = "revoked_by", to = "uid" )] pub revoker: BelongsTo>, } impl ActiveModelBehavior for ActiveModel {}