Skip to content

Commit

Permalink
Merge pull request #997 from Infomaniak/migrate-search-history
Browse files Browse the repository at this point in the history
fix: Correctly migrate SearchHistory
  • Loading branch information
valentinperignon committed Sep 26, 2023
2 parents 0bfa48c + 65efc96 commit a9c4c7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MailCore/Cache/MailboxManager/MailboxManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ public final class MailboxManager: ObservableObject, MailboxManageable {
let realmName = "\(mailbox.userId)-\(mailbox.mailboxId).realm"
realmConfiguration = Realm.Configuration(
fileURL: MailboxManager.constants.rootDocumentsURL.appendingPathComponent(realmName),
schemaVersion: 19,
schemaVersion: 20,
migrationBlock: { migration, oldSchemaVersion in
// No migration needed from 0 to 16
if oldSchemaVersion < 17 {
// Remove signatures without `senderName` and `senderEmailIdn`
migration.deleteData(forType: Signature.className())
}
if oldSchemaVersion < 20 {
migration.deleteData(forType: SearchHistory.className())
}
},
objectTypes: [
Folder.self,
Expand Down

0 comments on commit a9c4c7c

Please sign in to comment.