Mr.P
Mr.P

Reputation: 1440

Lightweight data migration

I very much jumped the gun when working on an update and started update my data model. Now I realise I should have created a new xcdatamodel and started updating that while still having the old one.

So my question is. What's the best thing to do now? Create a new xcdatamodel and go back in source control to make one the same as the current version while one is the updated one?

I'm new to core data migrations so any help is appreciated.

Upvotes: 0

Views: 47

Answers (1)

Marcus S. Zarra
Marcus S. Zarra

Reputation: 46718

  1. copy the "new" model to a new file (or just rename it)
  2. restore the original model from source control
  3. point the "current" model to the new model file.

These are all located within the xcdatamodeld directory.

Upvotes: 1

Related Questions