improved docs and changelog for #8903

This commit is contained in:
Carsten Brandt
2015-07-02 15:20:32 +02:00
parent db12282e59
commit 9c4c984200
2 changed files with 18 additions and 3 deletions

View File

@@ -18,13 +18,24 @@ use yii\base\InvalidParamException;
class QueryBuilder extends \yii\db\QueryBuilder
{
/**
* You can use any of these indexes for the postgresql 8.2+ version
* @see http://www.postgresql.org/docs/8.2/static/sql-createindex.html
* Defines a UNIQUE index for [[createIndex()]].
*/
const INDEX_UNIQUE = 'unique';
/**
* Defines a B-tree index for [[createIndex()]].
*/
const INDEX_B_TREE = 'btree';
/**
* Defines a hash index for [[createIndex()]].
*/
const INDEX_HASH = 'hash';
/**
* Defines a GiST index for [[createIndex()]].
*/
const INDEX_GIST = 'gist';
/**
* Defines a GIN index for [[createIndex()]].
*/
const INDEX_GIN = 'gin';
/**
@@ -81,8 +92,11 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @param string|array $columns the column(s) that should be included in the index. If there are multiple columns,
* separate them with commas or use an array to represent them. Each column name will be properly quoted
* by the method, unless a parenthesis is found in the name.
* @param boolean|string $unique whether to add UNIQUE constraint or if is $unique string create some of index.
* @param boolean|string $unique whether to make this a UNIQUE index constraint. You can pass `true` or [[INDEX_UNIQUE]] to create
* a unique index, `false` to make a non-unique index using the default index type, or one of the following constants to specify
* the index method to use: [[INDEX_B_TREE]], [[INDEX_HASH]], [[INDEX_GIST]], [[INDEX_GIN]].
* @return string the SQL statement for creating a new index.
* @see http://www.postgresql.org/docs/8.2/static/sql-createindex.html
*/
public function createIndex($name, $table, $columns, $unique = false)
{