VersionedSchema class abstract base

A snapshot of a database schema at a previous version.

This class is meant to be extended by generated code.

Constructors

VersionedSchema({required DatabaseConnectionUser database, required int version})
Default constructor taking the database and the schema version.

Properties

database DatabaseConnectionUser
The generated database instance, used to create TableInfo instances.
final
entities Iterable<DatabaseSchemaEntity>
All drift schema entities at the time of the set version.
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
version int
The GeneratedDatabase.schemaVersion at the time this schema was active.
final

Methods

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

Static Methods

runMigrationSteps({required Migrator migrator, required int from, required int to, required MigrationStepWithVersion steps}) Future<void>
Helper method that runs a (subset of) stepByStepHelper by invoking the steps function for each intermediate schema version from from until to is reached.
stepByStepHelper({required MigrationStepWithVersion step}) OnUpgrade
A helper used by drift internally to implement the step-by-step migration feature.