4

It used to be the case that adding an entity to a model in Core Data required a new version of the model if the App is already in the App Store.

See this answer and also this one.

However, I believe that Apple has simplified the migration process so now you can do a lot of things such as adding an attribute without changing the model version or even doing a lightweight migration.

In late 2020, do you still need to create a new model version upon adding a new entity to the model for a live app in the App Store or can you simply add it without doing anything else? The next version of the App will of course have a higher version. The question is does the data model have to have a new version or require a migration as well?

Thanks in advance for any suggestions.

user1904273
  • 4,562
  • 11
  • 45
  • 96

1 Answers1

3

No, certain operations don't require adding new model versions. This includes but isn't limited to adding entities or adding attributes to an entity.

If you push a new app version to the App Store and a user downloads it, iOS will check if there are any differences between the apps current database schema and the apps new database schema. If so, it will perform lightweight migration to reflect the changes.

I didn't find written documentation on this topic, but a video from WWDC22 stating above: https://developer.apple.com/wwdc22/10120 (minute 6:42).

sp4c38
  • 455
  • 3
  • 14