use chrono::{DateTime, Utc}; use sea_orm::entity::prelude::*; use uuid::Uuid; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "app_articles")] pub struct Model { #[sea_orm(primary_key, default = "gen_random_uuid()", auto_increment = false)] pub id: Uuid, pub title: String, pub slug: String, pub category: String, pub excerpt: String, pub content: String, #[sea_orm(nullable)] pub cover_url: Option, #[sea_orm(nullable)] pub author_name: Option, pub is_published: bool, pub created_at: DateTime, pub updated_at: DateTime, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation {} impl ActiveModelBehavior for ActiveModel {}