Skip to content
Snippets Groups Projects
Unverified Commit affdb3e7 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3261629 by catch: Database dumps are no longer driver-agnostic

parent cde1d175
No related branches found
No related tags found
Loading
This commit is part of merge request !2074. Comments created here will be created in the context of that merge request.
......@@ -415,13 +415,17 @@ protected function getTemplate() {
$connection = Database::getConnection();
// Ensure any tables with a serial column with a value of 0 are created as
// expected.
$sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField();
$connection->query("SET sql_mode = '$sql_mode,NO_AUTO_VALUE_ON_ZERO'");
if ($connection->databaseType() === 'mysql') {
$sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField();
$connection->query("SET sql_mode = '$sql_mode,NO_AUTO_VALUE_ON_ZERO'");
}
{{TABLES}}
// Reset the SQL mode.
$connection->query("SET sql_mode = '$sql_mode'");
if ($connection->databaseType() === 'mysql') {
$connection->query("SET sql_mode = '$sql_mode'");
}
ENDOFSCRIPT;
return $script;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment