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, #[sea_orm(default_value = "false")] pub muted: bool, #[sea_orm(belongs_to, from = "chat_id", to = "id")] pub chat: BelongsTo, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}