db\Migration dropCommentFromTable()

dropCommentFromTable() public method (available since version 2.0.8) Builds a SQL statement for dropping comment from table public void dropCommentFromTable ( $table )$table string The table whose column is to be commented. The table name will be properly quoted by the method.

db\Migration dropCommentFromColumn()

dropCommentFromColumn() public method (available since version 2.0.8) Builds and execute a SQL statement for dropping comment from column public void dropCommentFromColumn ( $table, $column )$table string The table whose column is to be commented. The table name will be properly quoted by the method. $column string The name of the column to be commented. The column name will be properly quoted by the method.

db\Migration dropColumn()

dropColumn() public method Builds and executes a SQL statement for dropping a DB column. public void dropColumn ( $table, $column )$table string The table whose column is to be dropped. The name will be properly quoted by the method. $column string The name of the column to be dropped. The name will be properly quoted by the method.

db\Migration down()

down() public method This method contains the logic to be executed when removing this migration. The default implementation throws an exception indicating the migration cannot be removed. Child classes may override this method if the corresponding migrations can be removed. public boolean down ( )return boolean Return a false value to indicate the migration fails and should not proceed further. All other return values mean the migration succeeds.

db\Migration delete()

delete() public method Creates and executes a DELETE SQL statement. public void delete ( $table, $condition = '', $params = [] )$table string The table where the data will be deleted from. $condition array|string The conditions that will be put in the WHERE part. Please refer to yii\db\Query::where() on how to specify conditions. $params array The parameters to be bound to the query.

db\Migration createTable()

createTable() public method Builds and executes a SQL statement for creating a new DB table. The columns in the new table should be specified as name-definition pairs (e.g. 'name' => 'string'), where name stands for a column name which will be properly quoted by the method, and definition stands for the column type which can contain an abstract DB type. The yii\db\QueryBuilder::getColumnType() method will be invoked to convert any abstract type into a physical one. If a column is specifi

db\Migration createIndex()

createIndex() public method Builds and executes a SQL statement for creating a new index. public void createIndex ( $name, $table, $columns, $unique = false )$name string The name of the index. The name will be properly quoted by the method. $table string The table that the new index will be created for. The table name will be properly quoted by the method. $columns string|array The column(s) that should be included in the index. If there are multiple columns, please separate them

db\Migration batchInsert()

batchInsert() public method Creates and executes an batch INSERT SQL statement. The method will properly escape the column names, and bind the values to be inserted. public void batchInsert ( $table, $columns, $rows )$table string The table that new rows will be inserted into. $columns array The column names. $rows array The rows to be batch inserted into the table

db\Migration alterColumn()

alterColumn() public method Builds and executes a SQL statement for changing the definition of a column. public void alterColumn ( $table, $column, $type )$table string The table whose column is to be changed. The table name will be properly quoted by the method. $column string The name of the column to be changed. The name will be properly quoted by the method. $type string The new column type. The yii\db\QueryBuilder::getColumnType() method will be invoked to convert abstract colum

db\Migration addPrimaryKey()

addPrimaryKey() public method Builds and executes a SQL statement for creating a primary key. The method will properly quote the table and column names. public void addPrimaryKey ( $name, $table, $columns )$name string The name of the primary key constraint. $table string The table that the primary key constraint will be added to. $columns string|array Comma separated string or array of columns that the primary key will consist of.