public static function addPrimaryKey($table, $columns)
    {
        return Yii::$app->db->createCommand()
            ->addPrimaryKey($table .'_pk', $table, $columns)
            ->execute();
    }
public static function addPrimaryKey($table, $columns)
    {
        return Yii::$app->db->createCommand()
            ->addPrimaryKey($table .'_pk', $table, $columns)
            ->execute();
    }
public static function addPrimaryKey ( $ table , $ columns ) { return Yii :: $ app -> db -> createCommand ( ) -> addPrimaryKey ( $ table . '_pk' , $ table , $ columns ) -> execute ( ) ; }
Adds PK with common name
@param $table
@param $columns
@return int
@throws \yii\db\Exception
Adds PK with common name