MySqlMigrationRunner class
A MySQL database migration runner, of a connection of mysql_dart.
MySQL commits each change of a table on its own, so a migration is
recorded in the migrations table once it has run.
- Inheritance
-
- Object
- SqlMigrationRunner<
MySqlSchema> - MySqlFamilyMigrationRunner<
MySqlSchema> - MySqlMigrationRunner
Constructors
-
MySqlMigrationRunner(MySQLConnection connection, {Iterable<
Migration> migrations = const [], @Deprecated('Not used: the runner uses the connection as it is given, and close() closes it.') bool connected = false})
Properties
- connection → MySQLConnection
-
finalinherited
- 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 -
inherited
-
compileSchema(
MySqlSchema schema) → String -
The SQL of
schema.inherited -
compileUp(
Migration migration) → String -
The SQL of the
upofmigration, by which two migrations of a class are told to be the same, or not.inherited -
createMigrationsTable(
) → Future< void> -
Creates the
migrationstable, with itsid,batchandpath, if it does not exist.inherited -
deletePath(
String path) → Future< void> -
Removes
pathfrom themigrationstable.inherited -
newSchema(
) → MySqlSchema -
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.inherited -
renamePath(
String path, String name) → Future< void> -
Sets
pathof themigrationstable toname.inherited -
reset(
) → Future -
inherited
-
rollback(
) → Future -
inherited
-
runAndRecord(
MySqlSchema schema, String name, int batch) → Future< void> -
Runs
schema, and recordsnamein themigrationstable inbatch: in one transaction, if the database changes its tables in one.inherited -
runAndRemove(
MySqlSchema schema, String name) → Future< void> -
Runs
schema, and removesnamefrom themigrationstable: in one transaction, if the database changes its tables in one.inherited -
runDown(
String name, Migration migration) → Future< void> -
Runs the
downofmigration, and removesname.inherited -
runUp(
String name, Migration migration, int batch) → Future< void> -
Runs the
upofmigration, and records it asnameinbatch.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
up(
) → Future -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited