protected function DatabaseSchema_pgsql::_createKeys

7.x schema.inc protected DatabaseSchema_pgsql::_createKeys($table, $new_keys)
2 calls to DatabaseSchema_pgsql::_createKeys()
DatabaseSchema_pgsql::addField in drupal-7.x/includes/database/pgsql/schema.inc
Add a new field to a table.
DatabaseSchema_pgsql::changeField in drupal-7.x/includes/database/pgsql/schema.inc
Change a field definition.

File

drupal-7.x/includes/database/pgsql/schema.inc, line 588
Database schema code for PostgreSQL database servers.

Class

DatabaseSchema_pgsql

Code

protected function _createKeys($table, $new_keys) {
  if (isset($new_keys['primary key'])) {
    $this->addPrimaryKey($table, $new_keys['primary key']);
  }
  if (isset($new_keys['unique keys'])) {
    foreach ($new_keys['unique keys'] as $name => $fields) {
      $this->addUniqueKey($table, $name, $fields);
    }
  }
  if (isset($new_keys['indexes'])) {
    foreach ($new_keys['indexes'] as $name => $fields) {
      $this->addIndex($table, $name, $fields);
    }
  }
}