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 by commas or use an array. Each column name will be properly quoted by the method. Quoting will be skipped for column names that include a left parenthesis "(".

$unique boolean

Whether to add UNIQUE constraint on the created index.

doc_Yii
2016-10-30 16:58:09
Comments
Leave a Comment

Please login to continue.