original_string: public function addIndex($table, $columnNames, $indexName = '')
      {
          $table = $this->prefixTable($table);
  
          if (!is_array($columnNames)) {
              $columnNames = array($columnNames);
          }
  
          return $this->container->make('Piwik\Updater\Migration\Db\AddIndex', array(
              'table' => $table, 'columnNames' => $columnNames, 'indexName' => $indexName
          ));
      }
code: public function addIndex($table, $columnNames, $indexName = '')
      {
          $table = $this->prefixTable($table);
  
          if (!is_array($columnNames)) {
              $columnNames = array($columnNames);
          }
  
          return $this->container->make('Piwik\Updater\Migration\Db\AddIndex', array(
              'table' => $table, 'columnNames' => $columnNames, 'indexName' => $indexName
          ));
      }
code_tokens: public function addIndex ( $ table , $ columnNames , $ indexName = '' ) { $ table = $ this -> prefixTable ( $ table ) ; if ( ! is_array ( $ columnNames ) ) { $ columnNames = array ( $ columnNames ) ; } return $ this -> container -> make ( 'Piwik\Updater\Migration\Db\AddIndex' , array ( 'table' => $ table , 'columnNames' => $ columnNames , 'indexName' => $ indexName ) ) ; }
docstring: Adds an index to an existing database table.
  
  This is equivalent to an `ADD INDEX indexname (column_name_1, column_name_2)` in SQL.
  It adds a normal index, no unique index.
  
  Note: If no indexName is specified, it will automatically generate a name for this index if which is basically:
  `'index_' . implode('_', $columnNames)`. If a column name is eg `column1(10)` then only the first part (`column1`)
  will be used. For example when using columns `array('column1', 'column2(10)')` then the index name will be
  `index_column1_column2`.
  
  @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').
  A column name can be appended by a number bracket eg "column_name_1(10)".
  @param string $indexName If specified, the given index name will be used instead of the automatically generated one.
  @return AddIndex
docstring_tokens: Adds an index to an existing database table .