I've read through a variety of posts on this over the past hour but do not see a precise answer to the following issue.
I plan to perform another data migration for my app as follows:
version 1 - initial data model
version 2 - new model with custom mapping and helper method
version 3 - new model with simple mapping (added a few attributes and relationships)
For version 2 I used the NSMigratePersistentStoresAutomaticallyOption option. For version 3 I would like to add the NSInferMappingModelAutomaticallyOption option as I do not need a mapping model since the conversion is a "lightweight migration".
However, since version 2 has a custom migration, will the "internal logic" of the app know that version 2 needs to use the custom mapping model, even though the NSInferMappingModelAutomaticallyOption option is added for the newest version (version 3)?
I see there are ways to check version information and log it for testing. I also have my app under version control and so I can test running a conversion from version 1 to 2 to 3.
However, I would like to get feedback from a design standpoint as I want to be 100% certain that I don't screw this up :-)
I appreciate any feedback.
You are doing everything right. The whole migration history is necessary to arrive at the concurrent data model version, regardless of the kind of migrations (lightweight or not). Also, there is no perceivable flaw in your proposed workflow design.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With