Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

How do i perform a destructive schema using full synced realms?

Hello,
I am currently developing an android version for my ios app, and i made a mistake, i forgot to add an @PrimaryKey attribute on a property, and now when i try to open a realm which contains data from ios, i get a schema mismatch error, but when i try to add the @PrimaryKey annotation, i get :“The following changes cannot be made in additive-only schema mode:
- Primary Key for class ‘SomeClass’ has been added.”

@Octavian_Milea You can wipe the app on Android and then re-download the realm from the server side once you match up the schema.

1 Like

Hello Ian, thanks for your reply, the problem is that i already tried it, because that’s how i was doing it on ios, but it seems that the local realm file doesn’t get deleted once the app is deleted, and i also don’t have google backup enabled.

Hello Ian, thanks for your reply, the problem is that i already tried it, because that’s how i was doing it on ios, but it seems that the local realm file doesn’t get deleted once the app is deleted, and i also don’t have google backup enabled.

You can try wiping the entire emulator then.

So, if i am using a device, a factory reset should do, right ?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.