use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "chat_message_mentions")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, #[sea_orm(indexed)] pub message_id: Uuid, pub user_id: Option, pub role_id: Option, pub channel_id: Option, pub is_everyone: bool, pub is_here: bool, pub created_at: OffsetDateTime, #[sea_orm(belongs_to, from = "message_id", to = "id")] pub message: BelongsTo, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo>, #[sea_orm(belongs_to, from = "channel_id", to = "id")] pub channel: BelongsTo>, } impl ActiveModelBehavior for ActiveModel {}