//! `SeaORM` Entity, manually maintained

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

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "ai_chunks")]
pub struct Model {
    pub created_at: DateTimeWithTimeZone,
    pub updated_at: DateTimeWithTimeZone,
    #[sea_orm(primary_key)]
    pub id: i32,
    pub source_slug: String,
    pub source_title: Option<String>,
    pub source_path: Option<String>,
    pub source_type: String,
    pub chunk_index: i32,
    #[sea_orm(column_type = "Text")]
    pub content: String,
    pub content_preview: Option<String>,
    pub embedding: Option<String>,
    pub word_count: Option<i32>,
}

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

impl ActiveModelBehavior for ActiveModel {}
