Browse Source

improvements code

marinofaggiana 3 years ago
parent
commit
504a7d762f

+ 4 - 12
iOSClient/Data/NCManageDatabase.swift

@@ -87,33 +87,22 @@ class NCManageDatabase: NSObject {
                         migration.deleteData(forType: tableActivity.className())
                         migration.deleteData(forType: tableActivityPreview.className())
                         migration.deleteData(forType: tableActivitySubjectRich.className())
-                        migration.deleteData(forType: tableDirectEditingCreators.className())
-                        migration.deleteData(forType: tableDirectEditingEditors.className())
                         migration.deleteData(forType: tableExternalSites.className())
                         migration.deleteData(forType: tableGPS.className())
-                        migration.deleteData(forType: tableShare.className())
                         migration.deleteData(forType: tableTag.className())
-                        migration.deleteData(forType: tableTrash.className())
                     }
                     
                     if oldSchemaVersion < 120 {
-                        migration.deleteData(forType: tableE2eEncryptionLock.className())
                         migration.deleteData(forType: tableCapabilities.className())
                         migration.deleteData(forType: tableComments.className())
-                        migration.deleteData(forType: tableDirectory.className())
                     }
                     
                     if oldSchemaVersion < 134 {
-                        migration.deleteData(forType: tableShare.className())
                         migration.deleteData(forType: tableDirectEditingCreators.className())
                         migration.deleteData(forType: tableDirectEditingEditors.className())
                         migration.deleteData(forType: tableExternalSites.className())
                     }
                     
-                    if oldSchemaVersion < 139 {
-                        migration.deleteData(forType: tableMetadata.className())
-                    }
-                    
                     if oldSchemaVersion < 141 {
                         migration.enumerateObjects(ofType: tableAccount.className()) { oldObject, newObject in
                             newObject!["urlBase"] = oldObject!["url"]
@@ -127,9 +116,12 @@ class NCManageDatabase: NSObject {
                         }
                     }
                     
-                    if oldSchemaVersion < 183 {
+                    if oldSchemaVersion < 191 {
                         migration.deleteData(forType: tableDirectory.className())
+                        migration.deleteData(forType: tableE2eEncryption.className())
+                        migration.deleteData(forType: tableE2eEncryptionLock.className())
                         migration.deleteData(forType: tableMetadata.className())
+                        migration.deleteData(forType: tableShare.className())
                     }
                     
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in

+ 1 - 1
iOSClient/NCGlobal.swift

@@ -79,7 +79,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 190
+    let databaseSchemaVersion: UInt64               = 191
     
     // Intro selector
     //

+ 1 - 1
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -179,7 +179,7 @@ class NCUtilityFileSystem: NSObject {
     }
     
     @objc func getHomeServer(account: String) -> String {
-        var home = ""
+        var home = self.getWebDAV(account: account)
         if let tableAccount = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) {
             home = tableAccount.urlBase + "/" + self.getWebDAV(account: account) + "/files/" + tableAccount.userId
         }