0
votes

I have an existing app. I already performed a lightweight migration once, so I'm not totally unfamiliar. However, I recently was working on my app and, without thinking, added two new entities without adding a new Core Data model version.

However, when I uploaded the app via Xcode onto my phone and several test users phones, it didn't cause problems.

Is it possible that I don't need to do a lightweight migration?

1
Have you successfully added any instances of these new entities yet?Tom Harrington
@TomHarrington surprisingly, yes. So it seems that for my phone, it worked somehow and for the test phones. However, I don't know if there's a difference between those and when users receive the update via the app store update. Do you?Dave G

1 Answers

1
votes

When you set up your app for a lightweight migration, you probably inserted the following lines into your CoreData framework. These settings enabled the options that support lightweight migrations (these are from a Swift 3.0 app so they may vary a bit):

NSMigratePersistentStoresAutomaticallyOption as NSObject: true,                 
NSInferMappingModelAutomaticallyOption as NSObject: true 

If you've left these lines in place, then CoreData will continue to perform lightweight migrations correctly when they're required so you should be OK as long as you don't do anything that requires more action on your part - like changing the name of an entity or property.