diff --git a/app/src/Lib/Util/SchemaManager.php b/app/src/Lib/Util/SchemaManager.php index 888b560f1..eb333a47b 100644 --- a/app/src/Lib/Util/SchemaManager.php +++ b/app/src/Lib/Util/SchemaManager.php @@ -62,6 +62,9 @@ class SchemaManager { // The column library from the main config protected $columnLibrary = null; + // The current platform + protected $platform = null; + /** * Construct a new SchemaManager. * @@ -98,6 +101,7 @@ public function __construct(?ConsoleIo $io=null, string $connection='default') { $this->conn = DriverManager::getConnection($cfargs, $config); $this->driver = $cfg['driver']; + $this->platform = $this->conn->getDatabasePlatform(); } /** @@ -358,8 +362,7 @@ protected function processSchema( // schema file). $comparator = new Comparator(); $schemaDiff = $comparator->compareSchemas($curSchema, $schema); - - $diffSql = $schemaDiff->toSaveSql($this->conn->getDatabasePlatform()); + $diffSql = $this->platform->getAlterSchemaSQL($schemaDiff); // We don't start a transaction since in general we always want to move to // the desired state, and if we fail in flight it's probably a bug that