Recently, I successfully completed the basic data, Easy Migration; but I noticed that this required fair spending on my part - and I wonder what absolute minimum is needed for automatic migration?
I do not mean "what data changes require migration, otherwise you will be broken", written in several places, but rather:
"Here's a list of things you should do, at a minimum, to get Core Data to migrate for you."
(FWIW - below is what I did. Some of them seem absolutely necessary, and some may not be interested in what this is?):
- Editor → Add model version (with name and saved)
- Utility Inspector → Data model with basic version data: my latest version of the model is selected as “current”
- Added my new table to the latest kernel data model
- Editor -> Create a New Subclass of NSManagedObject ...
- Since I use mogenerator - I used it to create human and machine files (after some configuration, so that it points to the new model file created above, hiding inside the .xcdatamodeld package), replaced them with the files created in the step above (movenerator is real saving if you do Core Data).
- In my info.plist application, I changed the string "Bundle Version String, short" AND "Bundle Version" to increment.
- NSDictionary persistentStoreCoordinator ([__persistentStoreCoordinator addPersistentStoreWithType: NSSQLiteStoreType: noil URL: storeURL options: optionsDict error: & ])
NSDictionary *optionsDict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],
NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES],
NSInferMappingModelAutomaticallyOption, nil];
, , , , ... - , , .
, , Info-Plist? - - , ?