Skip to content
Clone
a06673b
23 lines 769 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 = "chat_member")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub chat_id: Uuid,
#[sea_orm(primary_key, auto_increment = false)]
pub user_id: Uuid,
pub joined_at: OffsetDateTime,
pub last_read_at: Option<OffsetDateTime>,
#[sea_orm(default_value = "false")]
pub muted: bool,
#[sea_orm(belongs_to, from = "chat_id", to = "id")]
pub chat: BelongsTo<super::chats::Entity>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}