MysqlAlterTable class

Constructors

MysqlAlterTable(String tableName)

Properties

compileColumn → String Function(MigrationColumn column)
Compiles a column, with its type, constraints and references.
finalinherited
compileIndex → String? Function(String name, MigrationColumn column)
Compiles the index of a column, such as INDEX(a), if it has one.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
ifExists → bool
Whether indexes are added with IF NOT EXISTS and dropped with IF EXISTS, which MariaDB has and MySQL has not.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tableName → String
finalinherited

Methods

addIndex(String name, List<String> columns, IndexType type) → void
inherited
boolean(String name) → MigrationColumn
inherited
changeColumnType(String name, ColumnType type, {int length = Column.defaultLength, int? precision, int? scale, bool? isNullable, Object? defaultValue, bool? autoIncrement, String? using}) → void
Changes the type of the column name to type, with its length, precision and scale, which are as for a Column: without a precision or scale, a numeric is unbounded on PostgreSQL, so that its values are kept, and numeric(17, 3) on MySQL and MariaDB.
inherited
compile(StringBuffer buf, int indent) → void
Compiles the ALTER TABLE statements of the table, which may be compiled again.
inherited
date(String name) → MigrationColumn
inherited
decimal(String name, {int? precision, int? scale}) → MigrationColumn
A decimal(precision, scale) column. Without a precision or scale, it is an unbounded decimal on PostgreSQL, and decimal(17, 3) on MySQL and MariaDB (Column.defaultPrecision and Column.defaultScale). With a precision but no scale, the scale is Column.defaultScale, or the precision if smaller, e.g. decimal(10, 3); give scale: 0 for whole numbers.
inherited
declare(String name, ColumnType type) → MigrationColumn
inherited
declareColumn(String name, Column column) → MigrationColumn
inherited
double(String name) → MigrationColumn
inherited
dropColumn(String name) → void
inherited
dropIndex(String name) → void
inherited
dropNotNull(String name) → void
MySQL and MariaDB have no ALTER COLUMN DROP NOT NULL, so the column is defined again by a MODIFY, which keeps its type and constraints.
inherited
dropPrimaryIndex() → void
inherited
float(String name) → MigrationColumn
inherited
integer(String name) → MigrationColumn
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numeric(String name, {int? precision, int? scale}) → MigrationColumn
A numeric(precision, scale) column. Without a precision or scale, it is an unbounded numeric on PostgreSQL, and numeric(17, 3) on MySQL and MariaDB (Column.defaultPrecision and Column.defaultScale). With a precision but no scale, the scale is Column.defaultScale, or the precision if smaller, e.g. numeric(10, 3); give scale: 0 for whole numbers.
inherited
rename(String newName) → void
inherited
renameColumn(String name, String newName) → void
inherited
serial(String name) → MigrationColumn
inherited
setNotNull(String name) → void
inherited
text(String name) → MigrationColumn
inherited
timeStamp(String name, {bool timezone = false}) → MigrationColumn
inherited
toString() → String
A string representation of this object.
inherited
varChar(String name, {int? length}) → MigrationColumn
inherited

Operators

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