core-data-migration

Migrating a many-to-many relationship to a join table in Core Data

点点圈 提交于 2019-11-28 20:37:09
问题 I've got an iPhone app that uses many-to-many relationships to link tags and notes together. I'm currently using Core Data's "Relationships" feature to accomplish this, but would like to migrate to using a join table instead. Here's my challenge: I'd like to migrate from the old model to the join-table model, and I need to figure out how to perform that data migration. Are there any good examples of how to do this? Update: I'm clarifying my question here to help out with what's going on here:

Core Data versioning and migrating with custom policy

牧云@^-^@ 提交于 2019-11-28 19:01:33
I've found documentation very limited and my problem solution nowhere. I need to add new entity (with relationship to existing one). Also add and rename some of attributes of existing entity. Lightweighted example: Old model has one entity Item with one attribute name . In new model I want to Item to have one new attribute dateAdded and rename name to title . At this point, if dateAdded would be optional or given default value, I could use lightweight migration feature. Correct me if I am wrong. But I also want to add new List entity with title attribute. And add to-many relationship. List can

Core Data - lightweight migrations and multiple core data model files (xcdatamodel)

你。 提交于 2019-11-28 17:18:28
I'm having a problem performing a lightweight migration when migrating from a store that is defined by two separate xcdatamodel files. In version 1.0 of my app, I had the models broken out into an analytics model, model-A, and everything else in model-B. When compiling, the models would be grouped together and everything proceeded smoothly. When working on the new version, 1.1, I upgraded model-B by adding a new model version to model-B and setting that new version as active. The issue arises when upgrading from 1.0 to 1.1. It seems Core Data checks the model store on disk (created by version

Using mergedModelFromBundles: and versioning (CoreData)

对着背影说爱祢 提交于 2019-11-28 16:55:11
I'm trying to use the migration feature in CoreData. I've followed the Apple Documentation. I have a problem in the following method: /** Returns the managed object model for the application. If the model doesn't already exist, it is created by merging all of the models found in the application bundle. */ - (NSManagedObjectModel *)managedObjectModel { if (managedObjectModel != nil) { return managedObjectModel; } /* * NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil' * 2010-02-17 16:27:15.338 Patrimoine[3037:207] */ managedObjectModel = [

Detecting a Lightweight Core Data Migration

不想你离开。 提交于 2019-11-28 16:25:16
I'm using Core Data's automatic lightweight migration successfully. However, when a particular entity gets created during a migration, I'd like to populate it with some data. Of course I could check if the entity is empty every time the application starts, but this seems inefficient when Core Data has a migration framework. Is it possible to detect when a lightweight migration occurs (possibly using KVO or notifications), or does this require implementing standard migrations? I've tried using the NSPersistentStoreCoordinatorStoresDidChangeNotification , but it doesn't fire when migrations

CoreData:Migrate data from bundled db

断了今生、忘了曾经 提交于 2019-11-28 10:51:23
问题 Our app is having a coredata store which is based on a single coredata model. There are read-only data as well as read-write data. The read-only data are pre-loaded and bundled along with the app, so that on a fresh install, this database is copied to the application sandbox and from there on the data base will be updated via webservice (ie only the changed data will get updated from webservice so that less data is transferred). Now we have situation where we need to add more attributes to

“Can't find model for source store” occurring during iphone “Automatic Lightweight Migration”?

我怕爱的太早我们不能终老 提交于 2019-11-28 06:53:20
I'm really stuck here with upgrade testing from v1 to v2 of an iPhone application. I have IPA releases that I'm testing via ad hoc distribution via iTunes to my iPhone device, one for v1 of the app and one for v2. Note that: v1 installs runs fine on my device if I delete v1 and deploy v2 (so no migration) then it works fine when I deploy v2 whilst v1 is already there I get the error: "reason=Can't find model for source store" A snippet from the error...* reason=**Can't find model for source store**}, { URL = "file://localhost/var/mobile/Applications/AAAAF424-D6ED-40FE-AB8D-66879386739D

What is an efficient way to Merge two iOS Core Data Persistent Stores?

不问归期 提交于 2019-11-27 14:03:08
问题 In our app under development we are using Core Data with a sqlite backing store to store our data. The object model for our app is complex. Also, the total amount of data served by our app is too large to fit into an iOS (iPhone/iPad/iPod Touch) app bundle. Because of the fact that our users are, typically, interested only in a subset of the data, we've partitioned our data in such a way that the app ships with a subset (albeit, ~100 MB) of the data objects in the app bundle. Our users have

Core Data versioning and migrating with custom policy

依然范特西╮ 提交于 2019-11-27 12:09:06
问题 I've found documentation very limited and my problem solution nowhere. I need to add new entity (with relationship to existing one). Also add and rename some of attributes of existing entity. Lightweighted example: Old model has one entity Item with one attribute name . In new model I want to Item to have one new attribute dateAdded and rename name to title . At this point, if dateAdded would be optional or given default value, I could use lightweight migration feature. Correct me if I am

Using mergedModelFromBundles: and versioning (CoreData)

你离开我真会死。 提交于 2019-11-27 10:03:28
问题 I'm trying to use the migration feature in CoreData. I've followed the Apple Documentation. I have a problem in the following method: /** Returns the managed object model for the application. If the model doesn't already exist, it is created by merging all of the models found in the application bundle. */ - (NSManagedObjectModel *)managedObjectModel { if (managedObjectModel != nil) { return managedObjectModel; } /* * NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]