public function SchemaDatabaseSchema_mysql::recreatePrimaryKey in Schema 8
Overrides DatabaseSchemaInspectionInterface::recreatePrimaryKey
File
- src/
SchemaDatabaseSchema_mysql.php, line 57 - Schema module enhancements to DatabaseSchema_mysql
Class
Namespace
Drupal\schemaCode
public function recreatePrimaryKey($table_name, $primary_key) {
$sql = 'ALTER TABLE {' . $table_name . '} DROP PRIMARY KEY, ADD PRIMARY KEY (' . $this
->createKeySql($primary_key) . ')';
$this->connection
->query($sql)
->execute();
}