]> uap-core.de Git - note.git/commitdiff
add storage setting to collections main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 28 Jun 2026 18:49:52 +0000 (20:49 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 28 Jun 2026 18:49:52 +0000 (20:49 +0200)
entity/src/collection.rs
migration/src/m20260502_184134_create_settings.rs

index c30106c155571067aceab3fd2687856f23b76f6b..91a5fa2991f7b4b157fd9aa41d19144ce1ef1eef 100644 (file)
@@ -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 {}
 
index 8f27a64bba28e4fcfc18fc0e204aa8958baa3be6..4a6468d563e74c8e20d67088a470213836b389f3 100644 (file)
@@ -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")