SqlMigrationRunner<S extends Schema> class abstract

A migration runner of a SQL database, which records the migrations run in its migrations table, by their Migration.name and the batch of the up that ran them.

A database gives how its table is created and queried, its schema S, and how one is run and recorded, or undone and removed.

Implemented types
Implementers

Constructors

SqlMigrationRunner(Logger log, Iterable<Migration> migrations)

Properties

hashCode → int
The hash code for this object.
no setterinherited
log → Logger
final
migrations → Map<String, Migration>
The migrations added, by their names, once the runner has started.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMigration(Migration migration) → void
override
close() → Future
inherited
compileSchema(S schema) → String
The SQL of schema.
compileUp(Migration migration) → String
The SQL of the up of migration, by which two migrations of a class are told to be the same, or not.
createMigrationsTable() → Future<void>
Creates the migrations table, with its id, batch and path, if it does not exist.
deletePath(String path) → Future<void>
Removes path from the migrations table.
newSchema() → S
A new schema of the database.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryColumn(String sql) → Future<List<Object?>>
The values of the first column of the rows of sql.
renamePath(String path, String name) → Future<void>
Sets path of the migrations table to name.
reset() → Future
override
rollback() → Future
override
runAndRecord(S schema, String name, int batch) → Future<void>
Runs schema, and records name in the migrations table in batch: in one transaction, if the database changes its tables in one.
runAndRemove(S schema, String name) → Future<void>
Runs schema, and removes name from the migrations table: in one transaction, if the database changes its tables in one.
runDown(String name, Migration migration) → Future<void>
Runs the down of migration, and removes name.
runUp(String name, Migration migration, int batch) → Future<void>
Runs the up of migration, and records it as name in batch.
toString() → String
A string representation of this object.
inherited
up() → Future
override

Operators

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