diff options
author | Joas Schilling <coding@schilljs.com> | 2021-01-11 16:10:16 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-01-11 16:11:02 +0100 |
commit | 2d34ca4143f6ddeb2e0be8d6bca99469a5d08792 (patch) | |
tree | adfe5fd0e89e9f83e24d2264193612bfaaec92cb /tests | |
parent | 3cdfe7b0f40a52b39f128a86f00ed5c04398693b (diff) | |
download | nextcloud-server-2d34ca4143f6ddeb2e0be8d6bca99469a5d08792.tar.gz nextcloud-server-2d34ca4143f6ddeb2e0be8d6bca99469a5d08792.zip |
Only rollback when not MySQL
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/DB/MigratorTest.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php index 539eb404bbf..6f3ebbb2b0c 100644 --- a/tests/lib/DB/MigratorTest.php +++ b/tests/lib/DB/MigratorTest.php @@ -10,7 +10,9 @@ namespace Test\DB; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Platforms\OraclePlatform; +use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaConfig; use OC\DB\SchemaWrapper; @@ -122,7 +124,11 @@ class MigratorTest extends \Test\TestCase { } private function isSQLite() { - return $this->connection->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver; + return $this->connection->getDatabasePlatform() instanceof SqlitePlatform; + } + + private function isMySQL() { + return $this->connection->getDatabasePlatform() instanceof MySQLPlatform; } @@ -143,7 +149,9 @@ class MigratorTest extends \Test\TestCase { try { $migrator->migrate($endSchema); } catch (Exception\UniqueConstraintViolationException $e) { - $this->connection->rollBack(); + if (!$this->isMySQL()) { + $this->connection->rollBack(); + } throw $e; } } |