From c079cc914e3a7a9cee9669ec9f2df54eee7f94c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 17 Jul 2022 23:45:17 +0200 Subject: [PATCH] Use platforms to decide which migrations to use, instead of drivers Dev environment uses an delegated dev driver, which is not possible to compare. Should fix current phpunit test error. --- src/Migration/AbstractMultiPlatformMigration.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Migration/AbstractMultiPlatformMigration.php b/src/Migration/AbstractMultiPlatformMigration.php index ea5379ac..7c7fdb68 100644 --- a/src/Migration/AbstractMultiPlatformMigration.php +++ b/src/Migration/AbstractMultiPlatformMigration.php @@ -8,6 +8,9 @@ use Doctrine\DBAL\Driver\AbstractMySQLDriver; use Doctrine\DBAL\Driver\AbstractSQLiteDriver; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; +use Doctrine\DBAL\Platforms\MariaDBPlatform; +use Doctrine\DBAL\Platforms\MySQLPlatform; +use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; use Psr\Log\LoggerInterface; @@ -124,11 +127,11 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration */ public function getDatabaseType(): ?string { - if ($this->connection->getDriver() instanceof AbstractMySQLDriver) { + if ($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) { return 'mysql'; } - if ($this->connection->getDriver() instanceof AbstractSQLiteDriver) { + if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) { return 'sqlite'; }