开发者

Adding data after lightweight migration process

开发者 https://www.devze.com 2023-03-06 05:51 出处:网络
I am not sure if it can be done by using lightweight migration. My problem is relatively simple, but I could not find a sol开发者_如何转开发ution anywhere on the net.

I am not sure if it can be done by using lightweight migration. My problem is relatively simple, but I could not find a sol开发者_如何转开发ution anywhere on the net.

I have a database where I need to add a new version by adding one entity. The LW migration works like a charm. Then I want to add some data to the updated database immediately.

Is there a solution to detect if a migration has occured (event after the migration itself, but obviously once only). Then I want add some data (migrate normal application settings info to the database).

Thank you.


After the LW migration with addPersistentStoreWithType:configuration:URL:options:error: You can use NSManagedObjectModel's isConfiguration:compatibleWithStoreMetadata: to check whether the schema of the - possibly migrated - store is compatible with the coordinator’s model.

0

精彩评论

暂无评论...
验证码 换一张
取 消