0
votes

I'm trying to clean up a project I have that uses Core Data. The data model has 20 different versions. Each version throws a warning about 'The inverse relationship for UserMO.specialties does not reciprocate an inverse relationship'.

Can I go and add inverse relationships to my older and current model versions, without corrupting anything? Or do I need to create a new model version, for which a lightweight migration will be performed?

2

2 Answers

1
votes

You can't change older models and keep using them with the same data. You'd have to create new versions of the models with the fixes, and migrate data to use them. But model migration requires having the previous model version, so you'd still have to keep those old models around. In short: You're stuck with those models, with their warnings, unless you decide that you're not going to support even migrating data from them to new versions any more.

0
votes

The only time you shouldn't create a new model version when editing your models is if you're working locally and you are the only person who has access to the changes.

For this problem in particular, just creating a new version, tagging that version as the one to use, and letting the system do a lightweight migration will be fine.