Adam Singer
Adam Singer

Reputation: 2957

Running my most recent Realm migration hangs

So I added some new properties to some of my models, and in the simulator, simply calling this works:

setSchemaVersion(7, realmPath: Realm.defaultPath) { migration, oldSchemaVersion in
  if oldSchemaVersion < 7 {
    migration.enumerate(ExerciseType.className(), { (oldObject, newObject) -> Void in
      newObject!["weighted"] = true
    })
  }
}

But when I try to run this on the device, it just hangs. I tried commenting out the new migration, and I correctly get the error message that a migration needs to take place (my previous schema version was 6), but when I add the new migration back in, my app just hangs and never actually calls the migration block.

Any ideas what this could be? Is there a way to recover from this without resetting my Realm entirely?

Upvotes: 3

Views: 187

Answers (1)

segiddins
segiddins

Reputation: 4120

Can you please update to the latest version of Realm? There was a short window where the Swift 2 branch accidentally required a file format upgrade which could cause this hang, but the released version of Realm (0.94.1) does not have this issue, however the Realm files you created with that unreleased version will be incompatible.

Upvotes: 3

Related Questions