Migrator class Null safety

Runs migrations declared by a MigrationStrategy.

Constructors

Migrator(GeneratedDatabase _db)
Used internally by drift when opening the database.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addColumn(TableInfo<Table, dynamic> table, GeneratedColumn column) Future<void>
Adds the given column to the specified table.
alterTable(TableMigration migration) Future<void>
Experimental utility method to alter columns of an existing table. [...]
createAll() Future<void>
Creates all tables, triggers, views, indexes and everything else defined in the database, if they don't exist.
createAllTables() Future<void>
Creates all tables specified for the database, if they don't exist
@Deprecated('Use createAll() instead')
createIndex(Index index) Future<void>
Executes a CREATE INDEX statement to create the index.
createTable(TableInfo<Table, dynamic> table) Future<void>
Creates the given table if it doesn't exist
createTrigger(Trigger trigger) Future<void>
Executes the CREATE TRIGGER statement that created the trigger.
createView(View view) Future<void>
Executes a CREATE VIEW statement to create the view.
deleteTable(String name) Future<void>
Deletes the table with the given name. Note that this function does not escape the name parameter.
drop(DatabaseSchemaEntity entity) Future<void>
Drops a table, trigger or index.
issueCustomQuery(String sql, [List? args]) Future<void>
Executes the custom query.
@Deprecated('Use customStatement in the database class')
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
renameColumn(TableInfo<Table, dynamic> table, String oldName, GeneratedColumn column) Future<void>
Changes the name of a column in a table. [...]
renameTable(TableInfo<Table, dynamic> table, String oldName) Future<void>
Changes the table name from oldName to the current TableInfo.actualTableName. [...]
toString() String
A string representation of this object. [...]
inherited

Operators

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