migration

fun migration(migration: RealmMigration): RealmConfiguration.Builder

Sets the migration to handle schema updates.

See also

Parameters

migration

the RealmMigration instance to handle schema and data migration in the event of a schema update.


fun migration(migration: AutomaticSchemaMigration, resolveEmbeddedObjectConstraints: Boolean = false): RealmConfiguration.Builder

Sets the migration to handle schema updates with automatic migration of data.

See also

Parameters

migration

the AutomaticSchemaMigration instance to handle schema and data migration in the event of a schema update.

resolveEmbeddedObjectConstraints

a flag to indicate whether realm should resolve embedded object constraints after migration. If this is true then all embedded objects without a parent will be deleted and every embedded object with multiple references to it will be duplicated so that every referencing object will hold its own copy of the embedded object.