Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens if a user jumps over 10 versions before updating, and every version had a new data model?

Example: User installs app v.1.0, adds data. Then the dev submits 10 updates in 10 weeks. After 11 weeks, the user wants v.11.0 and grabs a copy from the app store.

Assuming that the app has got 11 .xcdatamodel versions inside, where ***11.xcdatamodel is the current one, what would happen now since the persistent store of the user is ages old? would the migration happen 10 times, step-by-step through every migration iteration?

Or does the actual migration of data (lets assume gigabytes of data) happen exactly once, after Core Data (or the persistent store coordinator) has figured out precisely what to do to go from v.1.0 to v.11.0?

like image 226
dontWatchMyProfile Avatar asked Dec 15 '25 11:12

dontWatchMyProfile


1 Answers

As I answered in your other question on this subject, there would only be one migration as Core Data does not understand the concept of versions. There is no timeline of models; it will only work with a source and a destination.

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

like image 151
Marcus S. Zarra Avatar answered Dec 17 '25 02:12

Marcus S. Zarra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!