Reputation: 2128
I really hope someone will be able to help me out with this. I am trying to create a data mapping model (for an iOs app) in Xcode for the first time.
This should be a very simple migration (although not covered by lightweight migration); here is what I originally had and what the new database looks like:
What changed:
DBdisplayOrder
), which is optionalDBreminder
(NSDate) attribute to the new DBreminderDate
. Both attributes in the new table are optional.So basically I only need to copy data from one attribute, which now resides in a new entity.
I would be very grateful if someone could point me in the right direction, or just recommend a good resource to study from and get started.
Upvotes: 4
Views: 2265
Reputation: 2128
I have sold this problem using a great description found here.
Update: (Fixed link to what appears to be the same blog post)
Here is the working mapping model:
I hope it helps someone.
Upvotes: 8
Reputation: 64428
Creating a mapping model can get fairly involved. I would start with the Core Data Model Versioning and Data Migration Programming Guide
In this particular case you will need to create an explicit mapping model, then you will have to create an entity mappings that describes both your original entity and the new target entity you want to move the attribute to. Then create a property mapping for that particular attribute.
Upvotes: 0