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.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
final
- 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.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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.
inherited
-
renameProperty(
String className, String oldPropertyName, String newPropertyName) → void - Renames a property during a migration.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited