public function createIndex($tablename, array $indexDef, $options = []) {
        $sql = 'create '.
            (val('type', $indexDef) === Db::INDEX_UNIQUE ? 'unique ' : '').
            'index '.
            (val(Db::OPTION_IGNORE, $options) ? 'if not exists ' : '').
            $this->buildIndexName($tablename, $indexDef).
            ' on '.
            $this->backtick($this->px.$tablename).
            $this->bracketList($indexDef['columns'], '`');

        $this->query($sql, Db::QUERY_DEFINE);
    }
public function createIndex($tablename, array $indexDef, $options = []) {
        $sql = 'create '.
            (val('type', $indexDef) === Db::INDEX_UNIQUE ? 'unique ' : '').
            'index '.
            (val(Db::OPTION_IGNORE, $options) ? 'if not exists ' : '').
            $this->buildIndexName($tablename, $indexDef).
            ' on '.
            $this->backtick($this->px.$tablename).
            $this->bracketList($indexDef['columns'], '`');

        $this->query($sql, Db::QUERY_DEFINE);
    }
public function createIndex ( $ tablename , array $ indexDef , $ options = [ ] ) { $ sql = 'create ' . ( val ( 'type' , $ indexDef ) === Db :: INDEX_UNIQUE ? 'unique ' : '' ) . 'index ' . ( val ( Db :: OPTION_IGNORE , $ options ) ? 'if not exists ' : '' ) . $ this -> buildIndexName ( $ tablename , $ indexDef ) . ' on ' . $ this -> backtick ( $ this -> px . $ tablename ) . $ this -> bracketList ( $ indexDef [ 'columns' ] , '`' ) ; $ this -> query ( $ sql , Db :: QUERY_DEFINE ) ; }
Create an index.

@param string $tablename The name of the table to create the index on.
@param array $indexDef The index definition.
@param array $options Additional options for the index creation.
Create an index .