AlexR
AlexR

Reputation: 5634

Changed Core Data Model Without Having Versioning Turned On

I have changed my Core Data model a bit (set some attributes as optional and non-optional).

Unfortunately I did not turn automatic versioning on...

I have uploaded my App to the App Store yesterday and it is still under review by Apple. I am afraid that it will break existing installations of my app.

This is why I would like to cancel my currently uploaded Binary and reset my Core Data model to the previous attributes settings and then upload the App again.

This leads me to the following questions:

Upvotes: 0

Views: 539

Answers (1)

Wain
Wain

Reputation: 119021

Compatible versions are determined by matching version numbers.

Solve by doing exactly what you propose. Pull the binary, revert your changes, version the model, remake your changes, ensure that auto-migration is enabled and test that it works correctly.

The version number is created by generating a 32-byte hash digest of the components which are compared for equality:

  • For each entity the following attributes must be equal: name, parent, isAbstract, and properties. className, userInfo, and validation predicates are not compared.

  • For each property in each entity, the following attributes must be equal: name, isOptional, isTransient, isReadOnly, for attributes attributeType, and for relationships destinationEntity, minCount, maxCount, deleteRule, and inverseRelationship. userInfo and validation predicates are not compared.

Apple ref

Technically, if you don't change anything that doesn't affect the version number then you don't need to version the model. Note that your change will impact the version number so you do need to take action.

Upvotes: 1

Related Questions