Merge pull request #1769 from AlphaWallet/fix-last-few-database-migration-broken

Fix: A few database migrations were skipped
pull/1772/head
James Sangalli 5 years ago committed by GitHub
commit adeb7236e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      AlphaWallet/Core/Initializers/MigrationInitializer.swift

@ -28,8 +28,6 @@ class MigrationInitializer: Initializer {
} }
} }
} }
}
config.migrationBlock = { migration, oldSchemaVersion in
if oldSchemaVersion < 3 { if oldSchemaVersion < 3 {
migration.enumerateObjects(ofType: Transaction.className()) { oldObject, newObject in migration.enumerateObjects(ofType: Transaction.className()) { oldObject, newObject in
guard let _ = oldObject else { return } guard let _ = oldObject else { return }
@ -37,8 +35,6 @@ class MigrationInitializer: Initializer {
newObject["isERC20Interaction"] = false newObject["isERC20Interaction"] = false
} }
} }
}
config.migrationBlock = { migration, oldSchemaVersion in
if oldSchemaVersion < 4 { if oldSchemaVersion < 4 {
migration.enumerateObjects(ofType: TokenObject.className()) { oldObject, newObject in migration.enumerateObjects(ofType: TokenObject.className()) { oldObject, newObject in
guard let oldObject = oldObject else { return } guard let oldObject = oldObject else { return }
@ -48,8 +44,6 @@ class MigrationInitializer: Initializer {
newObject["rawType"] = "ERC20" newObject["rawType"] = "ERC20"
} }
} }
}
config.migrationBlock = { migration, oldSchemaVersion in
if oldSchemaVersion < 5 { if oldSchemaVersion < 5 {
migration.enumerateObjects(ofType: TokenObject.className()) { oldObject, newObject in migration.enumerateObjects(ofType: TokenObject.className()) { oldObject, newObject in
guard let oldObject = oldObject else { return } guard let oldObject = oldObject else { return }

Loading…
Cancel
Save