diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2021-01-11 18:07:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 18:07:11 +0100 |
commit | 7cdc7adf59a053407f06ccf3a3d0d94e667c833b (patch) | |
tree | 424873b7658a036eccbc960e10d66633cea613dc /lib | |
parent | fdd111924fc38aebd23ca2db9ecebfc4480eb026 (diff) | |
parent | 2d34ca4143f6ddeb2e0be8d6bca99469a5d08792 (diff) | |
download | nextcloud-server-7cdc7adf59a053407f06ccf3a3d0d94e667c833b.tar.gz nextcloud-server-7cdc7adf59a053407f06ccf3a3d0d94e667c833b.zip |
Merge pull request #25038 from nextcloud/bugfix/noid/install-mysql8-with-php8
Don't try a transaction for the migrator on MySQL
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/Migrator.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php index f62735ea6b2..e50927f620b 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -32,6 +32,7 @@ namespace OC\DB; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\AbstractAsset; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Index; @@ -238,14 +239,18 @@ class Migrator { $schemaDiff = $this->getDiff($targetSchema, $connection); - $connection->beginTransaction(); + if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) { + $connection->beginTransaction(); + } $sqls = $schemaDiff->toSql($connection->getDatabasePlatform()); $step = 0; foreach ($sqls as $sql) { $this->emit($sql, $step++, count($sqls)); $connection->query($sql); } - $connection->commit(); + if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) { + $connection->commit(); + } } /** |