Skip to main content

knowdit_kg_model/db/
project.rs

1use sea_orm::entity::prelude::*;
2
3#[sea_orm::model]
4#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize, DeriveEntityModel)]
5#[sea_orm(table_name = "project")]
6pub struct Model {
7    #[sea_orm(primary_key)]
8    pub id: i32,
9    #[sea_orm(column_type = "Text")]
10    pub name: String,
11    /// "pending" or "completed" — tracks whether semantic extraction is done
12    pub status: String,
13
14    #[sea_orm(has_one)]
15    pub platform: HasOne<super::project_platform::Entity>,
16    #[sea_orm(has_many, via = "project_category")]
17    pub categories: HasMany<super::category::Entity>,
18    // NOTE: legacy direct `has_many semantic_nodes / audit_findings` removed.
19    // The new joins live through `project_semantic` / `project_finding`. They
20    // will be added back as `via = ...` relations once the legacy `project_id`
21    // columns on those rows go away (see the corresponding entity files).
22}
23
24impl ActiveModelBehavior for ActiveModel {}