protected Schema::createKeysSql($spec)
File
- core/lib/Drupal/Core/Database/Driver/mysql/Schema.php, line 272
Class
- Schema
- MySQL implementation of \Drupal\Core\Database\Schema.
Namespace
Drupal\Core\Database\Driver\mysql
Code
protected function createKeysSql($spec) { $keys = array(); if (!empty($spec['primary key'])) { $keys[] = 'PRIMARY KEY (' . $this->createKeySql($spec['primary key']) . ')'; } if (!empty($spec['unique keys'])) { foreach ($spec['unique keys'] as $key => $fields) { $keys[] = 'UNIQUE KEY `' . $key . '` (' . $this->createKeySql($fields) . ')'; } } if (!empty($spec['indexes'])) { $indexes = $this->getNormalizedIndexes($spec); foreach ($indexes as $index => $fields) { $keys[] = 'INDEX `' . $index . '` (' . $this->createKeySql($fields) . ')'; } } return $keys; }
Please login to continue.