Primary data migration - new to many relationships from existing data

I have an old Core Data User model in which there are several string attributes like name, email, street, city. I need to transfer it to a new version, which will have a one-to-many relationship with the new class "Address", which will have the attributes "street" and "city".

So, go from:

User - name - email - street - city 

To:

 User - name - email <->> Address - street - city 

How can i achieve this? Can I do this with a value expression or do I need the NSEntityMigrationPolicy class? How will it look like? Thanks!

+4
source share

Source: https://habr.com/ru/post/1500527/


All Articles