2022-03-31 02:47:09 +02:00
|
|
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import GRDB
|
|
|
|
|
|
|
|
public extension DatabaseMigrator {
|
2023-06-19 10:19:47 +02:00
|
|
|
mutating func registerMigration(
|
|
|
|
_ storage: Storage?,
|
|
|
|
targetIdentifier: TargetMigrations.Identifier,
|
|
|
|
migration: Migration.Type,
|
|
|
|
foreignKeyChecks: ForeignKeyChecks = .deferred
|
|
|
|
) {
|
2022-05-31 09:41:02 +02:00
|
|
|
self.registerMigration(
|
|
|
|
targetIdentifier.key(with: migration),
|
2023-06-19 10:19:47 +02:00
|
|
|
migrate: migration.loggedMigrate(storage, targetIdentifier: targetIdentifier)
|
2022-05-31 09:41:02 +02:00
|
|
|
)
|
2022-03-31 02:47:09 +02:00
|
|
|
}
|
|
|
|
}
|