I'm migrating an existing Core Data app to SwiftData and encountering a persistent schema hash mismatch that prevents the store from loading. The Core Data store has been in production for years with version 4 of the model.
I have two models, lets call the Crew and Astronaut Create is a parent in the to-many relationship to Astronaut, the child.
When I try the migration, the Crew model‘s hash matches, but the Astronaut model’s mismatches.
I also tried changing relationship parameters; deleteRule, maximumModelCount, inverse, originalName, and hashModifier. hashModifier changes the hash, but to a third value, so it does not appear to be a way to match the existing Core Data hash.
So, is there a supported way for SwiftData to generate an optional to-one relationship that is Core Data hash-compatible with optional=YES minCount=1 maxCount=1? Or is a migration/rehash/copy step required before SwiftData can adopt this V4 store in place?