1use crate::db::ProjectId;
 2use sea_orm::entity::prelude::*;
 3
 4#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
 5#[sea_orm(table_name = "worktree_settings_files")]
 6pub struct Model {
 7    #[sea_orm(primary_key)]
 8    pub project_id: ProjectId,
 9    #[sea_orm(primary_key)]
10    pub worktree_id: i64,
11    #[sea_orm(primary_key)]
12    pub path: String,
13    pub content: String,
14    pub kind: LocalSettingsKind,
15}
16
17#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
18pub enum Relation {}
19
20impl ActiveModelBehavior for ActiveModel {}
21
22#[derive(
23    Copy, Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Default, Hash, serde::Serialize,
24)]
25#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")]
26#[serde(rename_all = "snake_case")]
27pub enum LocalSettingsKind {
28    #[default]
29    #[sea_orm(string_value = "settings")]
30    Settings,
31    #[sea_orm(string_value = "tasks")]
32    Tasks,
33    #[sea_orm(string_value = "editorconfig")]
34    Editorconfig,
35    #[sea_orm(string_value = "debug")]
36    Debug,
37}