//! `SeaORM` Entity, manually maintained

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

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "posts")]
pub struct Model {
    pub created_at: DateTimeWithTimeZone,
    pub updated_at: DateTimeWithTimeZone,
    #[sea_orm(primary_key)]
    pub id: i32,
    pub title: Option<String>,
    pub slug: String,
    pub description: Option<String>,
    #[sea_orm(column_type = "Text", nullable)]
    pub content: Option<String>,
    #[sea_orm(column_type = "Text", nullable)]
    #[serde(skip_serializing, skip_deserializing)]
    pub source_markdown: Option<String>,
    pub category: Option<String>,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub tags: Option<Json>,
    pub post_type: Option<String>,
    pub image: Option<String>,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub images: Option<Json>,
    pub pinned: Option<bool>,
    pub status: Option<String>,
    pub visibility: Option<String>,
    pub publish_at: Option<DateTimeWithTimeZone>,
    pub unpublish_at: Option<DateTimeWithTimeZone>,
    #[sea_orm(column_type = "Text", nullable)]
    pub canonical_url: Option<String>,
    pub noindex: Option<bool>,
    #[sea_orm(column_type = "Text", nullable)]
    pub og_image: Option<String>,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub redirect_from: Option<Json>,
    #[sea_orm(column_type = "Text", nullable)]
    pub redirect_to: Option<String>,
}

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