What happens if a user leaps over 10 versions before upgrading, and each version has a new data model?

Example: A user installs an application v.1.0, adds data. The developer then sends 10 updates in 10 weeks. After 11 weeks, the user wants v.11.0 and grabs a copy from the application store.

Assuming the application has 11.xcdatamodel versions inside, where *** 11.xcdatamodel is current, what will happen now, since the user's permanent store is age? Will migration happen 10 times, step by step, through each iteration of migration?

Or the actual data migration (allows you to take gigabytes of data) occurs exactly once, after the Core Data (or the permanent coordinator of the store) figured out what to do to move from v.1.0 to v.11.0?

+3
source share
1 answer

As I answered in another question on this question, there will be only one migration, since Core Data does not understand the concept of versions. There is no timeline for models; he will only work with the source and destination.

In your example, the source will be v1.0, and the destination will be v11.0. One migration.

+2
source

Source: https://habr.com/ru/post/1749903/


All Articles