function system_update_8003 in Drupal 8
Change the index on the {router} table.
File
- core/
modules/ system/ system.install, line 1634 - Install, update and uninstall functions for the system module.
Code
function system_update_8003() {
$database = \Drupal::database();
$database
->schema()
->dropIndex('router', 'pattern_outline_fit');
$database
->schema()
->addIndex('router', 'pattern_outline_parts', [
'pattern_outline',
'number_parts',
], [
'fields' => [
'pattern_outline' => [
'description' => 'The pattern',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
],
'number_parts' => [
'description' => 'Number of parts in this router path.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small',
],
],
]);
}