protected function addIndex($name, $cols)
    {
        if (empty($name)) {
            return Yii::t('podium/flash', 'Installation aborted! Index name missing.');
        }
        if (empty($cols)) {
            return Yii::t('podium/flash', 'Installation aborted! Index columns missing.');
        }
        try {
            $this->db->createCommand()->createIndex($this->getIndexName($name), $this->table, $cols)->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table index {name} has been added', [
                'name' => $this->getIndexName($name)
            ]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table index {name} adding', [
                    'name' => $this->getIndexName($name)
                ])
            );
        }
    }
protected function addIndex($name, $cols)
    {
        if (empty($name)) {
            return Yii::t('podium/flash', 'Installation aborted! Index name missing.');
        }
        if (empty($cols)) {
            return Yii::t('podium/flash', 'Installation aborted! Index columns missing.');
        }
        try {
            $this->db->createCommand()->createIndex($this->getIndexName($name), $this->table, $cols)->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table index {name} has been added', [
                'name' => $this->getIndexName($name)
            ]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table index {name} adding', [
                    'name' => $this->getIndexName($name)
                ])
            );
        }
    }
protected function addIndex ( $ name , $ cols ) { if ( empty ( $ name ) ) { return Yii :: t ( 'podium/flash' , 'Installation aborted! Index name missing.' ) ; } if ( empty ( $ cols ) ) { return Yii :: t ( 'podium/flash' , 'Installation aborted! Index columns missing.' ) ; } try { $ this -> db -> createCommand ( ) -> createIndex ( $ this -> getIndexName ( $ name ) , $ this -> table , $ cols ) -> execute ( ) ; return $ this -> returnSuccess ( Yii :: t ( 'podium/flash' , 'Table index {name} has been added' , [ 'name' => $ this -> getIndexName ( $ name ) ] ) ) ; } catch ( Exception $ e ) { return $ this -> returnError ( $ e -> getMessage ( ) , __METHOD__ , Yii :: t ( 'podium/flash' , 'Error during table index {name} adding' , [ 'name' => $ this -> getIndexName ( $ name ) ] ) ) ; } }
Creates database table index.
@param string $name index name
@param array $cols columns
@return string result message
@since 0.2
Creates database table index .