SqliteAlterTable class

The changes of a table, each an ALTER TABLE, a CREATE INDEX or a DROP INDEX of its own, in the order they are given, as SQLite takes one change in an ALTER TABLE.

SQLite can rename the table, add, rename and drop a column, and add and drop an index. The other changes throw an UnsupportedError, as SQLite makes them only by creating the table again.

Constructors

SqliteAlterTable(String tableName)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tableName → String
final

Methods

addIndex(String name, List<String> columns, IndexType type) → void
Adds a unique or a standard index of columns. Throws an UnsupportedError for a primary key, which SQLite adds to no table.
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.
compile(StringBuffer buf, int indent) → void
Compiles the statements of the table, indented by indent, which may be compiled again.
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
Adds the column name, without a UNIQUE, which SQLite does not add, but with a unique index of its own, as with a standard index.
double(String name) → MigrationColumn
inherited
dropColumn(String name) → void
Drops the column name, which SQLite does only of a column that is not of a primary key, a unique constraint, an index or a foreign key.
dropIndex(String name) → void
dropNotNull(String name) → void
dropPrimaryIndex() → void
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
renameColumn(String name, String newName) → void
serial(String name) → MigrationColumn
inherited
setNotNull(String name) → void
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