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 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.

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\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 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\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\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\Exception __toString()

__toString() public method public string __toString ( )return string Readable representation of exception

db\Exception __construct()

__construct() public method Constructor. public void __construct ( $message, $errorInfo = [], $code = 0, Exception $previous = null )$message string PDO error message $errorInfo array PDO error info $code integer PDO error code $previous Exception The previous exception used for the exception chaining.