Skip to content

Commit

Permalink
fix: Correctly migrate SearchHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Sep 26, 2023
1 parent 0bfa48c commit 65efc96
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 65efc96

Please sign in to comment.