Lightweight Database Migration in CoreData
Lightweight Migration : This is an automatic feature of Core Data, but is limited to only simple migrations. You can use this technique if the changes are among the following: 1. Adding a new attribute to an entity. 2. Renaming of an entity or an attribute. 3. Changing an attribute to optional or non-optional, whether it requires a value on creation. Schema Changes, Versioning and Migrations When you are developing an application you will almost never get the schema right the first time. So, Core Data has support for schema versioning and data migration. This allows you to define a new version of the Core Data schema by adding a new attribute or entity to the store. Then define how the store has to migrate from one change to another. Creating a new xcdatamodel (Xcode 4.3.2) If you want to do a lightweight migration first step is to create a new xcdatamodel for new schema. 1. Click on your xcdatamodeld file present in bundle. 2. Click on Editor Men...