3

I created a new core data model version. The changes I made were I added a new entity called "FTASyncParent" which I set as an abstract entity. Then I set the parent entity of all my other entities to the abstract "FTASyncParent" entity. So now in my new model all my entities have the "FTASyncParent" entity set as the parent entity.

As I understood from Apple's core data documentation lightweight migration works for changes to the entity hierarchy. However when I try to perform the lightweight migration I get the following error.

Error: Error Domain=NSCocoaErrorDomain Code=134110 "The operation couldn’t be completed. (Cocoa error 134110.)" UserInfo=0x1d9ccba0 {destinationRootEntity=FTASyncParent, reason=Cannot merge multiple root entity source tables into one destination entity root table, sourceRootEntities=(
    Day,
    MealItemFood
), NSUnderlyingException=Cannot merge multiple root entity source tables into one destination entity root table}

Day and MealItemFood are some of the entities in my data model that now have the "FTASyncParent" entity as a parent.

How can I fix this error? If I can't use lightweight migration for this how should a custom mapping model map reflect the change in my data model?

gossainapps
  • 723
  • 1
  • 7
  • 18
  • 1
    There are more detailed instructions to solve this problem at http://stackoverflow.com/q/8250975 – user3819283 Apr 21 '15 at 11:29
  • Does this answer your question? [How to refactor a core data model to make two existing entities inherit from a new abstract entity](https://stackoverflow.com/questions/8250975/how-to-refactor-a-core-data-model-to-make-two-existing-entities-inherit-from-a-n) – Andrew Nov 03 '21 at 04:00

1 Answers1

-1

Try deleting the app in the home screen of the emulator, and then rebuild/clean.

  • I building in on a development device, where I start with a fresh install by downloading my app from the app store, then adding some test data (by using the app), and finally I try to do the migration by installing the new version of my app. – gossainapps May 12 '13 at 16:17
  • 4
    The goal of versioning and migration of db is not uninstall the app because if the app if already in production, you won't want to delete all the data from the user. – Cristian Cardoso Feb 01 '17 at 01:23