a06673b
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<Uuid>,
pub role_id: Option<Uuid>,
pub channel_id: Option<Uuid>,
pub is_everyone: bool,
pub is_here: bool,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "message_id", to = "id")]
pub message: BelongsTo<super::chat_messages::Entity>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<Option<super::super::user::users::Entity>>,
#[sea_orm(belongs_to, from = "channel_id", to = "id")]
pub channel: BelongsTo<Option<super::super::channel::channels::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}