3

With Core Data Migration Debug enabled, when performing a migration I see three entities (2, 3, 4) with changed hashes, as expected. Entity 1 doesn't change and is for illustration.

Store metadata (source model):

Entity1 = <67852e01 ...>; 
Entity2 = <2b68bba5 ...>; 
Entity3 = <58babd8d ...>; 
Entity4 = <1c694c80 ...>;

Current model (destination model):

Entity1 = <67852e01 ...>; 
Entity2 = <260e4d68 ...>;
Entity3 = <13360b6f ...>; 
Entity4 = <16513e1b ...>;

Next, I create the mapping model, but the hashes in the mapping model are different than those in the actual models:

Mapping Model Source Hashes:

Entity1 = <67852e01 ...>; 
Entity2 = <2b68bba5 ...>; 
Entity3 = <d66bed18 ...>; // !!!
Entity4 = <2c56997a ...>; // !!!

Mapping Model Destination Hashes:

Entity1 = <67852e01 ...>; 
Entity2 = <260e4d68 ...>; 
Entity3 = <cb08343c ...>; // !!!
Entity4 = <1bc2cf8c ...>; // !!!

What are the reasons the mapping model could be created with different hashes than the actual store's hashes? I looked at this question and tried updating the Mapping Model's models, but it didn't work.

Community
  • 1
  • 1
Victor Bogdan
  • 2,022
  • 24
  • 33

1 Answers1

3

The solution that finally worked was to create a new model version in which those entities were removed, then create another new model, with the entities re-introduced.

Victor Bogdan
  • 2,022
  • 24
  • 33
  • I don't understand, you created new xcdatamodel versions? You had two models that you deleted and replaced with new copies? – ray Dec 05 '13 at 17:56
  • I added a new model version (call it "X") using Xcode's "New Model Version..." menu item. I removed the problem entities from X, then I added a second new model version (Y), in which I added them back. Basically X is just an intermediary model version used to just clean-up the entities. – Victor Bogdan Jan 09 '14 at 12:18