Skip to content
Snippets Groups Projects

Resolve #3370560 "Update failed dblogupdate10101"

1 unresolved thread
@@ -5,8 +5,6 @@
* Install, update and uninstall functions for the dblog module.
*/
use Drupal\Core\Database\Database;
/**
* Implements hook_schema().
*/
@@ -123,15 +121,15 @@ function dblog_update_10100(&$sandbox = NULL) {
* Converts the 'wid' of the 'watchdog' table to a big integer.
*/
function dblog_update_10101(&$sandbox = NULL) {
$schema = Database::getConnection()->schema();
// Increase the size of the field.
$new_specification = [
'size' => 'big',
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique watchdog event ID.',
];
$schema->changeField('watchdog', 'wid', 'wid', $new_specification);
$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);
}
}
Loading