MigrationContext
interface MigrationContext
Content copied to clipboard
A data migration context providing access to the realm before and after an AutomaticSchemaMigration.
NOTE: All objects obtained from oldRealm
and newRealm
are only valid in the scope of the migration.
Functions
enumerate
Link copied to clipboard
open fun enumerate(className: String, block: (oldObject: DynamicRealmObject, newObject: DynamicMutableRealmObject?) -> Unit)
Content copied to clipboard
Convenience method to iterate all objects of a certain class from the realm before migration with access to an updatable DynamicMutableRealmObject reference to the corresponding object in the already migrated realm.