db\Migration renameTable()

renameTable() public method Builds and executes a SQL statement for renaming a DB table. public void renameTable ( $table, $newName )$table string The table to be renamed. The name will be properly quoted by the method. $newName string The new table name. The name will be properly quoted by the method.

db\Migration renameColumn()

renameColumn() public method Builds and executes a SQL statement for renaming a column. public void renameColumn ( $table, $name, $newName )$table string The table whose column is to be renamed. The name will be properly quoted by the method. $name string The old name of the column. The name will be properly quoted by the method. $newName string The new name of the column. The name will be properly quoted by the method.

db\Migration insert()

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

db\Migration init()

init() public method Initializes the migration. This method will set $db to be the 'db' application component, if it is null. public void init ( )

db\Migration getDb()

getDb() protected method (available since version 2.0.6) protected void getDb ( )

db\Migration execute()

execute() public method Executes a SQL statement. This method executes the specified SQL statement using $db. public void execute ( $sql, $params = [] )$sql string The SQL statement to be executed $params array Input parameters (name => value) for the SQL execution. See yii\db\Command::execute() for more details.

db\Migration dropTable()

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

db\Migration dropPrimaryKey()

dropPrimaryKey() public method Builds and executes a SQL statement for dropping a primary key. public void dropPrimaryKey ( $name, $table )$name string The name of the primary key constraint to be removed. $table string The table that the primary key constraint will be removed from.

db\Migration dropIndex()

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

db\Migration dropForeignKey()

dropForeignKey() public method Builds a SQL statement for dropping a foreign key constraint. public void dropForeignKey ( $name, $table )$name string The name of the foreign key constraint to be dropped. The name will be properly quoted by the method. $table string The table whose foreign is to be dropped. The name will be properly quoted by the method.