Unverified Commit 0d1783be authored by Alex Pott's avatar Alex Pott
Browse files

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

(cherry picked from commit affdb3e7)
parent 4398dc5a
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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.
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.
if ($connection->databaseType() === 'mysql') {
  $connection->query("SET sql_mode = '$sql_mode'");
}
ENDOFSCRIPT;
    return $script;
  }