Skip to content

Embedded objects migration: How to delete Orphaned objects after migration? #2393

Discussion options

You must be logged in to vote

I have added three new tests for this as part of #2394:
https://github.com/realm/realm-dotnet/blob/df/embedded-object-migration-test/Tests/Realm.Tests/Database/MigrationTests.cs#L149-L343

@vardansargsyan92 As @nirinchev already mentioned, deleting objects in the oldRealm is not going to have any effect, since that's not going to be forwarded to the newRealm while the migration is already in progress. The oldRealm is basically just a reference to the database using the old schema and the newRealm is the view onto the database using the new schema.

You would have to iterate in the new realm therefore. The problem is now, looking at https://github.com/realm/realm-dotnet/blob/df/embedded-obje…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@vardansargsyan92
Comment options

@softlion
Comment options

Comment options

You must be logged in to vote
3 replies
@vardansargsyan92
Comment options

@DominicFrei
Comment options

@vardansargsyan92
Comment options

Answer selected by vardansargsyan92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants