db\mysql\Schema createColumnSchemaBuilder()

createColumnSchemaBuilder() public method Create a column schema builder instance giving the type and value precision. This method may be overridden by child classes to create a DBMS-specific column schema builder. public yii\db\ColumnSchemaBuilder createColumnSchemaBuilder ( $type, $length = null )$type string Type of the column. See yii\db\mysql\ColumnSchemaBuilder::$type. $length integer|string|array Length or precision of the column. See yii\db\mysql\ColumnSchemaBuilder::$length.

db\mysql\Schema findColumns()

findColumns() protected method Collects the metadata of table columns. protected boolean findColumns ( $table )$table yii\db\TableSchema The table metadata return boolean Whether the table exists in the database throws Exception if DB query fails

db\mysql\Schema createQueryBuilder()

createQueryBuilder() public method Creates a query builder for the MySQL database. public yii\db\mysql\QueryBuilder createQueryBuilder ( )return yii\db\mysql\QueryBuilder Query builder instance

db\mysql\Schema $typeMap

$typeMap public property Mapping from physical column types (keys) to abstract column types (values) public array $typeMap = ['tinyint' => self::TYPE_SMALLINT, 'bit' => self::TYPE_INTEGER, 'smallint' => self::TYPE_SMALLINT, 'mediumint' => self::TYPE_INTEGER, 'int' => self::TYPE_INTEGER, 'integer' => self::TYPE_INTEGER, 'bigint' => self::TYPE_BIGINT, 'float' => self::TYPE_FLOAT, 'double' => self::TYPE_DOUBLE, 'real' => self::TYPE_FLOAT, 'decimal' => self::TY

db\mysql\QueryBuilder renameColumn()

renameColumn() public method Builds a SQL statement for renaming a column. public string renameColumn ( $table, $oldName, $newName )$table string The table whose column is to be renamed. The name will be properly quoted by the method. $oldName 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. return string The SQL statement for renaming a DB column. throws y

db\mysql\QueryBuilder resetSequence()

resetSequence() public method Creates a SQL statement for resetting the sequence value of a table's primary key. The sequence will be reset such that the primary key of the next new row inserted will have the specified value or 1. public string resetSequence ( $tableName, $value = null )$tableName string The name of the table whose primary key sequence will be reset $value mixed The value for the primary key of the next new row inserted. If this is not set, the next new row's primary k

db\mysql\QueryBuilder dropForeignKey()

dropForeignKey() public method Builds a SQL statement for dropping a foreign key constraint. public string 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. return string The SQL statement for dropping a foreign key constraint.

db\mysql\QueryBuilder dropCommentFromTable()

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

db\mysql\QueryBuilder dropPrimaryKey()

dropPrimaryKey() public method Builds a SQL statement for removing a primary key constraint to an existing table. public string 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. return string The SQL statement for removing a primary key constraint from an existing table.

db\mysql\QueryBuilder insert()

insert() public method Creates an INSERT SQL statement. For example, $sql = $queryBuilder->insert('user', [ 'name' => 'Sam', 'age' => 30, ], $params); The method will properly escape the table and column names. public string insert ( $table, $columns, &$params )$table string The table that new rows will be inserted into. $columns array The column data (name => value) to be inserted into the table. $params array The binding parameters that will be generated by