Skip to content
Clone
main
25 lines 818 B Rust
use sea_orm::JsonValue;
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "chat_message_edit")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(indexed)]
pub message_id: Uuid,
pub editor_id: i64,
pub content: String,
#[sea_orm(column_type = "JsonBinary", default_value = "[]")]
pub attachments: JsonValue,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "message_id", to = "id")]
pub message: BelongsTo<super::messages::Entity>,
#[sea_orm(belongs_to, from = "editor_id", to = "uid")]
pub editor: BelongsTo<super::super::users::user::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}