public function createIndex($name, $table, $columns, $unique = false)
    {
        $description = 'create' . ($unique ? ' unique' : '') . " index $name on $table (" . implode(',', (array)$columns) . ')';
        $cmdPromise = $this->createCommand()->createIndex($name, $table, $columns, $unique)->execute();
        return $this->execPromise($cmdPromise, $description);
    }
public function createIndex($name, $table, $columns, $unique = false)
    {
        $description = 'create' . ($unique ? ' unique' : '') . " index $name on $table (" . implode(',', (array)$columns) . ')';
        $cmdPromise = $this->createCommand()->createIndex($name, $table, $columns, $unique)->execute();
        return $this->execPromise($cmdPromise, $description);
    }
public function createIndex ( $ name , $ table , $ columns , $ unique = false ) { $ description = 'create' . ( $ unique ? ' unique' : '' ) . " index $name on $table (" . implode ( ',' , ( array ) $ columns ) . ')' ; $ cmdPromise = $ this -> createCommand ( ) -> createIndex ( $ name , $ table , $ columns , $ unique ) -> execute ( ) ; return $ this -> execPromise ( $ cmdPromise , $ description ) ; }
Builds and executes a SQL statement for creating a new index.
@param string $name the name of the index. The name will be properly quoted by the method.
@param string $table the table that the new index will be created for. The table name will be properly quoted by the method.
@param string|array $columns 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 "(".
@param bool $unique whether to add UNIQUE constraint on the created index.
@return LazyPromiseInterface
Builds and executes a SQL statement for creating a new index .