Skip to content
Clone
a06673b
22 lines 705 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_reads")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub chat_id: Uuid,
pub user_id: Uuid,
pub thread_id: Option<Uuid>,
pub last_read_message_id: Option<Uuid>,
pub updated_at: OffsetDateTime,
#[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 {}