Chained Migration of Leopard CoreData stores
Chained Migration of Leopard CoreData stores
- Subject: Chained Migration of Leopard CoreData stores
- From: Ruotger Skupin <email@hidden>
- Date: Wed, 16 Apr 2008 12:59:05 +0200
Hi,
let's say I have four versions of my data model:
DataModel1.xcdatamodel
DataModel2.xcdatamodel
DataModel3.xcdatamodel
DataModel4.xcdatamodel (this is the current one)
and three model mapping files which always map from version n to
version n+1:
Mapping1to2.xcmappingmodel
Mapping2to3.xcmappingmodel
Mapping3to4.xcmappingmodel
Now I load a version 1 data file:
NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber
numberWithBool:YES]
forKey:NSMigratePersistentStoresAutomaticallyOption];
NSError *error = nil;
if (![persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url
options:options error:&error])
{
...
}
should the data file automatically be migrated to the current version
4 or do I need a single direct mapping like this:
Mapping1to4.xcmappingmodel
Ruotger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden