small medium large xlarge

Back to: All Forums  Core Data
25 Mar 2011, 02:38
Duncan Groenewald (12 posts)

Should have typed migraine with abstract entities…

I have a model based on the SortedTree example posted here

This model uses an abstract entity to represent a TreeNode and two entities that inherit from TreeNode (Group and Leaf). All has been fine until now when I am trying to implement data migration to allow the application to upgrade data files for new additions to the model.

I am trying to use the AutoMigration but generating a mapping model fails to include all the abstract entities attributes and relationships to the Group and Leaf entities and then fails because of multiple validation errors when trying to upgrade.

Any ideas on whether this is a bug or expected behaviour and if so then how does one migrate this data model ? Is there any plan to fix this ?

Any references to simple examples showing how to create a custom migration policy - there are no actual changes to these entities in the new model I just need to copy the data across.


11 Dec 2011, 20:27
Marcus S. Zarra (284 posts)

It is a known issue with the mapping models. You can change the mapping model to include the attributes from the abstract parent and that will work.

Have you tried doing just an inferred migration? That will also work if your changes are small enough.

BTW, I strongly urge you to file a radar on this issue. The more radar votes we have on this the higher the chance it will be fixed.

You must be logged in to comment