MigrationStrategy class Null safety

Handles database migrations by delegating work to OnCreate and OnUpgrade methods.

Constructors

MigrationStrategy({OnCreate onCreate = _defaultOnCreate, OnUpgrade onUpgrade = _defaultOnUpdate, OnBeforeOpen? beforeOpen})
Construct a migration strategy from the provided onCreate and onUpgrade methods.

Properties

beforeOpen OnBeforeOpen?
Executes after the database is ready to be used (ie. it has been opened and all migrations ran), but before any other queries will be sent. This makes it a suitable place to populate data after the database has been created or set sqlite PRAGMAS that you need.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
onCreate OnCreate
Executes when the database is opened for the first time.
final
onUpgrade OnUpgrade
Executes when the database has been opened previously, but the last access happened at a different GeneratedDatabase.schemaVersion. Schema version upgrades and downgrades will both be run here.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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