8
votes

I've got about 4 different versions of my data model now, and every one except the last one has been just a minor change using automatic lightweight migration. For this latest model, I need to do a bit of additional work during the migration, so I created a custom mapping model and a migration policy subclass with some actions in the createDestinations and createRelationships. Problem is, my mapping model/custom policy isn't being called, and it seems that Core Data is trying to perform lightweight migration instead. Is there something I need to do to keep lightweight migration around, but use my mapping model when there's one available?

1

1 Answers

1
votes

You have to change the way your PSC is being initialized. Try setting both NSInferMappingModelAutomaticallyOption and NSMigratePersistentStoresAutomaticallyOption to YES. See http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/CoreData/Articles/cdUsingPersistentStores.html