Home > Net >  Do I need to add a migration to Core Data if I change the entity class?
Do I need to add a migration to Core Data if I change the entity class?

Time:01-19

I have an entity in Core Data. In the configuration section of the model, the class for the entity is specifically defined as MyModule.MyEntityName. Now I want to change MyModule to a different name, such that the class will be MyOtherModule.MyEntityName. Can I just change it and it will be fine for those updating or will I need to add some sort of migration?

CodePudding user response:

Things that affect the entity version are:

...the name of the entity, the version hash of the superentity (if present), if the entity is abstract, and all of the version hashes for the properties.

Changing the class name should be fine, but as always, make sure to test it yourself before releasing the code to users.

  • Related