Skip to content
Clone
a06673b
24 lines 796 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 = "issue_content_history")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub issue_id: Uuid,
pub poster_id: Uuid,
pub comment_id: Option<Uuid>,
pub content_before: Option<String>,
pub content_after: Option<String>,
pub edited_at: OffsetDateTime,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "issue_id", to = "id")]
pub issue: BelongsTo<super::issue::Entity>,
#[sea_orm(belongs_to, from = "poster_id", to = "uid")]
pub poster: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}