marinofaggiana 5 years ago
parent
commit
7ad8fcae88
2 changed files with 18 additions and 1 deletions
  1. 1 1
      iOSClient/CCGlobal.h
  2. 17 0
      iOSClient/Database/NCManageDatabase.swift

+ 1 - 1
iOSClient/CCGlobal.h

@@ -81,7 +81,7 @@
 
 // Database Realm
 #define k_databaseDefault                               @"nextcloud.realm"
-#define k_databaseSchemaVersion                         86
+#define k_databaseSchemaVersion                         87
 
 // Intro selector
 #define k_intro_login                                   0

+ 17 - 0
iOSClient/Database/NCManageDatabase.swift

@@ -105,6 +105,23 @@ class NCManageDatabase: NSObject {
                         migration.deleteData(forType: tableTrash.className())
                     }
                     
+                    if oldSchemaVersion < 87 {
+                        migration.deleteData(forType: tableActivity.className())
+                        migration.deleteData(forType: tableActivityPreview.className())
+                        migration.deleteData(forType: tableActivitySubjectRich.className())
+                        migration.deleteData(forType: tableCapabilities.className())
+                        migration.deleteData(forType: tableComments.className())
+                        migration.deleteData(forType: tableDirectEditingCreators.className())
+                        migration.deleteData(forType: tableDirectEditingEditors.className())
+                        migration.deleteData(forType: tableDirectory.className())
+                        migration.deleteData(forType: tableE2eEncryptionLock.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())
+                    }
+                    
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
                     
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)