核心数据迁移:将字段提取到抽象实体子级

发布于 2024-09-07 02:59:35 字数 1046 浏览 3 评论 0原文

我进行了一次迁移,将字段从一个实体移动到另一个实体,该实体是抽象实体的子实体。我的模型有一个实体 Thing,它是一个抽象实体 AbstractWidget 的 1->M,它是 NewStuff 的父级。像这样的事情:

+-------+      +----------------+    +----------+
| Thing |<--->>| AbstractWidget |<---| NewStuff |
+-------+      +----------------+    +----------+

我正在将多个属性从 Thing 移动到 NewStuff,并且我一直遵循 我发现一篇博客文章包含进行类似更改的说明

我创建了一个包含结构更改的新版本,并创建了一个映射模型,其中包括名为 ThingToNewThing 的映射,该映射根据说明映射字段,但不映射关系。我没有更改关系,因为 AbstractWidgets 已经设置为可以正常工作。

当我运行我的应用程序时,我会收到发送到控制台的整个内容流,其开头如下:

2010-06-22 14:14:07.463 MyAppName[31418:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 UserInfo=0x55249d0 "Operation could not be completed. (Cocoa error 134140.)"

... 接下来似乎是现有数据属性的列表。

我在任何地方都找不到有关 Cocoa 错误 134140 的任何信息,而且我不知道从这里该去哪里。

任何指导将不胜感激。

I have a migration where I'm moving fields from one entity into another entity which is a child of an abstract entity. My model has an entity, Thing, which is 1->M to an abstract entity, AbstractWidget, which is the parent for NewStuff. Something like this:

+-------+      +----------------+    +----------+
| Thing |<--->>| AbstractWidget |<---| NewStuff |
+-------+      +----------------+    +----------+

I am moving several attributes from Thing to NewStuff, and I've been following the instructions on a blog post I found that has instructions for making a similar change.

I've created a new version with the structural changes, and created a mapping model that include a mapping called ThingToNewThing, which maps the fields, but does not map the relationship, per the instructions. I didn't make the relationship change, as the AbstractWidgets is already set up to properly work.

When I run my app, I get a whole stream of stuff sent to the console, that starts like this:

2010-06-22 14:14:07.463 MyAppName[31418:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 UserInfo=0x55249d0 "Operation could not be completed. (Cocoa error 134140.)"

... followed by what seems to be a listing of the existing data properties.

I can't find anything about Cocoa error 134140 anywhere, and I'm not sure where to go from here.

Any guidance would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素食主义者 2024-09-14 02:59:35

首先,首先将 [error userInfo] 输出到控制台,这将告诉您到底是什么问题。

其次,将该输出复制并粘贴到您的问题中,以便我可以查看:)

更新

根据您发送给我的日志文件,这是根本问题:

无法找到或自动推断迁移的映射模型

这意味着无法找到映射模型。因此,它要么无法匹配源模型,要么无法匹配目标模型,或者您的映射模型不包含在捆绑包中。

First, start by spitting out the [error userInfo] to the console as well, that will tell you exactly what is the issue.

Second, copy and past that output into your question so that I can take a look :)

Update

Based on the log file you sent to me, here is the underlying issue:

Can't find or automatically infer mapping model for migration

This means it is failing to find the mapping model. So either it cannot match up the source model or cannot match up the destination model or your mapping model is not included in the bundle.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文