worktree_settings_file.rs

 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    pub outside_worktree: bool,
16}
17
18#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
19pub enum Relation {}
20
21impl ActiveModelBehavior for ActiveModel {}
22
23#[derive(
24    Copy, Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Default, Hash, serde::Serialize,
25)]
26#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")]
27#[serde(rename_all = "snake_case")]
28pub enum LocalSettingsKind {
29    #[default]
30    #[sea_orm(string_value = "settings")]
31    Settings,
32    #[sea_orm(string_value = "tasks")]
33    Tasks,
34    #[sea_orm(string_value = "editorconfig")]
35    Editorconfig,
36    #[sea_orm(string_value = "debug")]
37    Debug,
38}