Skip to content
Clone
a06673b
21 lines 689 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_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<super::chat_messages::Entity>,
#[sea_orm(belongs_to, from = "editor_id", to = "uid")]
pub editor: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}