Issue #3265802 by daffie, alexpott: user_update_9301() causes data loss and a broken site on SQL Server

merge-requests/1523/head
catch 2022-02-22 12:53:10 +00:00
parent 9d5f1c16c8
commit d185ea19dc
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,10 @@ function user_update_9301(&$sandbox) {
}
$connection = \Drupal::database();
if ($connection->databaseType() === 'sqlsrv') {
return t('The Microsoft SQL Server does not support user_update_9301() because it causes data loss.');
}
$connection->schema()->dropPrimaryKey('users');
if ($connection->databaseType() === 'mysql') {
$sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField();