Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core Data lightweight migration renamed property keep renaming id all the time?

I'm using xcode 5 to develop an app for iPhone, I use lightweight migration to update the Core Data schema.

I create a User entity in model version 1, User has a property called nameA.

In model version 2, I rename User's nameA to nameB, I set nameB's renaming id to nameA. This step is successful, previous value of nameA can be found in nameB.

Then I create model version 3 to add another entity called House, and I found in version 3, User's nameB still has its renaming id set to nameA

I think in model version 3, User's nameB should not has a renaming id, because model version 3 is based on version 2, and in version 3 I did not change anything of User entity

So should I delete the renaming id of User's nameB? or just leave it there?

Anyone know how?

like image 860
Terry Z Avatar asked Nov 27 '22 08:11

Terry Z


1 Answers

You should leave it there. Your users may not have upgraded to version 2 of your core data schema. When those users upgrade from v1 to v3 they will need to know how to migrate from nameA to nameB

like image 179
wyu Avatar answered May 25 '23 02:05

wyu