Database Reference
In-Depth Information
how much you can change the data model, but because of the small amount of
work required to enable this option, it is the ideal setting.
Manual migrations
Manual migrations involve a little more work on your part. You need to specify how
to map the old set of data onto the new set, but you get the benefit of a more
explicit mapping model file to configure. Setting up a mapping model in Xcode is
much like setting up a data model, with similar GUI tools and some automation.
Custom manual migrations
This is level 3 of the migration complexity index. You still use a mapping model, but
add to that custom code with the ability to also specify custom transformation logic
on data. In this case, custom entity transformation logic involves creating an
NSEntityMigrationPolicy subclass and performing custom transformations there.
Fully manual migrations
Fully manual migrations are for those times when even specifying custom
transformation logic isn't enough to fully migrate data from one model version to
another. In this case, custom version detection logic and custom handling of the
migration process are necessary. In this chapter, you'll use set up a fully manual
migration to update data across non-sequential versions, such as jumping from
version 1 to 4.
Throughout this chapter, you'll learn about each of these migration types and when
to use them. Let's get started!
Getting started
Included with the resources for this topic is a starter project called UnCloudNotes .
Find the starter project and open it in Xcode.
Note : We've called the app UnCloudNotes as a teaser for Chapter 7,
“Syncing with iCloud.” In that chapter, you'll change UnCloudNotes to
CloudNotes , and modify it so that it syncs its Core Data store to multiple
devices using iCloud.
Build and run the app in the iPhone simulator. You'll see an empty list of notes:
 
Search WWH ::




Custom Search