SqliteMigrationRunner class

A SQLite database migration runner, of a database of the sqlite3 package.

Each migration is run, and recorded in the migrations table, in one savepoint, as SQLite changes its tables in a transaction, so that a migration that fails is neither run nor recorded. It is a transaction of its own, or a part of the one the database is in.

Inheritance

Constructors

SqliteMigrationRunner(CommonDatabase database, {Iterable<Migration> migrations = const []})

Properties

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

Methods

addMigration(Migration migration) → void
inherited
close() → Future
Closes the database.
override
compileSchema(SqliteSchema schema) → String
The SQL of schema.
override
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.
inherited
createMigrationsTable() → Future<void>
Creates the migrations table, with its id, batch and path, if it does not exist.
override
deletePath(String path) → Future<void>
Removes path from the migrations table.
override
newSchema() → SqliteSchema
A new schema of the database.
override
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.
override
renamePath(String path, String name) → Future<void>
Sets path of the migrations table to name.
override
reset() → Future
inherited
rollback() → Future
inherited
runAndRecord(SqliteSchema 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.
override
runAndRemove(SqliteSchema 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.
override
runDown(String name, Migration migration) → Future<void>
Runs the down of migration, and removes name.
inherited
runUp(String name, Migration migration, int batch) → Future<void>
Runs the up of migration, and records it as name in batch.
inherited
toString() → String
A string representation of this object.
inherited
up() → Future
inherited

Operators

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