Migration class Realm

A Migration object is passed to you when you migrate your database from one version to another. It contains the properties for the Realm before and after the migration. After the migration is complete, newRealm will become the authoritative version of the file.


hashCode int
The hash code for this object.
newRealm Realm
The Realm as it exists after the migration. Before the end of the callback, you need to make sure that all relevant data has been migrated from oldRealm into newRealm.
oldRealm MigrationRealm
The Realm as it existed just before the migration. Since the models have changed, this Realm can only be accessed via the dynamic API.
runtimeType Type
A representation of the runtime type of the object.


deleteType(String className) bool
Deletes a type during a migration. All the data associated with the type, as well as its schema, will be deleted from the Realm.
findInNewRealm<T extends RealmObject>(RealmObject oldObject) → T?
Finds an object obtained from oldRealm in newRealm. This is useful when you are working with objects without primary keys and want to update some information about the object as part of the migration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
renameProperty(String className, String oldPropertyName, String newPropertyName) → void
Renames a property during a migration.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.