缺失version model的情况下能否完成Core Data的数据迁移?

简介:

今天遇到一个问题,问题描述见此 http://stackoverflow.com/q/20062215/889538

为此进行了一番验证。

我有一个Demo工程,叫做cdNBA,其数据模型如下:


然后基于cdNBA新建了两个分支:cdNBA1和cdNBA2,分别对数据模型进行修改。


cdNBA1工程创建了cdNBA 5.xcdatamodel,并安装到模拟器上写过数据。

接着cdNBA2工程创建了cdNBA 6.xcadatamodel,缺失cdNBA 5.xcdatamodel文件:


继而,对模拟器上的cdNBA进行覆盖安装,可以发现数据得到了迁移:



为什么在缺失cdNBA 5.xcdatamodel文件的情况下,能从cdNBA1升级到cdNBA2呢?

官方文档描述数据迁移的要求是:

A managed object model that it can use to open the existing store.

而非必须是精确的对应模型文件。而模型文件本身是xml结构描述文件,除了一些基本信息外,就是对各种表、各个字段的描述。何为“can use to open the existing store”的模型文件,目前无法得到确切的验证(无源代码言X),但可以得到的结论是在缺失对应version model的情况下,如果modification相对lightweight,那么是可以成功迁移数据的。

目录
相关文章
|
3月前
|
数据采集 机器学习/深度学习 数据格式
在使用 Core ML 时,有哪些注意事项?
在使用 Core ML 时,有哪些注意事项?
22 1
【解决方案】The opset version of the onnx model is 12, only model with opset_version 10/11 is supported.
【解决方案】The opset version of the onnx model is 12, only model with opset_version 10/11 is supported.
455 0
|
数据可视化 PyTorch 算法框架/工具
Pychram Pytorch Tensorboard 报错 “No dashboards are active for the current data set.“ 解决方案
Pychram Pytorch Tensorboard 报错 “No dashboards are active for the current data set.“ 解决方案
Pychram Pytorch Tensorboard 报错 “No dashboards are active for the current data set.“ 解决方案
openpyxl库由于不支持数据验证扩展导致的读取excel报“Data Validation extension is not supported and will be removed“错解决方法
openpyxl库由于不支持数据验证扩展导致的读取excel报“Data Validation extension is not supported and will be removed“错解决方法
2132 0
openpyxl库由于不支持数据验证扩展导致的读取excel报“Data Validation extension is not supported and will be removed“错解决方法
|
测试技术
如何使用 jMeter CSV Data Set config
如何使用 jMeter CSV Data Set config
如何使用 jMeter CSV Data Set config
jMeter parallel controller 无法使用 CSV Data config 提供的变量?
jMeter parallel controller 无法使用 CSV Data config 提供的变量?
112 0
jMeter parallel controller 无法使用 CSV Data config 提供的变量?
因为缺少xs-security.json文件导致的部署错误
因为缺少xs-security.json文件导致的部署错误
101 0
因为缺少xs-security.json文件导致的部署错误
|
JSON 数据格式
SAP UI5 json model load data的原理
Created by Wang, Jerry, last modified on Oct 19, 2015
129 0
SAP UI5 json model load data的原理