function dblog_update_10101

Converts the 'wid' of the 'watchdog' table to a big integer.

File

core/modules/dblog/dblog.install, line 123

Code

function dblog_update_10101(&$sandbox = NULL) {
    $connection = \Drupal::database();
    if ($connection->databaseType() != 'sqlite') {
        // Increase the size of the field.
        $new_specification = [
            'size' => 'big',
            'type' => 'serial',
            'not null' => TRUE,
            'description' => 'Primary Key: Unique watchdog event ID.',
        ];
        $connection->schema()
            ->changeField('watchdog', 'wid', 'wid', $new_specification);
    }
}

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