What is the proper way to fix "destructive" changes?

This is getting out of hand for me. Every time I make a destructive change it seems I need to completely drop the table.

Terminating sync seems to do absolutely nothing.

What is the proper sequence to do a destructive change?

Hi James,

What do you mean by “drop the table” ?

How/where are you currently making the destructive change?

Is this a production app?

If you’re updating the data object model in your client code with destructive changes while development mode is enabled, you will first need to manually remove the schema configuration in your Realm UI that corresponds to the change you’re making. Only additive changes are allowed in development mode.

Example: If you’re changing the data type of a single property in your client code (a destructive change), you will need to manually remove that property from the collection in your current Server Schema (in the UI) - this requires a sync terminate and restart. Once you run the client with development mode enabled, it will update the schema with the change as an additive change because the server schema does not have that property configured anymore.

If you’re making multiple destructive changes for an object, you might choose to remove the entire schema configuration for the given collection so that the schema is re-built via development mode using the client object models. To remove a collection schema, this can be done using the “remove configuration” button found in the UI when viewing your schema - this also requires a sync terminate and restart.

Please also see the instructions below for modifying a synced object:


1 Like