Search code examples
iphonecore-datamapping-model

Which kind of changes can't I do with lightweight migration in Core Data?


I recently tried a lot of different stuff with lightweight migration. These all work:

1) Rename attributes (with renaming identifier specified)

2) Add attributes

3) Add new entity + new attribute + inverse relationship to an already existing entity

4) remove existing entity + relationships to that entity


= It almost looks like just about anything can be handled with LM. Did I miss something? In which cases am I getting into trouble and need an some more complex approach?


Solution

  • Splitting one entity into two different entities (Person > Child & Adult) will not work with automatic migration.

    Applying logic (renaming a parameter based on a condition of another parameter) will not work.

    Most of your basic migrations can be handled by automatic. Dealing with logic decisions requires a mapping model or custom migration code.