//! `SeaORM` Entity, manually maintained

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "post_revisions")]
pub struct Model {
    pub created_at: DateTimeWithTimeZone,
    pub updated_at: DateTimeWithTimeZone,
    #[sea_orm(primary_key)]
    pub id: i32,
    pub post_slug: String,
    pub post_title: Option<String>,
    pub operation: String,
    #[sea_orm(column_type = "Text", nullable)]
    pub revision_reason: Option<String>,
    pub actor_username: Option<String>,
    pub actor_email: Option<String>,
    pub actor_source: Option<String>,
    #[sea_orm(column_type = "Text", nullable)]
    pub markdown: Option<String>,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub metadata: Option<Json>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
