You're getting validation failures. As you've probably figured out, Core Data
- Figures out that it needs to migrate the persistent store
- Finds an appropriate mapping model,
FourToFive.cdm
- Begins the migration
Later on it fails, though. The errors are not generic-- they're quite specific. They all look like this (wrapped for readability):
"Error Domain=NSCocoaErrorDomain Code=1570 \"The operation couldn\U2019t be completed.
(Cocoa error 1570.)\" UserInfo=0x10a747bb0 {NSValidationErrorKey=startDate,
NSLocalizedDescription=The operation couldn\U2019t be completed. (Cocoa error 1570.),
NSValidationErrorObject=<NSManagedObject: 0x10a7380f0> (entity: TimeEntry; id:
0xd00000000008000e <x-coredata://FB4CCC6C-6EB7-44DB-A3F2-F64E23C64827/TimeEntry/p2> ;
data: <fault>)}",
What this says is that
- You have a validation failure (because
NSValidationErrorKey
andNSValidationErrorObject
) - This error is on the
TimeEntry
entity - The error is specifically caused by the
startDate
attribute. - The validation error is
1570
, which isNSValidationMissingMandatoryPropertyError
(see Core Data Constants Reference in the docs for this).
So: The new version of TimeEntry
appears to have a non-optional attribute called startDate
, but in exactly five cases you appear to be migrating a nil value for that attribute. Easy fixes for this would include making the attribute optional or setting a default value in the data model. But you can't add a mandatory attribute and not assign some value for it.
There's also a message about Failed to delete support directory for store
that I don't completely understand. The fact that the migration proceeds after that message suggests that it's not your problem, and in any case your errors don't stem directly from that.