2022-08-01 08:53:05 +02:00
|
|
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import GRDB
|
|
|
|
import SessionUtilitiesKit
|
|
|
|
import SessionSnodeKit
|
|
|
|
|
|
|
|
/// This migration removes the legacy YapDatabase files
|
|
|
|
enum _004_RemoveLegacyYDB: Migration {
|
|
|
|
static let target: TargetMigrations.Identifier = .messagingKit
|
2023-09-25 10:32:56 +02:00
|
|
|
static let identifier: String = "RemoveLegacyYDB" // stringlint:disable
|
2022-08-01 08:53:05 +02:00
|
|
|
static let needsConfigSync: Bool = false
|
|
|
|
static let minExpectedRunDuration: TimeInterval = 0.1
|
|
|
|
|
|
|
|
static func migrate(_ db: Database) throws {
|
|
|
|
try? SUKLegacy.deleteLegacyDatabaseFilesAndKey()
|
|
|
|
Storage.update(progress: 1, for: self, in: target) // In case this is the last migration
|
|
|
|
}
|
|
|
|
}
|