diff --git a/config/autoload/entity-manager.local.php.dist b/config/autoload/entity-manager.local.php.dist index 0624aa51..ef5cabf8 100644 --- a/config/autoload/entity-manager.local.php.dist +++ b/config/autoload/entity-manager.local.php.dist @@ -11,6 +11,7 @@ return [ 'driver' => 'pdo_mysql', 'host' => 'shlink_db_mysql', 'dbname' => 'shlink', + 'charset' => 'utf8', ], ], diff --git a/data/migrations/Version20160819142757.php b/data/migrations/Version20160819142757.php index 70831eb9..6db246a6 100644 --- a/data/migrations/Version20160819142757.php +++ b/data/migrations/Version20160819142757.php @@ -5,45 +5,43 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; +use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\Migrations\AbstractMigration; +use function get_class; + /** * Auto-generated Migration: Please modify to your needs! */ class Version20160819142757 extends AbstractMigration { - private const MYSQL = 'mysql'; - private const SQLITE = 'sqlite'; - /** * @throws Exception * @throws SchemaException */ public function up(Schema $schema): void { - $db = $this->connection->getDatabasePlatform()->getName(); + $platformClass = get_class($this->connection->getDatabasePlatform()); $table = $schema->getTable('short_urls'); $column = $table->getColumn('short_code'); - if ($db === self::MYSQL) { - $column->setPlatformOption('collation', 'utf8_bin'); - } elseif ($db === self::SQLITE) { - $column->setPlatformOption('collate', 'BINARY'); - } + match ($platformClass) { + MySQLPlatform::class => $column->setPlatformOption('collation', 'utf8_bin'), + SqlitePlatform::class => $column->setPlatformOption('collate', 'BINARY'), + default => null, + }; } - /** - * @throws Exception - */ public function down(Schema $schema): void { - $this->connection->getDatabasePlatform()->getName(); + // Nothing to roll back } public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20160820191203.php b/data/migrations/Version20160820191203.php index 592e556e..dea327b1 100644 --- a/data/migrations/Version20160820191203.php +++ b/data/migrations/Version20160820191203.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -76,6 +77,6 @@ class Version20160820191203 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20171021093246.php b/data/migrations/Version20171021093246.php index 92c078fa..a810f49c 100644 --- a/data/migrations/Version20171021093246.php +++ b/data/migrations/Version20171021093246.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Types\Types; @@ -48,6 +49,6 @@ class Version20171021093246 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20171022064541.php b/data/migrations/Version20171022064541.php index 88b5f468..fb5f8d7a 100644 --- a/data/migrations/Version20171022064541.php +++ b/data/migrations/Version20171022064541.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Types\Types; @@ -45,6 +46,6 @@ class Version20171022064541 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20180801183328.php b/data/migrations/Version20180801183328.php index 14f2b22c..5fd40030 100644 --- a/data/migrations/Version20180801183328.php +++ b/data/migrations/Version20180801183328.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\Migrations\AbstractMigration; @@ -42,6 +43,6 @@ final class Version20180801183328 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20180913205455.php b/data/migrations/Version20180913205455.php index 23d51d79..fe04a395 100644 --- a/data/migrations/Version20180913205455.php +++ b/data/migrations/Version20180913205455.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; use PDO; @@ -69,6 +70,6 @@ final class Version20180913205455 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20180915110857.php b/data/migrations/Version20180915110857.php index 8b83053b..b31ac105 100644 --- a/data/migrations/Version20180915110857.php +++ b/data/migrations/Version20180915110857.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\Migrations\AbstractMigration; @@ -50,6 +51,6 @@ final class Version20180915110857 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20181020060559.php b/data/migrations/Version20181020060559.php index 85d2c9ba..908bf304 100644 --- a/data/migrations/Version20181020060559.php +++ b/data/migrations/Version20181020060559.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; @@ -58,7 +59,7 @@ final class Version20181020060559 extends AbstractMigration foreach (self::COLUMNS as $camelCaseName => $snakeCaseName) { $qb->set($snakeCaseName, $camelCaseName); } - $qb->execute(); + $qb->executeStatement(); } public function down(Schema $schema): void @@ -68,6 +69,6 @@ final class Version20181020060559 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20181020065148.php b/data/migrations/Version20181020065148.php index e7b3cf5f..873e7f11 100644 --- a/data/migrations/Version20181020065148.php +++ b/data/migrations/Version20181020065148.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\Migrations\AbstractMigration; @@ -41,6 +42,6 @@ final class Version20181020065148 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20181110175521.php b/data/migrations/Version20181110175521.php index 6e26837e..9fb989fa 100644 --- a/data/migrations/Version20181110175521.php +++ b/data/migrations/Version20181110175521.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; @@ -37,6 +38,6 @@ final class Version20181110175521 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20190824075137.php b/data/migrations/Version20190824075137.php index 0681e6fe..663111ff 100644 --- a/data/migrations/Version20190824075137.php +++ b/data/migrations/Version20190824075137.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; @@ -37,6 +38,6 @@ final class Version20190824075137 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20190930165521.php b/data/migrations/Version20190930165521.php index 5699863c..97863843 100644 --- a/data/migrations/Version20190930165521.php +++ b/data/migrations/Version20190930165521.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Types\Types; @@ -55,6 +56,6 @@ final class Version20190930165521 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20191001201532.php b/data/migrations/Version20191001201532.php index 20de0486..fa13b85d 100644 --- a/data/migrations/Version20191001201532.php +++ b/data/migrations/Version20191001201532.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; @@ -49,6 +50,6 @@ final class Version20191001201532 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20191020074522.php b/data/migrations/Version20191020074522.php index b225f733..c1b9aea9 100644 --- a/data/migrations/Version20191020074522.php +++ b/data/migrations/Version20191020074522.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; @@ -37,6 +38,6 @@ final class Version20191020074522 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20200105165647.php b/data/migrations/Version20200105165647.php index ed68850a..fb3b7961 100644 --- a/data/migrations/Version20200105165647.php +++ b/data/migrations/Version20200105165647.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -38,7 +40,7 @@ final class Version20200105165647 extends AbstractMigration 'zeroValue' => '0', 'emptyString' => '', ]) - ->execute(); + ->executeStatement(); } } @@ -61,14 +63,14 @@ final class Version20200105165647 extends AbstractMigration */ public function postUp(Schema $schema): void { - $platformName = $this->connection->getDatabasePlatform()->getName(); - $castType = $platformName === 'postgres' ? 'DOUBLE PRECISION' : 'DECIMAL(9,2)'; + $isPostgres = $this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform; + $castType = $isPostgres ? 'DOUBLE PRECISION' : 'DECIMAL(9,2)'; foreach (self::COLUMNS as $newName => $oldName) { $qb = $this->connection->createQueryBuilder(); $qb->update('visit_locations') ->set($newName, 'CAST(' . $oldName . ' AS ' . $castType . ')') - ->execute(); + ->executeStatement(); } } @@ -78,7 +80,7 @@ final class Version20200105165647 extends AbstractMigration $qb = $this->connection->createQueryBuilder(); $qb->update('visit_locations') ->set($oldName, $newName) - ->execute(); + ->executeStatement(); } } @@ -96,6 +98,6 @@ final class Version20200105165647 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20200106215144.php b/data/migrations/Version20200106215144.php index 0b760ced..830daf64 100644 --- a/data/migrations/Version20200106215144.php +++ b/data/migrations/Version20200106215144.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -47,6 +48,6 @@ final class Version20200106215144 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20200110182849.php b/data/migrations/Version20200110182849.php index 6c66788e..b267bfbc 100644 --- a/data/migrations/Version20200110182849.php +++ b/data/migrations/Version20200110182849.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -36,6 +38,9 @@ final class Version20200110182849 extends AbstractMigration ); } + /** + * @throws Exception + */ public function setDefaultValueForColumnInTable(string $tableName, string $columnName): void { $qb = $this->connection->createQueryBuilder(); @@ -43,7 +48,7 @@ final class Version20200110182849 extends AbstractMigration ->set($columnName, ':emptyValue') ->setParameter('emptyValue', self::DEFAULT_EMPTY_VALUE) ->where($qb->expr()->isNull($columnName)) - ->execute(); + ->executeStatement(); } public function down(Schema $schema): void @@ -53,6 +58,6 @@ final class Version20200110182849 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20200323190014.php b/data/migrations/Version20200323190014.php index 92abb87c..f76df5e7 100644 --- a/data/migrations/Version20200323190014.php +++ b/data/migrations/Version20200323190014.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -32,7 +33,7 @@ final class Version20200323190014 extends AbstractMigration ->andWhere($qb->expr()->eq('lon', 0)) ->setParameter('isEmpty', true) ->setParameter('emptyString', '') - ->execute(); + ->executeStatement(); } public function down(Schema $schema): void @@ -45,6 +46,6 @@ final class Version20200323190014 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20200503170404.php b/data/migrations/Version20200503170404.php index 418cbea3..ad2c63df 100644 --- a/data/migrations/Version20200503170404.php +++ b/data/migrations/Version20200503170404.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -27,6 +28,6 @@ final class Version20200503170404 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20201023090929.php b/data/migrations/Version20201023090929.php index 0a36f06a..4655cbd5 100644 --- a/data/migrations/Version20201023090929.php +++ b/data/migrations/Version20201023090929.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -44,6 +45,6 @@ final class Version20201023090929 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20201102113208.php b/data/migrations/Version20201102113208.php index 79cec197..92647c7f 100644 --- a/data/migrations/Version20201102113208.php +++ b/data/migrations/Version20201102113208.php @@ -6,6 +6,7 @@ namespace ShlinkMigrations; use Cake\Chronos\Chronos; use Doctrine\DBAL\Driver\Result; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -86,6 +87,6 @@ final class Version20201102113208 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210102174433.php b/data/migrations/Version20210102174433.php index 60ce36cf..58ea36cd 100644 --- a/data/migrations/Version20210102174433.php +++ b/data/migrations/Version20210102174433.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -52,6 +53,6 @@ final class Version20210102174433 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210118153932.php b/data/migrations/Version20210118153932.php index d81c4857..476f8d84 100644 --- a/data/migrations/Version20210118153932.php +++ b/data/migrations/Version20210118153932.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -26,6 +27,6 @@ final class Version20210118153932 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210202181026.php b/data/migrations/Version20210202181026.php index 4ecfa8de..7a63b814 100644 --- a/data/migrations/Version20210202181026.php +++ b/data/migrations/Version20210202181026.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -36,6 +37,6 @@ final class Version20210202181026 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210207100807.php b/data/migrations/Version20210207100807.php index 6d9e9822..706132cc 100644 --- a/data/migrations/Version20210207100807.php +++ b/data/migrations/Version20210207100807.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -43,6 +44,6 @@ final class Version20210207100807 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210306165711.php b/data/migrations/Version20210306165711.php index cb69741f..ba1a4476 100644 --- a/data/migrations/Version20210306165711.php +++ b/data/migrations/Version20210306165711.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -37,6 +38,6 @@ final class Version20210306165711 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210522051601.php b/data/migrations/Version20210522051601.php index 70e0fb34..279c7a7e 100644 --- a/data/migrations/Version20210522051601.php +++ b/data/migrations/Version20210522051601.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -26,6 +27,6 @@ final class Version20210522051601 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210522124633.php b/data/migrations/Version20210522124633.php index f56b8a92..921e0831 100644 --- a/data/migrations/Version20210522124633.php +++ b/data/migrations/Version20210522124633.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -28,6 +29,6 @@ final class Version20210522124633 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20210720143824.php b/data/migrations/Version20210720143824.php index 09e97cfa..407c5c79 100644 --- a/data/migrations/Version20210720143824.php +++ b/data/migrations/Version20210720143824.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; @@ -41,6 +42,6 @@ final class Version20210720143824 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } } diff --git a/data/migrations/Version20211002072605.php b/data/migrations/Version20211002072605.php index 03c98885..970d51d6 100644 --- a/data/migrations/Version20211002072605.php +++ b/data/migrations/Version20211002072605.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkMigrations; +use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; @@ -26,6 +27,6 @@ final class Version20211002072605 extends AbstractMigration public function isTransactional(): bool { - return $this->connection->getDatabasePlatform()->getName() !== 'mysql'; + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } }