From: Olaf Wintermann Date: Sun, 28 Jun 2026 18:49:52 +0000 (+0200) Subject: add storage setting to collections X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=note.git add storage setting to collections --- diff --git a/entity/src/collection.rs b/entity/src/collection.rs index c30106c..91a5fa2 100644 --- a/entity/src/collection.rs +++ b/entity/src/collection.rs @@ -13,6 +13,7 @@ pub struct Model { pub parent: String, pub icon: String, pub kind: CollectionType, + pub storage: LocalStorageSetting } impl Model { @@ -30,6 +31,14 @@ pub enum CollectionType { Mail = 3, } +#[derive(EnumIter, DeriveActiveEnum, Clone, Debug, PartialEq)] +#[sea_orm(rs_type = "i32", db_type = "Integer")] +pub enum LocalStorageSetting { + Default = 0, + FileSystem = 1, + Database = 2 +} + #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation {} diff --git a/migration/src/m20260502_184134_create_settings.rs b/migration/src/m20260502_184134_create_settings.rs index 8f27a64..4a6468d 100644 --- a/migration/src/m20260502_184134_create_settings.rs +++ b/migration/src/m20260502_184134_create_settings.rs @@ -44,6 +44,7 @@ impl MigrationTrait for Migration { .col(string("parent")) .col(string("icon")) .col(integer("kind")) + .col(integer("storage")) .foreign_key( ForeignKey::create() .name("fk-collection-profile")