2. Migration
ORM (CoreData) feature
Automatically moves data from previous version
to new version from table/entities or column/keys
Lightweight migration
Custom Migration
Required mapping model
3. Steps to create Model file
Select Model File
Editor -> Add Model Version
Select 2nd Model file change what you want*
Select Base Model File
Select Utilities Tab
File Inspector tab
Change Model version -> current
4. Enable Migration
In Magical Records
[MagicalRecord
setupCoreDataStackWithAutoMigratingSqlite
StoreNamed:@”ModelFileName"];
5. Enable Migration
In Manual Core Data handling
NSDictionary *options = [NSDictionary
dictionaryWithObjectsAndKeys: [NSNumber
numberWithBool:YES],
NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES],
NSInferMappingModelAutomaticallyOption, nil];
Use this “options“ Dictionary in creating persistent store co-
ordinator
[_persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil URL:storeURL options:options
error:&error];