-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add automatic resolution of embedded object constraints during migration #1473
Add automatic resolution of embedded object constraints during migration #1473
Conversation
An observation here. Coming from the SwiftSDK and Java SDK. It seems as if for those SDK:s the resolveEmbeddedObjectConstraints defaults to true. Is there any reason why this shouldn't default to true for the Kotlin SDK? |
@sipersso The feature wasn't available in the C-API layer for core when launching and we didn't caught that as a required use case for the initial release. Now we cannot just update the default behavior. I will rethink if we can introduce this in a way that makes it the new default, e.g. new method or something like that. |
Ok... well as long as I can enable it I guess it isn't an issue. But people migrating from Java to Kotlin might get a nasty surprise if they are not aware of this difference in implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 🚀 .. I was a bit surprised to see the duplicated method, but I assume it is because we need to constrain it to the AutomaticRealmMigration
interface rather than the RealmMigration
interface?
Yes. The option will probably only make sense for an automatic migration, so didn't want to add it to the base method. |
This adds configuration option to enable automatic handling of embedded object constraints during automatic migration through:
The above API was chosen in favor of adding additional properties/methods to the
AutomaticSchemaMigration
interface, as this would require users to instantiate it as anynomous instances and that seems very tedious compared to the standalone functional interface. Alternative it could also have been wrapped in a completely new type, but that just bloats the name space.Closes #1464