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_edits")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub message_id: Uuid, pub editor_id: Uuid, pub previous_body: String, pub edited_at: OffsetDateTime, #[sea_orm(belongs_to, from = "message_id", to = "id")] pub message: BelongsTo, #[sea_orm(belongs_to, from = "editor_id", to = "uid")] pub editor: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}