How to handle Realm React Native migrations and schemaVersion on iOS?

Viewed 6037

Before I fall in love with realm on react-native and iOS, I am trying to learn more about how I can handle migrations. This statement has me concerned:

Realm React Native 0.10.0

Migrations are currently limited to updating the schema and schemaVersion when opening a Realm as outlined above. Data migrations are not yet supported but may be added in the future.

I understand this to mean I need to increment schemaVersion each time I make a change to **any schema**.

How can I specify multiple schemas, each with their own schema versions ?

This does NOT work:

export default new Realm(
  {schema: [AppSetting], schemaVersion: 0},
  {schema: [Gps], schemaVersion: 3},
  {schema: [Waypoint], schemaVersion: 4},
  {schema: [FlightPath], schemaVersion: 1},
);

This assumes that my more complicated schemas might need to be revised frequently until I get things right.

Will migrations be simple as long as I only add new properties?

I assume I cannot rename or remove existing properties?

Advice on realm migrations is much appreciated,

1 Answers
Related