Concrete migration classes must define this method to back out of this migration.
Concrete migration classes must define this method to back out of this migration. If the migration cannot be reversed, then a IrreversibleMigrationException should be thrown.
Concrete migration classes must define this method to migrate the database up to a new migration.
Add a CHECK constraint on a table and one or more columns.
Add a CHECK constraint on a table and one or more columns. The constraint name is automatically generated unless Name() is given as an option.
the table and columns to add the CHECK constraint on
the expression to check
a possibly empty list of check options to customize the creation of the CHECK constraint
Add a foreign key to a table.
Add a foreign key to a table. The name of the foreign key is automatically generated unless Name() is given as an option.
the table and column name(s) that the foreign key references
the table and column name(s) to place the foreign key on
a possibly empty list of foreign key options to customize the creation of the foreign key
Add a foreign key to a table.
Add a foreign key to a table. The name of the foreign key is automatically generated unless Name() is given as an option.
the table and column name(s) to place the foreign key on
the table and column name(s) that the foreign key references
a possibly empty list of foreign key options to customize the creation of the foreign key
Add an index to a table on a column.
Add an index to a table on a column. The name of the index is automatically generated unless Name() is given as an option.
the table to add the index to
the name of the column that the index will be on
a possibly empty list of index options to customize the creation of the index
Add an index to a table on a non-empty list of column names.
Add an index to a table on a non-empty list of column names. The name of the index is automatically generated unless Name() is given as an option.
the table to add the index to
a list of one or more column names that the index will be on
a possibly empty list of index options to customize the creation of the index
This value is true if the database implicitly adds an index on the column that has a foreign key constraint added to it.
This value is true if the database implicitly adds an index on the column that has a foreign key constraint added to it.
The following SQL can be used to test the database. The last statement will fail with a message that there already is an index on the column.
create table parent (pk int primary key); create table child (pk int primary key, pk_parent int not null); alter table child add constraint idx_child_pk_parent foreign key (pk_parent) references parent (pk); create index idx_child_pk_parent on child (pk_parent);
Alter the definition of an existing column.
Alter the definition of an existing column.
NOTE: if the original column definition uses CharacterSet() then it must be used here again, unless the base SQL data type is being changed. For example, on Oracle, creating a column without CharacterSet uses VARCHAR2 while using CharacterSet(Unicode) uses NVARCHAR2, so if the original column used CharacterSet(Unicode) and #alterColumn() is not passed CharacterSet(Unicode), then the column's data type will be change from NVARCHAR2 to VARCHAR2.
the name of the table with the column
the name of the column
the type the column is being altered to
Get the connection to the database the migration can use for any custom work.
Get the connection to the database the migration can use for any custom work. This connection logs all operations performed on it. The Migration subclass must be careful with this connection and leave it in a good state, as all of the other migration methods defined in Migration use the same connection.
Add a grant on a table to a grantee.
Add a grant on a table to a grantee.
the table name to add the grantees to
the grantee to grant the privileges to
a non-empty array of privileges to grant to the grantees
Add a grant on a table to one or more grantees.
Add a grant on a table to one or more grantees.
the table name to add the grantees to
a non-empty array of grantees
a non-empty array of privileges to grant to the grantees
Convert a table and column name definition into a On foreign key instance.
Get the raw connection to the database the migration can use for any custom work.
Get the raw connection to the database the migration can use for any custom work. This connection is the raw connection that underlies the logging connection and does not log any operations performed on it. It should only be used when the logging connection does not provide a required feature. The Migration subclass must be careful with this connection and leave it in a good state, as all of the other migration methods defined in Migration use the same connection.
Convert a table and column name definition into a References foreign key instance.
Remove a CHECK constraint on a table and one or more columns.
Remove a CHECK constraint on a table and one or more columns. The constraint name is automatically generated unless Name() is given as an option.
the table and columns to remove the CHECK constraint from
a possibly empty list of check options to customize the removal of the CHECK constraint
Remove a foreign key from a table.
Remove a foreign key from a table. The name of the foreign key is automatically generated unless Name() is given as an option.
the table and column name(s) that the foreign key references
the table and column name(s) to remove the foreign key from
a possibly empty list of foreign key options to customize the removal of the foreign key
Remove a foreign key from a table.
Remove a foreign key from a table. The name of the foreign key is automatically generated unless Name() is given as an option.
the table and column name(s) to remove the foreign key from
the table and column name(s) that the foreign key references
a possibly empty list of foreign key options to customize the removal of the foreign key
Remove an index on a column in a table.
Remove an index on a column in a table. The name of the index to remove is automatically generated unless Name() is given as an option.
the table to remove the index from
the name of the column the index is on
a possibly empty list of index options to customize the removal of the index
Remove an index on a table that is composed of a non-empty list of column names.
Remove an index on a table that is composed of a non-empty list of column names. The name of the index to remove is automatically generated unless Name() is given as an option.
the table to remove the index from
a list of one or more column names that the index is on
a possibly empty list of index options to customize the removal of the index
Remove privileges on a table from one or more grantees.
Remove privileges on a table from one or more grantees.
the table name to remove the grants from
a non-empty array of privileges to remove from the grantees
Remove privileges on a table from one or more grantees.
Remove privileges on a table from one or more grantees.
the table name to remove the grants from
a non-empty array of grantees
a non-empty array of privileges to remove from the grantees
Override the -> implicit definition to create a MigrationArrowAssoc instead of a scala.
Override the -> implicit definition to create a MigrationArrowAssoc instead of a scala.Predef.ArrowAssoc. See the above comment on the MigrationArrowAssoc class why this is done.
Given a SQL string and a Function1[PreparedStatement,Unit], start a new transaction by turning off auto-commit mode on the connection then create a new prepared statement with the SQL string and pass the prepared statement to the closure argument.
Given a SQL string and a Function1[PreparedStatement,Unit], start a new transaction by turning off auto-commit mode on the connection then create a new prepared statement with the SQL string and pass the prepared statement to the closure argument. The closure should not perform the commit as this method will commit the transaction. If the closure throws an exception then the transaction is rolled back and the exception that caused the rollback is re-thrown. Finally, the auto-commit state is reset to the value the connection had before this method was called.
the SQL text that will be prepared
the Function1[PreparedStatement,Unit] that will be given a new prepared statement
Given a SQL result set and a Function1[ResultSet,R], pass the result set to the closure.
Given a SQL result set and a Function1[ResultSet,R], pass the result set to the closure. After the closure has completed, either normally via a return or by throwing an exception, close the result set.
the SQL result set
the Function1[ResultSet,R] that will be given the result set
the result of f if f returns normally