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_user_draft")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, #[sea_orm(indexed)] pub user_id: i64, #[sea_orm(indexed)] pub room_id: Uuid, pub thread_id: Option, pub content: String, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, #[sea_orm(belongs_to, from = "room_id", to = "id")] pub room: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}