DataMigration class abstract

Interface for migrating data from fromVersion to toVersion.

class CounterV1DataMigration extends DataMigration {
  @override
  int get fromVersion => 1;

  @override
  int get toVersion => 2;

  @override
  Future<dynamic> migrate(dynamic data) async {
    return '{count: $data}';
  }
}

Constructors

DataMigration.new()

Properties

fromVersion int
The version of the data to be migrated.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toVersion int
The version of the data once the migration has been completed.
no setter

Methods

migrate(dynamic data) Future
apply migration from fromVersion to toVersion
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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