db\Migration addForeignKey()

addForeignKey() public method Builds a SQL statement for adding a foreign key constraint to an existing table. The method will properly quote the table and column names. public void addForeignKey ( $name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null )$name string The name of the foreign key constraint. $table string The table that the foreign key constraint will be added to. $columns string|array The name of the column to that the constraint will be adde

db\Migration addCommentOnTable()

addCommentOnTable() public method (available since version 2.0.8) Builds a SQL statement for adding comment to table public void addCommentOnTable ( $table, $comment )$table string The table whose column is to be commented. The table name will be properly quoted by the method. $comment string The text of the comment to be added. The comment will be properly quoted by the method.

db\Migration addCommentOnColumn()

addCommentOnColumn() public method (available since version 2.0.8) Builds and execute a SQL statement for adding comment to column public void addCommentOnColumn ( $table, $column, $comment )$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. $comment string The text of the comment to be added. The comment will be pro

db\Migration addColumn()

addColumn() public method Builds and executes a SQL statement for adding a new DB column. public void addColumn ( $table, $column, $type )$table string The table that the new column will be added to. The table name will be properly quoted by the method. $column string The name of the new column. The name will be properly quoted by the method. $type string The column type. The yii\db\QueryBuilder::getColumnType() method will be invoked to convert abstract column type (if any) into the

db\Migration $db

$db public property The DB connection object or the application component ID of the DB connection that this migration should work with. Starting from version 2.0.2, this can also be a configuration array for creating the object. Note that when a Migration object is created by the migrate command, this property will be overwritten by the command. If you do not want to use the DB connection provided by the command, you may override the init() method like the following: public function init()

db\IntegrityException getName()

getName() public method public string getName ( )return string The user-friendly name of this exception

db\Expression __toString()

__toString() public method String magic method public string __toString ( )return string The DB expression

db\Expression __construct()

__construct() public method Constructor. public void __construct ( $expression, $params = [], $config = [] )$expression string The DB expression $params array Parameters $config array Name-value pairs that will be used to initialize the object properties

db\Expression $params

$params public property List of parameters that should be bound for this expression. The keys are placeholders appearing in $expression and the values are the corresponding parameter values. public array $params = []

db\Expression $expression

$expression public property The DB expression public string $expression = null