Identify platforms by their class

This commit is contained in:
Yassine Guedidi
2023-08-05 18:35:09 +01:00
parent c2bfc0f359
commit f48f982025
23 changed files with 185 additions and 100 deletions

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -25,7 +26,7 @@ class Version20170501115751 extends WallabagMigration
$table->setPrimaryKey(['id']);
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$schema->dropSequence('site_credential_id_seq');
$schema->createSequence('site_credential_id_seq');
}