function Schema::_createKeySql

Creates the SQL key for the given fields.

1 call to Schema::_createKeySql()
Schema::_createIndexSql in core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
Creates a statement for an SQL index for the given fields.

File

core/modules/pgsql/src/Driver/Database/pgsql/Schema.php, line 478

Class

Schema
PostgreSQL implementation of \Drupal\Core\Database\Schema.

Namespace

Drupal\pgsql\Driver\Database\pgsql

Code

protected function _createKeySql($fields) {
  $return = [];
  foreach ($fields as $field) {
    if (is_array($field)) {
      $return[] = 'substr(' . $field[0] . ', 1, ' . $field[1] . ')';
    }
    else {
      $return[] = '"' . $field . '"';
    }
  }
  return implode(', ', $return);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.