-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to execute a migration that changes the "embeddedness" of an object #7060
Comments
Thanks for reporting the issue @nirinchev! In this case, there is actually only one parent for each child object. So in step two, I think it is enough to have one object linking to it. If you need any more info from me, let me know here or in the forums. |
Just tried the doing the same migration on Android/Java and the migration works perfectly there using the same data models. So this seems to be an issue on iOS only. |
Note about the difference: |
@DominicFrei What does this mean in practice? Does that mean that this migration won't be possible to do with the iOS SDK? Is there a way to run the iOS SDK using manual schema mode? |
@sipersso I did have a longer conversation about this yesterday. We need to fix two things to make this work. So at the moment it actually does not which is a bug. |
The relevant core changes have been released with Realm Cocoa 10.7.0. |
Goals
A user has reported on the forums that they would like to be able to migrate a model from
Object
toEmbeddedObject
.Expected Results
Migration function gets executed allowing them to ensure each object only has one parent, after which the "embeddedness" of the table changes and the model is now treated as embedded.
Actual Results
App crashes with
Cannot convert object type ‘MyObject’ to embedded because objects have multiple incoming links*.
. Based on a conversation with @jsflax and @tgoyne, it appears the reason is that the SDK eagerly changes the table to embedded before running the migration function, which then triggers a guard at Core that ensures that only one parent points to the child object.Steps for others to Reproduce
Don't have exact steps, but seems like:
Object
.EmbeddedObject
.Version of Realm and Tooling
Realm framework version: 10.5.0
The text was updated successfully, but these errors were encountered: