MigrationFile class abstract
Contract representing a database migration file.
Implement this class to define schema changes for your database.
Example:
class CreateUsersTable extends MigrationFile {
@override
Future<void> up(SchemaBuilder builder) async {
builder.create('users', (table) {
table.id();
table.string('name');
});
}
@override
Future<void> down(SchemaBuilder builder) async {
builder.drop('users');
}
}
Constructors
Properties
Methods
-
down(
SchemaBuilder builder) → Future< void> - Defines how to reverse the schema operations.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
up(
SchemaBuilder builder) → Future< void> - Defines the schema operations to apply.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited