protected function Schema::_createKeys

2 calls to Schema::_createKeys()
Schema::addField in drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
Add a new field to a table.
Schema::changeField in drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
Change a field definition.

File

drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php, line 612
Definition of Drupal\Core\Database\Driver\pgsql\Schema

Class

Schema

Namespace

Drupal\Core\Database\Driver\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);
    }
  }
}