function system_update_8003

Change the index on the {router} table.

File

core/modules/system/system.install, line 1634

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',
            ],
        ],
    ]);
}

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