The concrete type of this TableMigration
(ReversibleTableMigration or IrreversibleTableMigration).* Operations that are in of themselves reversible will return an instance of this type.
The concrete type of this TableMigration
(ReversibleTableMigration or IrreversibleTableMigration).* Operations that are in of themselves reversible will return an instance of this type.
[use case] Append a ReversibleMigration to form either a
ReversibleMigrationSeq if the left side of &
is also a ReversibleMigration;
or else a plain MigrationSeq
Append a ReversibleMigration to form either a
ReversibleMigrationSeq if the left side of &
is also a ReversibleMigration;
or else a plain MigrationSeq
the ReversibleMigration to append
val combined = mig1 & mig2 & mig3
[use case] Append another Migration to form a MigrationSeq
Append another Migration to form a MigrationSeq
the Migration to append
val combined = mig1 & mig2 & mig3
The SQL statements to run
The SQL statements to run
Add columns to the table.
Add columns to the table.
(If the table is being created, these may be incorporated into the CREATE TABLE
statement.)
zero or more column-returning functions, which are passed the table object.
tblMig.addColumns(_.col1, _.col2, _.column[Int]("fieldNotYetInTableDef"))
Adds foreign key constraints.
Adds foreign key constraints.
zero or more ForeignKeyQuery
-returning functions, which are passed the table object.
tblMig.addForeignKeys(_.fkDef)
Adds indexes
Adds indexes
zero or more Index
-returning functions, which are passed the table object.
tblMig.addIndexes(_.idxDef)
Adds primary key constraints.
Adds primary key constraints.
zero or more PrimaryKey
-returning functions, which are passed the table object.
tblMig.addPrimaryKeys(_.pkDef)
Changes the default value of columns based on the column definitions in cols
Changes the default value of columns based on the column definitions in cols
zero or more column-returning functions, which are passed the table object.
tblMig.alterColumnDefaults(_.col1, _.column[Int]("col2", O.Default("notTheDefaultInTableDef")))
Changes the nullability of columns based on the column definitions in cols
Changes the nullability of columns based on the column definitions in cols
zero or more column-returning functions, which are passed the table object.
tblMig.alterColumnNulls(_.col1, _.column[Int]("col2", O.NotNull))
Changes the data type of columns based on the column definitions in cols
Changes the data type of columns based on the column definitions in cols
zero or more column-returning functions, which are passed the table object.
tblMig.alterColumnTypes(_.col1, _.column[NotTheTypeInTableDef]("col2"))
a Slick driver, used to extract ColumnInfo#sqlType
and ColumnInfo#notNull
by calling typeInfoFor
a ColumnInfo
representing the relevant information in column
Create the table.
Create the table. Note: drop + create is allowed.
Drop the table.
Drop the table. Note: drop + create is allowed.
Drop columns.
Drop columns.
zero or more column-returning functions, which are passed the table object.
tblMig.dropColumns(_.col1, _.col2, _.column[Int]("oldFieldNotInTableDef"))
Drops foreign key constraints.
Drops foreign key constraints.
zero or more ForeignKeyQuery
-returning functions, which are passed the table object.
tblMig.dropForeignKeys(_.fkDef)
Drops indexes
Drops indexes
zero or more Index
-returning functions, which are passed the table object.
tblMig.dropIndexes(_.idxDef)
Drops primary key constraints.
Drops primary key constraints.
zero or more PrimaryKey
-returning functions, which are passed the table object.
tblMig.dropPrimaryKeys(_.pkDef)
a FieldSymbol
representing the column
if node
represents a reference to a table's column, that is, it is a Select(_, f: FieldSymbol)
,
then Some(f)
; otherwise None
an IndexInfo
containing the relevant information from a Slick Index
Rename the table
Rename a column.
Rename a column.
a column-returning function, which is passed the table object.
tblMig.renameColumns(_.col1, "newName")
Renames an index
Renames an index
an Index
-returning function, which is passed the table object.
tblMig.renameIndex(_.idxDef, "newName")
Runs all the SQL statements in a single transaction
Runs all the SQL statements in a single transaction
a Slick table object whose qualified name is needed
a TableInfo
representing the qualified name of table
The concrete TableMigration class used when all operations are reversible. This class extends ReversibleMigration and as such includes a reverse method that returns a
TableMigration
that performs the inverse operations ("down migration").