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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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.