Fixed a bug where the 'migrationNoLongerSupported' would be thrown for new accounts

pull/883/head
Morgan Pretty 9 months ago
parent a4ade7fdb4
commit 3e4a2013d3

@ -13,7 +13,11 @@ enum _003_YDBToGRDBMigration: Migration {
static let minExpectedRunDuration: TimeInterval = 0.1
static func migrate(_ db: Database) throws {
guard !SNUtilitiesKit.isRunningTests else { return Storage.update(progress: 1, for: self, in: target) }
guard
!SNUtilitiesKit.isRunningTests &&
Identity.userExists(db)
else { return Storage.update(progress: 1, for: self, in: target) }
SNLogNotTests("[Migration Error] Attempted to perform legacy migation")
throw StorageError.migrationNoLongerSupported
}

@ -11,7 +11,10 @@ enum _003_YDBToGRDBMigration: Migration {
static let minExpectedRunDuration: TimeInterval = 0.1
static func migrate(_ db: Database) throws {
guard !SNUtilitiesKit.isRunningTests else { return Storage.update(progress: 1, for: self, in: target) }
guard
!SNUtilitiesKit.isRunningTests &&
Identity.userExists(db)
else { return Storage.update(progress: 1, for: self, in: target) }
SNLogNotTests("[Migration Error] Attempted to perform legacy migation")
throw StorageError.migrationNoLongerSupported

@ -10,7 +10,10 @@ enum _003_YDBToGRDBMigration: Migration {
static let minExpectedRunDuration: TimeInterval = 0.1
static func migrate(_ db: Database) throws {
guard !SNUtilitiesKit.isRunningTests else { return Storage.update(progress: 1, for: self, in: target) }
guard
!SNUtilitiesKit.isRunningTests &&
Identity.userExists(db)
else { return Storage.update(progress: 1, for: self, in: target) }
SNLogNotTests("[Migration Error] Attempted to perform legacy migation")
throw StorageError.migrationNoLongerSupported

Loading…
Cancel
Save