Question on manual Core Data migration by the code

Hi,

I currently experiment migration by the code. Just for understand what happened under the hood.

It's OK for attributes. But not for relationships.

Here is my code:

Code Block swift
let property = NSPropertyMapping()
property.name = "list"
property.valueExpression = NSExpression(format: """
FUNCTION($manager, "destinationInstancesForEntityMappingNamed:sourceInstances:" , "ItemV1ToItemV2", $source.list)
""")
item.relationshipMappings = [property]


Thank you for your help 😁

Accepted Reply

Found the solution myself.

sourceEntityVersionHash and destinationEntityVersionHash are required on NSEntityMapping.

Replies

Found the solution myself.

sourceEntityVersionHash and destinationEntityVersionHash are required on NSEntityMapping.