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
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
nametotype, with itslength,precisionandscale, which are as for aColumn: without a precision or scale, anumericis unbounded on PostgreSQL, so that its values are kept, andnumeric(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 aprecisionorscale, it is an unboundeddecimalon PostgreSQL, anddecimal(17, 3)on MySQL and MariaDB (Column.defaultPrecisionandColumn.defaultScale). With aprecisionbut noscale, the scale isColumn.defaultScale, or the precision if smaller, e.g.decimal(10, 3); givescale: 0for whole numbers.inherited -
declare(
String name, ColumnType type) → MigrationColumn -
inherited
-
declareColumn(
String name, Column column) → MigrationColumn -
Adds the column
name, without aUNIQUE, 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 aprecisionorscale, it is an unboundednumericon PostgreSQL, andnumeric(17, 3)on MySQL and MariaDB (Column.defaultPrecisionandColumn.defaultScale). With aprecisionbut noscale, the scale isColumn.defaultScale, or the precision if smaller, e.g.numeric(10, 3); givescale: 0for 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