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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With