public function addPrimaryKey($table, $columnNames)
    {
        $table = $this->prefixTable($table);
        if (!is_array($columnNames)) {
            $columnNames = array($columnNames);
        }

        return $this->container->make('Piwik\Updater\Migration\Db\AddPrimaryKey', array(
            'table' => $table, 'columnNames' => $columnNames
        ));
    }
public function addPrimaryKey($table, $columnNames)
    {
        $table = $this->prefixTable($table);
        if (!is_array($columnNames)) {
            $columnNames = array($columnNames);
        }

        return $this->container->make('Piwik\Updater\Migration\Db\AddPrimaryKey', array(
            'table' => $table, 'columnNames' => $columnNames
        ));
    }
public function addPrimaryKey ( $ table , $ columnNames ) { $ table = $ this -> prefixTable ( $ table ) ; if ( ! is_array ( $ columnNames ) ) { $ columnNames = array ( $ columnNames ) ; } return $ this -> container -> make ( 'Piwik\Updater\Migration\Db\AddPrimaryKey' , array ( 'table' => $ table , 'columnNames' => $ columnNames ) ) ; }
Adds a primary key to an existing database table.

This is equivalent to an `ADD PRIMARY KEY(column_name_1, column_name_2)` in SQL.

@param string $table  Unprefixed database table name, eg 'log_visit'.
@param string[]|string $columnNames Either one or multiple column names, eg array('column_name_1', 'column_name_2')
@return AddPrimaryKey
Adds a primary key to an existing database table .