public static function createIndex($table, $columns, $unique = false)
    {
        return Yii::$app->db->createCommand()
            ->createIndex($table .'_'.implode('-', (array) $columns) . '_idx', $table, $columns, $unique)
            ->execute();
    }
public static function createIndex($table, $columns, $unique = false)
    {
        return Yii::$app->db->createCommand()
            ->createIndex($table .'_'.implode('-', (array) $columns) . '_idx', $table, $columns, $unique)
            ->execute();
    }
public static function createIndex ( $ table , $ columns , $ unique = false ) { return Yii :: $ app -> db -> createCommand ( ) -> createIndex ( $ table . '_' . implode ( '-' , ( array ) $ columns ) . '_idx' , $ table , $ columns , $ unique ) -> execute ( ) ; }
Creates index with common name.
@param $table
@param $columns
@param bool $unique
@return int
@throws \yii\db\Exception
Creates index with common name .