diff --git a/Neos.Media/Migrations/Mysql/Version20110925123120.php b/Neos.Media/Migrations/Mysql/Version20110925123120.php index 712af63ad0f..eb92a3eea2c 100644 --- a/Neos.Media/Migrations/Mysql/Version20110925123120.php +++ b/Neos.Media/Migrations/Mysql/Version20110925123120.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, type INT DEFAULT NULL, imagevariants LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_7FA2358DBC91F416 (resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -31,9 +32,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_media_domain_model_image"); } diff --git a/Neos.Media/Migrations/Mysql/Version20120329220344.php b/Neos.Media/Migrations/Mysql/Version20120329220344.php index 01383d3b8aa..6b71db2a87b 100644 --- a/Neos.Media/Migrations/Mysql/Version20120329220344.php +++ b/Neos.Media/Migrations/Mysql/Version20120329220344.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE title title VARCHAR(255) NOT NULL, CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL, CHANGE type type INT NOT NULL, CHANGE imagevariants imagevariants LONGTEXT NOT NULL COMMENT '(DC2Type:array)'"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE title title VARCHAR(255) DEFAULT NULL, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL, CHANGE type type INT DEFAULT NULL, CHANGE imagevariants imagevariants LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)'"); } diff --git a/Neos.Media/Migrations/Mysql/Version20121001181137.php b/Neos.Media/Migrations/Mysql/Version20121001181137.php index dcf473d7185..8c375209012 100644 --- a/Neos.Media/Migrations/Mysql/Version20121001181137.php +++ b/Neos.Media/Migrations/Mysql/Version20121001181137.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'flow3_persistence_identifier', 'persistence_object_identifier'); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'persistence_object_identifier', 'flow3_persistence_identifier'); diff --git a/Neos.Media/Migrations/Mysql/Version20121011140946.php b/Neos.Media/Migrations/Mysql/Version20121011140946.php index 83c118ed0cc..958f8f63288 100644 --- a/Neos.Media/Migrations/Mysql/Version20121011140946.php +++ b/Neos.Media/Migrations/Mysql/Version20121011140946.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:31:\"\0*\0FLOW3_Persistence_Identifier\";', 's:32:\"\0*\0Persistence_Object_Identifier\";') WHERE imagevariants LIKE '%s:31:\"\0*\0FLOW3_Persistence_Identifier\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:33:\"FLOW3_Persistence_RelatedEntities\";', 's:32:\"Flow_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:33:\"FLOW3_Persistence_RelatedEntities\";%'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:28:\"TYPO3\\\\Flow\\\\Resource\\\\Resource\";', 's:29:\"TYPO3\\\\FLOW3\\\\Resource\\\\Resource\";') WHERE imagevariants LIKE '%s:28:\"TYPO3\\\\\\\\Flow\\\\\\\\Resource\\\\\\\\Resource\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:32:\"Flow_Persistence_RelatedEntities\";', 's:33:\"FLOW3_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:32:\"Flow_Persistence_RelatedEntities\";%'"); diff --git a/Neos.Media/Migrations/Mysql/Version20130522131641.php b/Neos.Media/Migrations/Mysql/Version20130522131641.php index ca3df92b152..a4f9829b3c3 100644 --- a/Neos.Media/Migrations/Mysql/Version20130522131641.php +++ b/Neos.Media/Migrations/Mysql/Version20130522131641.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // new tables for Asset, Document, Video, Audio $this->addSql("CREATE TABLE typo3_media_domain_model_asset (persistence_object_identifier VARCHAR(40) NOT NULL, dtype VARCHAR(255) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_B8306B8EBC91F416 (resource), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -42,9 +43,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // adjust Image table $this->addSql("ALTER TABLE typo3_media_domain_model_image DROP FOREIGN KEY FK_7FA2358D47A46B0A"); diff --git a/Neos.Media/Migrations/Mysql/Version20130522132835.php b/Neos.Media/Migrations/Mysql/Version20130522132835.php index b9f8f4ae27c..7160bdd8b71 100644 --- a/Neos.Media/Migrations/Mysql/Version20130522132835.php +++ b/Neos.Media/Migrations/Mysql/Version20130522132835.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_asset_tags_join (media_asset VARCHAR(40) NOT NULL, media_tag VARCHAR(40) NOT NULL, INDEX IDX_DAF7A1EB1DB69EED (media_asset), INDEX IDX_DAF7A1EB48D8C57E (media_tag), PRIMARY KEY(media_asset, media_tag)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_tag (persistence_object_identifier VARCHAR(40) NOT NULL, `label` VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP FOREIGN KEY FK_DAF7A1EB48D8C57E"); $this->addSql("DROP TABLE typo3_media_domain_model_asset_tags_join"); diff --git a/Neos.Media/Migrations/Mysql/Version20130605174712.php b/Neos.Media/Migrations/Mysql/Version20130605174712.php index 9440c3d7853..84be1513584 100644 --- a/Neos.Media/Migrations/Mysql/Version20130605174712.php +++ b/Neos.Media/Migrations/Mysql/Version20130605174712.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD caption LONGTEXT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD lastmodified DATETIME NOT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP lastmodified"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP caption"); diff --git a/Neos.Media/Migrations/Mysql/Version20141118172322.php b/Neos.Media/Migrations/Mysql/Version20141118172322.php index 9213cf1a02e..c2f5be91af0 100644 --- a/Neos.Media/Migrations/Mysql/Version20141118172322.php +++ b/Neos.Media/Migrations/Mysql/Version20141118172322.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_adjustment_abstractimageadjustment (persistence_object_identifier VARCHAR(40) NOT NULL, imagevariant VARCHAR(40) DEFAULT NULL, dtype VARCHAR(255) NOT NULL, x INT DEFAULT NULL, y INT DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, maximumwidth INT DEFAULT NULL, maximumheight INT DEFAULT NULL, minimumwidth INT DEFAULT NULL, minimumheight INT DEFAULT NULL, ratiomode VARCHAR(255) DEFAULT NULL, INDEX IDX_84416FDCA76D06E6 (imagevariant), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_imagevariant (persistence_object_identifier VARCHAR(40) NOT NULL, originalasset VARCHAR(40) NOT NULL, name VARCHAR(255) NOT NULL, width INT NOT NULL, height INT NOT NULL, INDEX IDX_758EDEBD55FF4171 (originalasset), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -33,9 +34,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP FOREIGN KEY FK_84416FDCA76D06E6"); $this->addSql("DROP TABLE typo3_media_domain_model_adjustment_abstractimageadjustment"); diff --git a/Neos.Media/Migrations/Mysql/Version20150228154201.php b/Neos.Media/Migrations/Mysql/Version20150228154201.php index b7e8b0801db..56c766c2e97 100644 --- a/Neos.Media/Migrations/Mysql/Version20150228154201.php +++ b/Neos.Media/Migrations/Mysql/Version20150228154201.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD position INT NOT NULL"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 10 WHERE dtype = 'typo3_media_adjustment_cropimageadjustment'"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 20 WHERE dtype = 'typo3_media_adjustment_resizeimageadjustment'"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP position"); } diff --git a/Neos.Media/Migrations/Mysql/Version20150324185018.php b/Neos.Media/Migrations/Mysql/Version20150324185018.php index 83369915c0c..a5088e4bca5 100644 --- a/Neos.Media/Migrations/Mysql/Version20150324185018.php +++ b/Neos.Media/Migrations/Mysql/Version20150324185018.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD allowupscaling TINYINT(1) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD allowupscaling TINYINT(1) DEFAULT NULL"); } @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP allowupscaling"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP allowupscaling"); } diff --git a/Neos.Media/Migrations/Mysql/Version20150507204450.php b/Neos.Media/Migrations/Mysql/Version20150507204450.php index b975803d371..026ddca4cae 100644 --- a/Neos.Media/Migrations/Mysql/Version20150507204450.php +++ b/Neos.Media/Migrations/Mysql/Version20150507204450.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection (persistence_object_identifier VARCHAR(40) NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection_assets_join (media_assetcollection VARCHAR(40) NOT NULL, media_asset VARCHAR(40) NOT NULL, INDEX IDX_E90D72512A965871 (media_assetcollection), INDEX IDX_E90D72511DB69EED (media_asset), PRIMARY KEY(media_assetcollection, media_asset)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -30,9 +31,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_assets_join DROP FOREIGN KEY FK_E90D72512A965871"); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_tags_join DROP FOREIGN KEY FK_A41705672A965871"); diff --git a/Neos.Media/Migrations/Mysql/Version20150701113246.php b/Neos.Media/Migrations/Mysql/Version20150701113246.php index a9ebb6c5230..fca41397b05 100644 --- a/Neos.Media/Migrations/Mysql/Version20150701113246.php +++ b/Neos.Media/Migrations/Mysql/Version20150701113246.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL"); diff --git a/Neos.Media/Migrations/Mysql/Version20150913173832.php b/Neos.Media/Migrations/Mysql/Version20150913173832.php index 919a8bbfeb1..41aa88f4936 100644 --- a/Neos.Media/Migrations/Mysql/Version20150913173832.php +++ b/Neos.Media/Migrations/Mysql/Version20150913173832.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD configuration LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)', ADD configurationhash VARCHAR(32) NOT NULL"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configurationArray = array_filter([ 'maximumWidth' => $thumbnailInfo['maximumwidth'], 'maximumHeight' => $thumbnailInfo['maximumheight'], @@ -43,14 +45,14 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD maximumwidth INT DEFAULT NULL, ADD maximumheight INT DEFAULT NULL, ADD ratiomode VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, ADD allowupscaling TINYINT(1) DEFAULT NULL"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configuration = json_decode($thumbnailInfo['configuration'], true); $maximumWidth = isset($configuration['maximumWidth']) ? (integer)$configuration['maximumWidth'] : null; $maximumWidth = $maximumWidth === 0 ? null : $maximumWidth; @@ -59,7 +61,7 @@ public function down(Schema $schema): void $ratioMode = isset($configuration['ratioMode']) ? $configuration['ratioMode'] : null; $allowUpScaling = isset($configuration['allowUpScaling']) ? $configuration['allowUpScaling'] : null; $allowUpScaling = $allowUpScaling ? 1 : 0; - $types = [\PDO::PARAM_NULL]; + $types = [PDO::PARAM_NULL]; $this->addSql("UPDATE typo3_media_domain_model_thumbnail SET maximumwidth = ?, maximumheight = ?, ratiomode = ?, allowupscaling = ? WHERE persistence_object_identifier = ?", [$maximumWidth, $maximumHeight, $ratioMode, $allowUpScaling, $thumbnailInfo['persistence_object_identifier']], $types); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216052338.php b/Neos.Media/Migrations/Mysql/Version20151216052338.php index fffcee191df..15ea6ea51fa 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216052338.php +++ b/Neos.Media/Migrations/Mysql/Version20151216052338.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE resource resource VARCHAR(40) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE resource resource VARCHAR(40) NOT NULL COLLATE utf8mb4_unicode_ci"); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216143756.php b/Neos.Media/Migrations/Mysql/Version20151216143756.php index b7dce1c37b2..9a4852bf6b9 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216143756.php +++ b/Neos.Media/Migrations/Mysql/Version20151216143756.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD staticresource VARCHAR(255) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP staticresource"); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216144408.php b/Neos.Media/Migrations/Mysql/Version20151216144408.php index bdad35fbb01..75e5cfb9a90 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216144408.php +++ b/Neos.Media/Migrations/Mysql/Version20151216144408.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_media_domain_model_thumbnail"); $this->addSql("DROP INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail"); $this->addSql("CREATE INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail (originalasset, configurationhash)"); diff --git a/Neos.Media/Migrations/Mysql/Version20160223165602.php b/Neos.Media/Migrations/Mysql/Version20160223165602.php index cdefb4f6cee..67b485c8c5b 100644 --- a/Neos.Media/Migrations/Mysql/Version20160223165602.php +++ b/Neos.Media/Migrations/Mysql/Version20160223165602.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE configuration configuration LONGTEXT NOT NULL COMMENT '(DC2Type:flow_json_array)'"); } @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE configuration configuration LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)'"); } diff --git a/Neos.Media/Migrations/Mysql/Version20161125093810.php b/Neos.Media/Migrations/Mysql/Version20161125093810.php index 879b989bd95..5ce2420aea1 100644 --- a/Neos.Media/Migrations/Mysql/Version20161125093810.php +++ b/Neos.Media/Migrations/Mysql/Version20161125093810.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE typo3_media_domain_model_adjustment_abstractimageadjustment TO neos_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('RENAME TABLE typo3_media_domain_model_asset TO neos_media_domain_model_asset'); @@ -36,9 +37,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE neos_media_domain_model_adjustment_abstractimageadjustment TO typo3_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('RENAME TABLE neos_media_domain_model_asset TO typo3_media_domain_model_asset'); diff --git a/Neos.Media/Migrations/Mysql/Version20161125172223.php b/Neos.Media/Migrations/Mysql/Version20161125172223.php index 42adbb65601..2f8e6b95b60 100644 --- a/Neos.Media/Migrations/Mysql/Version20161125172223.php +++ b/Neos.Media/Migrations/Mysql/Version20161125172223.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); diff --git a/Neos.Media/Migrations/Mysql/Version20170110130217.php b/Neos.Media/Migrations/Mysql/Version20170110130217.php index 24d94d8c6af..49efc3e9388 100644 --- a/Neos.Media/Migrations/Mysql/Version20170110130217.php +++ b/Neos.Media/Migrations/Mysql/Version20170110130217.php @@ -1,9 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { @@ -92,9 +93,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { diff --git a/Neos.Media/Migrations/Mysql/Version20170220155800.php b/Neos.Media/Migrations/Mysql/Version20170220155800.php index 7195d606e0f..43462e7dd4b 100644 --- a/Neos.Media/Migrations/Mysql/Version20170220155800.php +++ b/Neos.Media/Migrations/Mysql/Version20170220155800.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD quality INT DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail ADD quality INT DEFAULT NULL'); } @@ -32,9 +33,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP quality'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail DROP quality'); } diff --git a/Neos.Media/Migrations/Mysql/Version20180405104603.php b/Neos.Media/Migrations/Mysql/Version20180405104603.php index 2efeaae2d88..4e4844d5526 100644 --- a/Neos.Media/Migrations/Mysql/Version20180405104603.php +++ b/Neos.Media/Migrations/Mysql/Version20180405104603.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE TABLE neos_media_domain_model_importedasset (persistence_object_identifier VARCHAR(40) NOT NULL, assetsourceidentifier VARCHAR(255) NOT NULL, remoteassetidentifier VARCHAR(255) NOT NULL, localassetidentifier VARCHAR(255) NOT NULL, localoriginalassetidentifier VARCHAR(255) DEFAULT NULL, importedat DATETIME NOT NULL, UNIQUE INDEX flow_identity_neos_media_domain_model_importedasset (assetsourceidentifier, remoteassetidentifier, localassetidentifier), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD assetsourceidentifier VARCHAR(255) DEFAULT \'neos\''); @@ -34,11 +36,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP TABLE neos_media_domain_model_importedasset'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP assetsourceidentifier'); diff --git a/Neos.Media/Migrations/Mysql/Version20181104152203.php b/Neos.Media/Migrations/Mysql/Version20181104152203.php index a5232d62e56..ae8d945e9ae 100644 --- a/Neos.Media/Migrations/Mysql/Version20181104152203.php +++ b/Neos.Media/Migrations/Mysql/Version20181104152203.php @@ -12,7 +12,7 @@ */ use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -35,7 +35,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice LONGTEXT NOT NULL'); } @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } diff --git a/Neos.Media/Migrations/Mysql/Version20190314150744.php b/Neos.Media/Migrations/Mysql/Version20190314150744.php index 1fdb27ea006..f24d9e92996 100644 --- a/Neos.Media/Migrations/Mysql/Version20190314150744.php +++ b/Neos.Media/Migrations/Mysql/Version20190314150744.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // It is now safe the remove the default value from the database schema, as we only needed it during migration of earlier Neos versions: $this->addSql('ALTER TABLE neos_media_domain_model_asset CHANGE assetsourceidentifier assetsourceidentifier VARCHAR(255) NOT NULL'); @@ -40,11 +42,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset CHANGE assetsourceidentifier assetsourceidentifier VARCHAR(255) DEFAULT \'neos\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE neos_media_domain_model_imagevariant DROP presetidentifier, DROP presetvariantname'); diff --git a/Neos.Media/Migrations/Mysql/Version20190315122900.php b/Neos.Media/Migrations/Mysql/Version20190315122900.php index 478e49e3535..075d2fd2cf9 100644 --- a/Neos.Media/Migrations/Mysql/Version20190315122900.php +++ b/Neos.Media/Migrations/Mysql/Version20190315122900.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD aspectratioasstring VARCHAR(255) DEFAULT NULL'); } /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP aspectratioasstring'); } } diff --git a/Neos.Media/Migrations/Mysql/Version20191125132700.php b/Neos.Media/Migrations/Mysql/Version20191125132700.php index 8e2d8fe4682..1be4dd094c1 100644 --- a/Neos.Media/Migrations/Mysql/Version20191125132700.php +++ b/Neos.Media/Migrations/Mysql/Version20191125132700.php @@ -4,9 +4,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for ratio mode for image adjustments @@ -29,7 +29,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET ratiomode=\'inset\' WHERE (ratiomode IS NULL OR ratiomode=\'\') AND dtype=\'neos_media_adjustment_resizeimageadjustment\''); } @@ -40,6 +40,6 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); } } diff --git a/Neos.Media/Migrations/Mysql/Version20200306233229.php b/Neos.Media/Migrations/Mysql/Version20200306233229.php index 940984f1fb1..8e2395ee30c 100644 --- a/Neos.Media/Migrations/Mysql/Version20200306233229.php +++ b/Neos.Media/Migrations/Mysql/Version20200306233229.php @@ -3,9 +3,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\Migrations\AbstractMigration; class Version20200306233229 extends AbstractMigration { @@ -21,12 +22,12 @@ public function getDescription(): string /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD parent VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier)'); @@ -36,12 +37,12 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F'); $this->addSql('DROP INDEX IDX_CA4889693D8E604F ON neos_media_domain_model_tag'); diff --git a/Neos.Media/Migrations/Mysql/Version20200823164700.php b/Neos.Media/Migrations/Mysql/Version20200823164700.php index 99e27171439..b7cb1ca4997 100644 --- a/Neos.Media/Migrations/Mysql/Version20200823164700.php +++ b/Neos.Media/Migrations/Mysql/Version20200823164700.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -32,7 +32,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( @@ -50,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( diff --git a/Neos.Media/Migrations/Mysql/Version20200828170100.php b/Neos.Media/Migrations/Mysql/Version20200828170100.php index 7e71a6e096f..307b4c48f9c 100644 --- a/Neos.Media/Migrations/Mysql/Version20200828170100.php +++ b/Neos.Media/Migrations/Mysql/Version20200828170100.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -28,7 +28,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://TYPO3.Media/Public/Icons/512px/', 'resource://Neos.Media/Public/IconSets/vivid/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.png', '.svg')"); @@ -41,7 +41,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://Neos.Media/Public/IconSets/vivid/', 'resource://TYPO3.Media/Public/Icons/512px/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.svg', '.png')"); diff --git a/Neos.Media/Migrations/Postgresql/Version20120412194612.php b/Neos.Media/Migrations/Postgresql/Version20120412194612.php index f950000a79c..ed9de4dd884 100644 --- a/Neos.Media/Migrations/Postgresql/Version20120412194612.php +++ b/Neos.Media/Migrations/Postgresql/Version20120412194612.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, width INT NOT NULL, height INT NOT NULL, type INT NOT NULL, imagevariants TEXT NOT NULL, PRIMARY KEY(flow3_persistence_identifier))"); $this->addSql("CREATE INDEX IDX_7FA2358DBC91F416 ON typo3_media_domain_model_image (resource)"); @@ -33,9 +34,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image DROP CONSTRAINT FK_7FA2358DBC91F416"); $this->addSql("DROP TABLE typo3_media_domain_model_image"); diff --git a/Neos.Media/Migrations/Postgresql/Version20121002120357.php b/Neos.Media/Migrations/Postgresql/Version20121002120357.php index 0e4ffbb8e36..5687dc1c667 100644 --- a/Neos.Media/Migrations/Postgresql/Version20121002120357.php +++ b/Neos.Media/Migrations/Postgresql/Version20121002120357.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'flow3_persistence_identifier', 'persistence_object_identifier'); @@ -39,9 +40,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'persistence_object_identifier', 'flow3_persistence_identifier'); diff --git a/Neos.Media/Migrations/Postgresql/Version20121011140946.php b/Neos.Media/Migrations/Postgresql/Version20121011140946.php index 57fdba53964..4ab8442ea28 100644 --- a/Neos.Media/Migrations/Postgresql/Version20121011140946.php +++ b/Neos.Media/Migrations/Postgresql/Version20121011140946.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:31:\"\\000*\\000FLOW3_Persistence_Identifier\";', 's:32:\"\\000*\\000Persistence_Object_Identifier\";') WHERE imagevariants LIKE '%s:31:\"\\000*\\000FLOW3_Persistence_Identifier\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:33:\"FLOW3_Persistence_RelatedEntities\";', 's:32:\"Flow_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:33:\"FLOW3_Persistence_RelatedEntities\";%'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:28:\"TYPO3\\\\Flow\\\\Resource\\\\Resource\";', 's:29:\"TYPO3\\\\FLOW3\\\\Resource\\\\Resource\";') WHERE imagevariants LIKE '%s:28:\"TYPO3\\\\\\\\Flow\\\\\\\\Resource\\\\\\\\Resource\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:32:\"Flow_Persistence_RelatedEntities\";', 's:33:\"FLOW3_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:32:\"Flow_Persistence_RelatedEntities\";%'"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130522131642.php b/Neos.Media/Migrations/Postgresql/Version20130522131642.php index 238eeb76cca..4c772c95cd0 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130522131642.php +++ b/Neos.Media/Migrations/Postgresql/Version20130522131642.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // new tables for Asset, Document, Video, Audio $this->addSql("CREATE TABLE typo3_media_domain_model_asset (persistence_object_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, dtype VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))"); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // adjust Image table $this->addSql("ALTER TABLE typo3_media_domain_model_image ADD resource VARCHAR(40) DEFAULT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130522132836.php b/Neos.Media/Migrations/Postgresql/Version20130522132836.php index da141dacb64..d3f3e89ee88 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130522132836.php +++ b/Neos.Media/Migrations/Postgresql/Version20130522132836.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_asset_tags_join (media_asset VARCHAR(40) NOT NULL, media_tag VARCHAR(40) NOT NULL, PRIMARY KEY(media_asset, media_tag))"); $this->addSql("CREATE INDEX IDX_DAF7A1EB1DB69EED ON typo3_media_domain_model_asset_tags_join (media_asset)"); @@ -29,9 +30,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP CONSTRAINT FK_DAF7A1EB1DB69EED"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP CONSTRAINT FK_DAF7A1EB48D8C57E"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130605174713.php b/Neos.Media/Migrations/Postgresql/Version20130605174713.php index 0a614b637bd..acb87cc6742 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130605174713.php +++ b/Neos.Media/Migrations/Postgresql/Version20130605174713.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD caption TEXT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD lastmodified TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP lastmodified"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP caption"); diff --git a/Neos.Media/Migrations/Postgresql/Version20141118174900.php b/Neos.Media/Migrations/Postgresql/Version20141118174900.php index 504c217f729..77220e2c890 100644 --- a/Neos.Media/Migrations/Postgresql/Version20141118174900.php +++ b/Neos.Media/Migrations/Postgresql/Version20141118174900.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_adjustment_abstractimageadjustment (persistence_object_identifier VARCHAR(40) NOT NULL, imagevariant VARCHAR(40) DEFAULT NULL, dtype VARCHAR(255) NOT NULL, x INT DEFAULT NULL, y INT DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, maximumwidth INT DEFAULT NULL, maximumheight INT DEFAULT NULL, minimumwidth INT DEFAULT NULL, minimumheight INT DEFAULT NULL, ratiomode INT DEFAULT NULL, PRIMARY KEY(persistence_object_identifier))"); $this->addSql("CREATE INDEX IDX_84416FDCA76D06E6 ON typo3_media_domain_model_adjustment_abstractimageadjustment (imagevariant)"); @@ -39,9 +40,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP CONSTRAINT FK_84416FDCA76D06E6"); $this->addSql("DROP TABLE typo3_media_domain_model_adjustment_abstractimageadjustment"); diff --git a/Neos.Media/Migrations/Postgresql/Version20141118174901.php b/Neos.Media/Migrations/Postgresql/Version20141118174901.php index 7335cbf70f5..b39ce1f483f 100644 --- a/Neos.Media/Migrations/Postgresql/Version20141118174901.php +++ b/Neos.Media/Migrations/Postgresql/Version20141118174901.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ALTER ratiomode TYPE VARCHAR(255)"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER ratiomode TYPE VARCHAR(255)"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ALTER ratiomode TYPE INT USING (ratiomode::integer)"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER ratiomode TYPE INT USING (ratiomode::integer)"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150131172631.php b/Neos.Media/Migrations/Postgresql/Version20150131172631.php index 5ce74bb2d97..4447a2a8610 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150131172631.php +++ b/Neos.Media/Migrations/Postgresql/Version20150131172631.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER originalasset SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER originalasset SET NOT NULL"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER originalasset DROP NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER originalasset DROP NOT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150305113900.php b/Neos.Media/Migrations/Postgresql/Version20150305113900.php index 67916a3bdee..cfae04739f2 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150305113900.php +++ b/Neos.Media/Migrations/Postgresql/Version20150305113900.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD position INT NULL"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 10 WHERE dtype = 'typo3_media_adjustment_cropimageadjustment'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP position"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20150324185008.php b/Neos.Media/Migrations/Postgresql/Version20150324185008.php index fb4d601420f..d0823861f55 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150324185008.php +++ b/Neos.Media/Migrations/Postgresql/Version20150324185008.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD allowupscaling BOOLEAN DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD allowupscaling BOOLEAN DEFAULT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP allowupscaling"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP allowupscaling"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150507204451.php b/Neos.Media/Migrations/Postgresql/Version20150507204451.php index ecf92c3fdab..41cbb7512b8 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150507204451.php +++ b/Neos.Media/Migrations/Postgresql/Version20150507204451.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection (persistence_object_identifier VARCHAR(40) NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))"); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection_assets_join (media_assetcollection VARCHAR(40) NOT NULL, media_asset VARCHAR(40) NOT NULL, PRIMARY KEY(media_assetcollection, media_asset))"); @@ -34,9 +35,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_assets_join DROP CONSTRAINT FK_E90D72512A965871"); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_tags_join DROP CONSTRAINT FK_A41705672A965871"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150701113247.php b/Neos.Media/Migrations/Postgresql/Version20150701113247.php index ac86736fca6..1886d95a591 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150701113247.php +++ b/Neos.Media/Migrations/Postgresql/Version20150701113247.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width DROP NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height DROP NOT NULL"); @@ -29,9 +30,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height SET NOT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150913173935.php b/Neos.Media/Migrations/Postgresql/Version20150913173935.php index 28331404b4e..7ade3e4cb29 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150913173935.php +++ b/Neos.Media/Migrations/Postgresql/Version20150913173935.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD configuration JSON, ADD configurationhash VARCHAR(32)"); $this->addSql("COMMENT ON COLUMN typo3_media_domain_model_thumbnail.configuration IS '(DC2Type:flow_json_array)'"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configurationArray = array_filter([ 'maximumWidth' => $thumbnailInfo['maximumwidth'], 'maximumHeight' => $thumbnailInfo['maximumheight'], @@ -46,14 +48,14 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD maximumwidth INT DEFAULT NULL, ADD maximumheight INT DEFAULT NULL, ADD ratiomode VARCHAR(255), ADD allowupscaling BOOLEAN"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configuration = json_decode($thumbnailInfo['configuration'], true); $maximumWidth = isset($configuration['maximumWidth']) ? (integer)$configuration['maximumWidth'] : null; $maximumWidth = $maximumWidth === 0 ? null : $maximumWidth; @@ -62,7 +64,7 @@ public function down(Schema $schema): void $ratioMode = isset($configuration['ratioMode']) ? $configuration['ratioMode'] : null; $allowUpScaling = isset($configuration['allowUpScaling']) ? $configuration['allowUpScaling'] : null; $allowUpScaling = $allowUpScaling ? 1 : 0; - $types = [\PDO::PARAM_NULL]; + $types = [PDO::PARAM_NULL]; $this->addSql("UPDATE typo3_media_domain_model_thumbnail SET maximumwidth = ?, maximumheight = ?, ratiomode = ?, allowupscaling = ? WHERE persistence_object_identifier = ?", [$maximumWidth, $maximumHeight, $ratioMode, $allowUpScaling, $thumbnailInfo['persistence_object_identifier']], $types); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216054040.php b/Neos.Media/Migrations/Postgresql/Version20151216054040.php index f287626096c..754792685af 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216054040.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216054040.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER resource DROP NOT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER resource SET NOT NULL"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216143845.php b/Neos.Media/Migrations/Postgresql/Version20151216143845.php index a0329927a8e..c7fb445af63 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216143845.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216143845.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD staticresource VARCHAR(255) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP staticresource"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216144435.php b/Neos.Media/Migrations/Postgresql/Version20151216144435.php index ce186bb84c4..7ef65658c46 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216144435.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216144435.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_media_domain_model_thumbnail"); $this->addSql("DROP INDEX originalasset_configurationhash"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX originalasset_configurationhash"); $this->addSql("CREATE INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail (originalasset, configurationhash)"); diff --git a/Neos.Media/Migrations/Postgresql/Version20161125093811.php b/Neos.Media/Migrations/Postgresql/Version20161125093811.php index 33b328eae69..032bbdfc765 100644 --- a/Neos.Media/Migrations/Postgresql/Version20161125093811.php +++ b/Neos.Media/Migrations/Postgresql/Version20161125093811.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment RENAME TO neos_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('ALTER TABLE typo3_media_domain_model_asset RENAME TO neos_media_domain_model_asset'); @@ -36,9 +37,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment RENAME TO typo3_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('ALTER TABLE neos_media_domain_model_asset RENAME TO typo3_media_domain_model_asset'); diff --git a/Neos.Media/Migrations/Postgresql/Version20161125172823.php b/Neos.Media/Migrations/Postgresql/Version20161125172823.php index 332dffe1138..b876e104f11 100644 --- a/Neos.Media/Migrations/Postgresql/Version20161125172823.php +++ b/Neos.Media/Migrations/Postgresql/Version20161125172823.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); diff --git a/Neos.Media/Migrations/Postgresql/Version20170110133136.php b/Neos.Media/Migrations/Postgresql/Version20170110133136.php index 9d032476319..fc45d3ccad1 100644 --- a/Neos.Media/Migrations/Postgresql/Version20170110133136.php +++ b/Neos.Media/Migrations/Postgresql/Version20170110133136.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX idx_84416fdca76d06e6 RENAME TO IDX_8B2F26F8A76D06E6'); $this->addSql('ALTER INDEX uniq_b8306b8ebc91f416 RENAME TO UNIQ_675F9550BC91F416'); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX uniq_675f9550bc91f416 RENAME TO uniq_b8306b8ebc91f416'); $this->addSql('ALTER INDEX idx_915bc7a21db69eed RENAME TO idx_daf7a1eb1db69eed'); diff --git a/Neos.Media/Migrations/Postgresql/Version20170220155800.php b/Neos.Media/Migrations/Postgresql/Version20170220155800.php index c85caab3c39..ea7a1080974 100644 --- a/Neos.Media/Migrations/Postgresql/Version20170220155800.php +++ b/Neos.Media/Migrations/Postgresql/Version20170220155800.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD quality INT DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail ADD quality INT DEFAULT NULL'); } @@ -32,9 +33,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP quality'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail DROP quality'); } diff --git a/Neos.Media/Migrations/Postgresql/Version20180406163142.php b/Neos.Media/Migrations/Postgresql/Version20180406163142.php index 0b07ea38194..8173573de1b 100644 --- a/Neos.Media/Migrations/Postgresql/Version20180406163142.php +++ b/Neos.Media/Migrations/Postgresql/Version20180406163142.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('CREATE TABLE neos_media_domain_model_importedasset (persistence_object_identifier VARCHAR(40) NOT NULL, assetsourceidentifier VARCHAR(255) NOT NULL, remoteassetidentifier VARCHAR(255) NOT NULL, localassetidentifier VARCHAR(255) NOT NULL, localoriginalassetidentifier VARCHAR(255) DEFAULT NULL, importedat TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(persistence_object_identifier))'); $this->addSql('CREATE UNIQUE INDEX flow_identity_neos_media_domain_model_importedasset ON neos_media_domain_model_importedasset (assetsourceidentifier, remoteassetidentifier, localassetidentifier)'); @@ -34,11 +36,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP TABLE neos_media_domain_model_importedasset'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP assetsourceidentifier'); diff --git a/Neos.Media/Migrations/Postgresql/Version20181104152204.php b/Neos.Media/Migrations/Postgresql/Version20181104152204.php index 408cd1d9224..0127e629019 100644 --- a/Neos.Media/Migrations/Postgresql/Version20181104152204.php +++ b/Neos.Media/Migrations/Postgresql/Version20181104152204.php @@ -12,7 +12,7 @@ */ use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -35,7 +35,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL DEFAULT \'\''); } @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } diff --git a/Neos.Media/Migrations/Postgresql/Version20190314150745.php b/Neos.Media/Migrations/Postgresql/Version20190314150745.php index 89d1edb27a9..83ca279b2b4 100644 --- a/Neos.Media/Migrations/Postgresql/Version20190314150745.php +++ b/Neos.Media/Migrations/Postgresql/Version20190314150745.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); // It is now safe the remove the default value from the database schema, as we only needed it during migration of earlier Neos versions: $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier DROP DEFAULT'); @@ -42,11 +44,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier SET DEFAULT \'neos\''); $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier DROP NOT NULL'); diff --git a/Neos.Media/Migrations/Postgresql/Version20190315122901.php b/Neos.Media/Migrations/Postgresql/Version20190315122901.php index 483de8c81f5..be9f4096126 100644 --- a/Neos.Media/Migrations/Postgresql/Version20190315122901.php +++ b/Neos.Media/Migrations/Postgresql/Version20190315122901.php @@ -2,7 +2,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -27,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD aspectratioasstring VARCHAR(255) DEFAULT NULL'); } @@ -38,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP aspectratioasstring'); } } diff --git a/Neos.Media/Migrations/Postgresql/Version20191125132701.php b/Neos.Media/Migrations/Postgresql/Version20191125132701.php index 13216f4e17c..72cac2e417b 100644 --- a/Neos.Media/Migrations/Postgresql/Version20191125132701.php +++ b/Neos.Media/Migrations/Postgresql/Version20191125132701.php @@ -4,9 +4,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for ratio mode for image adjustments @@ -29,7 +29,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET ratiomode=\'inset\' WHERE ratiomode IS NULL AND dtype=\'neos_media_adjustment_resizeimageadjustment\''); } @@ -40,6 +40,6 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); } } diff --git a/Neos.Media/Migrations/Postgresql/Version20200307122055.php b/Neos.Media/Migrations/Postgresql/Version20200307122055.php index 996ef5893f0..0d9929808c7 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200307122055.php +++ b/Neos.Media/Migrations/Postgresql/Version20200307122055.php @@ -2,9 +2,10 @@ declare(strict_types=1); namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\Migrations\AbstractMigration; class Version20200307122055 extends AbstractMigration { @@ -20,12 +21,12 @@ public function getDescription(): string /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD parent VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -35,12 +36,12 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP CONSTRAINT FK_CA4889693D8E604F'); $this->addSql('DROP INDEX IDX_CA4889693D8E604F'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP parent'); diff --git a/Neos.Media/Migrations/Postgresql/Version20200823164701.php b/Neos.Media/Migrations/Postgresql/Version20200823164701.php index 29ce1128305..ea6b547b796 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200823164701.php +++ b/Neos.Media/Migrations/Postgresql/Version20200823164701.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -32,7 +32,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( @@ -50,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( diff --git a/Neos.Media/Migrations/Postgresql/Version20200828170101.php b/Neos.Media/Migrations/Postgresql/Version20200828170101.php index 61b56560a9b..1f0363d3471 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200828170101.php +++ b/Neos.Media/Migrations/Postgresql/Version20200828170101.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -28,7 +28,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://TYPO3.Media/Public/Icons/512px/', 'resource://Neos.Media/Public/IconSets/vivid/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.png', '.svg')"); @@ -41,7 +41,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://Neos.Media/Public/IconSets/vivid/', 'resource://TYPO3.Media/Public/Icons/512px/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.svg', '.png')"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110620155002.php b/Neos.Neos/Migrations/Mysql/Version20110620155002.php index e84eaaa7b9b..cb3eb893b92 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110620155002.php +++ b/Neos.Neos/Migrations/Mysql/Version20110620155002.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Database structure as per the T3CON11 CfP launch on 2011-05-20 @@ -16,7 +17,7 @@ class Version20110620155002 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_domain (flow3_persistence_identifier VARCHAR(40) NOT NULL, typo3_site VARCHAR(40) DEFAULT NULL, hostpattern VARCHAR(255) DEFAULT NULL, INDEX IDX_64D1A917E12C6E67 (typo3_site), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_site (flow3_persistence_identifier VARCHAR(40) NOT NULL, name VARCHAR(255) DEFAULT NULL, nodename VARCHAR(255) DEFAULT NULL, state INT DEFAULT NULL, siteresourcespackagekey VARCHAR(255) DEFAULT NULL, PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -33,7 +34,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_user DROP FOREIGN KEY typo3_user_ibfk_2"); $this->addSql("ALTER TABLE typo3_user DROP FOREIGN KEY typo3_user_ibfk_1"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110824125035.php b/Neos.Neos/Migrations/Mysql/Version20110824125035.php index 29f7349406f..e48935a437f 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110824125035.php +++ b/Neos.Neos/Migrations/Mysql/Version20110824125035.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename TYPO3 tables to follow FQCN @@ -16,7 +17,7 @@ class Version20110824125035 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("RENAME TABLE typo3_domain TO typo3_typo3_domain_model_domain"); $this->addSql("RENAME TABLE typo3_site TO typo3_typo3_domain_model_site"); @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("RENAME TABLE typo3_typo3_domain_model_domain TO typo3_domain"); $this->addSql("RENAME TABLE typo3_typo3_domain_model_site TO typo3_site"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110919164835.php b/Neos.Neos/Migrations/Mysql/Version20110919164835.php index 030a5f2c1d2..cd58f991b5d 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110919164835.php +++ b/Neos.Neos/Migrations/Mysql/Version20110919164835.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Creates the table for the TYPO3 Media\Image model @@ -16,7 +17,7 @@ class Version20110919164835 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_media_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, flow3_resource_resource VARCHAR(40) DEFAULT NULL, UNIQUE INDEX UNIQ_E5EA82E211FFD19F (flow3_resource_resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_media_image ADD CONSTRAINT typo3_typo3_domain_model_media_image_ibfk_1 FOREIGN KEY (flow3_resource_resource) REFERENCES typo3_flow3_resource_resource(flow3_persistence_identifier)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_typo3_domain_model_media_image"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20110923125538.php b/Neos.Neos/Migrations/Mysql/Version20110923125538.php index 148a6933ef7..ebb44f764b4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110923125538.php +++ b/Neos.Neos/Migrations/Mysql/Version20110923125538.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Fix column names for direct associations @@ -16,7 +17,7 @@ class Version20110923125538 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP FOREIGN KEY typo3_typo3_domain_model_domain_ibfk_1"); $this->addSql("DROP INDEX IDX_64D1A917E12C6E67 ON typo3_typo3_domain_model_domain"); @@ -43,7 +44,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP FOREIGN KEY typo3_typo3_domain_model_domain_ibfk_1"); $this->addSql("DROP INDEX IDX_F227E8F6694309E4 ON typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110925123119.php b/Neos.Neos/Migrations/Mysql/Version20110925123119.php index b26c459af70..e1e1b5857a4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110925123119.php +++ b/Neos.Neos/Migrations/Mysql/Version20110925123119.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Drop media image tables of TYPO3 package, no longer used @@ -17,7 +18,7 @@ class Version20110925123119 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_typo3_domain_model_media_image"); } @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_media_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, UNIQUE INDEX UNIQ_E5EA82E2BC91F416 (resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_media_image ADD CONSTRAINT typo3_typo3_domain_model_media_image_ibfk_1 FOREIGN KEY (resource) REFERENCES typo3_flow3_resource_resource(flow3_persistence_identifier)"); diff --git a/Neos.Neos/Migrations/Mysql/Version20120329220343.php b/Neos.Neos/Migrations/Mysql/Version20120329220343.php index 93c274738fb..7f138f8c69d 100644 --- a/Neos.Neos/Migrations/Mysql/Version20120329220343.php +++ b/Neos.Neos/Migrations/Mysql/Version20120329220343.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust default values to NOT NULL unless allowed in model. @@ -16,7 +17,7 @@ class Version20120329220343 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain CHANGE hostpattern hostpattern VARCHAR(255) NOT NULL"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site CHANGE name name VARCHAR(255) NOT NULL, CHANGE nodename nodename VARCHAR(255) NOT NULL, CHANGE state state INT NOT NULL, CHANGE siteresourcespackagekey siteresourcespackagekey VARCHAR(255) NOT NULL"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain CHANGE hostpattern hostpattern VARCHAR(255) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE nodename nodename VARCHAR(255) DEFAULT NULL, CHANGE state state INT DEFAULT NULL, CHANGE siteresourcespackagekey siteresourcespackagekey VARCHAR(255) DEFAULT NULL"); diff --git a/Neos.Neos/Migrations/Mysql/Version20120429213448.php b/Neos.Neos/Migrations/Mysql/Version20120429213448.php index 4077c985cc7..13a0c059b69 100644 --- a/Neos.Neos/Migrations/Mysql/Version20120429213448.php +++ b/Neos.Neos/Migrations/Mysql/Version20120429213448.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20120429213448 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site (nodename)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20121001202223.php b/Neos.Neos/Migrations/Mysql/Version20121001202223.php index 6d22848a88d..f99f6395df3 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121001202223.php +++ b/Neos.Neos/Migrations/Mysql/Version20121001202223.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Flow\Persistence\Doctrine\Service; /** @@ -17,7 +18,7 @@ class Version20121001202223 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( @@ -59,7 +60,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( diff --git a/Neos.Neos/Migrations/Mysql/Version20121030221151.php b/Neos.Neos/Migrations/Mysql/Version20121030221151.php index bd26bc671d8..968c89f9f80 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121030221151.php +++ b/Neos.Neos/Migrations/Mysql/Version20121030221151.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename from TYPO3 and/or Phoenix to Neos as needed @@ -16,7 +17,7 @@ class Version20121030221151 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site RENAME TO typo3_neos_domain_model_site"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain RENAME TO typo3_neos_domain_model_domain"); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site RENAME TO typo3_typo3_domain_model_site"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME TO typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Mysql/Version20121031190213.php b/Neos.Neos/Migrations/Mysql/Version20121031190213.php index 90bb1c56808..1fdd5d0ee5e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121031190213.php +++ b/Neos.Neos/Migrations/Mysql/Version20121031190213.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add state field to the "Domain" domain model schema @@ -16,7 +17,7 @@ class Version20121031190213 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain ADD active TINYINT(1) NOT NULL"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain DROP active"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20130213130515.php b/Neos.Neos/Migrations/Mysql/Version20130213130515.php index 5c14c81fe7d..9760aeee2ba 100644 --- a/Neos.Neos/Migrations/Mysql/Version20130213130515.php +++ b/Neos.Neos/Migrations/Mysql/Version20130213130515.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20130213130515 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain (hostpattern)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20131111235827.php b/Neos.Neos/Migrations/Mysql/Version20131111235827.php index eff5799e818..8ab2b6d490a 100644 --- a/Neos.Neos/Migrations/Mysql/Version20131111235827.php +++ b/Neos.Neos/Migrations/Mysql/Version20131111235827.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Remove the site content object proxy from all site nodes and change their node type to "TYPO3.Neos:Shortcut" @@ -16,7 +17,7 @@ class Version20131111235827 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20141017174559.php b/Neos.Neos/Migrations/Mysql/Version20141017174559.php index 886738c9a9f..17793fe65ba 100644 --- a/Neos.Neos/Migrations/Mysql/Version20141017174559.php +++ b/Neos.Neos/Migrations/Mysql/Version20141017174559.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Change all existing serialized ImageVariants to arrays to be picked up and converted by the matching ContentRepository migration. @@ -16,7 +17,7 @@ class Version20141017174559 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->write('The conversion of nodes to the new resource management cannot be reverted with a database migration.'); } } diff --git a/Neos.Neos/Migrations/Mysql/Version20141114115241.php b/Neos.Neos/Migrations/Mysql/Version20141114115241.php index 668c6c91f8b..28769cfd8fd 100644 --- a/Neos.Neos/Migrations/Mysql/Version20141114115241.php +++ b/Neos.Neos/Migrations/Mysql/Version20141114115241.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create Event Log Table @@ -16,7 +17,7 @@ class Version20141114115241 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_neos_eventlog_domain_model_event (persistence_object_identifier VARCHAR(40) NOT NULL, parentevent VARCHAR(40) DEFAULT NULL, timestamp DATETIME NOT NULL, uid INT(11) NOT NULL AUTO_INCREMENT UNIQUE, eventtype VARCHAR(255) NOT NULL, accountidentifier VARCHAR(255) DEFAULT NULL, data LONGTEXT NOT NULL COMMENT '(DC2Type:array)', dtype VARCHAR(255) NOT NULL, nodeidentifier VARCHAR(255) DEFAULT NULL, documentnodeidentifier VARCHAR(255) DEFAULT NULL, workspacename VARCHAR(255) DEFAULT NULL, dimension LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_30AB3A75B684C08 (parentevent), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ADD CONSTRAINT FK_30AB3A75B684C08 FOREIGN KEY (parentevent) REFERENCES typo3_neos_eventlog_domain_model_event (persistence_object_identifier)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("DROP TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150224171107.php b/Neos.Neos/Migrations/Mysql/Version20150224171107.php index e5597c52e8d..216966c1fa3 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150224171107.php +++ b/Neos.Neos/Migrations/Mysql/Version20150224171107.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust event log table to schema valid table structure @@ -16,7 +17,7 @@ class Version20150224171107 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP PRIMARY KEY"); @@ -39,7 +40,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP PRIMARY KEY"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150309215317.php b/Neos.Neos/Migrations/Mysql/Version20150309215317.php index 496cd868f13..3849e2322f5 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150309215317.php +++ b/Neos.Neos/Migrations/Mysql/Version20150309215317.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust DB schema to a clean state (remove cruft that built up in the past) @@ -16,7 +17,7 @@ class Version20150309215317 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_f227e8f6694309e4', $indexes)) { @@ -49,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX uid ON typo3_neos_eventlog_domain_model_event (uid)"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150507204452.php b/Neos.Neos/Migrations/Mysql/Version20150507204452.php index 9ef33cc701e..29046cd154a 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150507204452.php +++ b/Neos.Neos/Migrations/Mysql/Version20150507204452.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add asset collection to site @@ -16,7 +17,7 @@ class Version20150507204452 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD assetcollection VARCHAR(40) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B2075CEB2C15 FOREIGN KEY (assetcollection) REFERENCES typo3_media_domain_model_assetcollection (persistence_object_identifier)"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site DROP FOREIGN KEY FK_1854B2075CEB2C15"); $this->addSql("DROP INDEX IDX_1854B2075CEB2C15 ON typo3_neos_domain_model_site"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150724091148.php b/Neos.Neos/Migrations/Mysql/Version20150724091148.php index 13220b18a82..f440b65121e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150724091148.php +++ b/Neos.Neos/Migrations/Mysql/Version20150724091148.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds indices to the event log to improve performance @@ -16,7 +17,7 @@ class Version20150724091148 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE INDEX documentnodeidentifier ON typo3_neos_eventlog_domain_model_event (documentnodeidentifier)"); $this->addSql("CREATE INDEX eventtype ON typo3_neos_eventlog_domain_model_event (eventtype)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX documentnodeidentifier ON typo3_neos_eventlog_domain_model_event"); $this->addSql("DROP INDEX eventtype ON typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Mysql/Version20151117125551.php b/Neos.Neos/Migrations/Mysql/Version20151117125551.php index f23dffcf634..da221d94cff 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151117125551.php +++ b/Neos.Neos/Migrations/Mysql/Version20151117125551.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces @@ -16,24 +18,24 @@ class Version20151117125551 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - while ($workspaceRecord = $workspacesQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($workspaceRecord = $workspacesQuery->fetch(PDO::FETCH_ASSOC)) { $username = substr($workspaceRecord['name'], 5); $accountQuery = $this->connection->executeQuery('SELECT persistence_object_identifier FROM typo3_flow_security_account t0 WHERE t0.accountidentifier = \'' . $username . '\' AND t0.authenticationprovidername = \'Typo3BackendProvider\''); - $accountRecord = $accountQuery->fetch(\PDO::FETCH_ASSOC); + $accountRecord = $accountQuery->fetch(PDO::FETCH_ASSOC); $partyQuery = $this->connection->executeQuery('SELECT party_abstractparty FROM typo3_party_domain_model_abstractparty_accounts_join t0 WHERE t0.flow_security_account = \'' . $accountRecord['persistence_object_identifier'] . '\''); - $partyRecord = $partyQuery->fetch(\PDO::FETCH_ASSOC); + $partyRecord = $partyQuery->fetch(PDO::FETCH_ASSOC); $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = \'' . $partyRecord['party_abstractparty'] . '\' WHERE name = \'user-' . $username . '\''); @@ -47,7 +49,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20151223125909.php b/Neos.Neos/Migrations/Mysql/Version20151223125909.php index 86556582ca8..3e7b2c61bfc 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151223125909.php +++ b/Neos.Neos/Migrations/Mysql/Version20151223125909.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20151223125909 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160104121311.php b/Neos.Neos/Migrations/Mysql/Version20160104121311.php index 85b45deacf5..d18a45b32b6 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160104121311.php +++ b/Neos.Neos/Migrations/Mysql/Version20160104121311.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20160104121311 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery("SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE 'user-%' AND t0.owner = ''"); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160212141523.php b/Neos.Neos/Migrations/Mysql/Version20160212141523.php index 0235410f9b9..37018c0d842 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160212141523.php +++ b/Neos.Neos/Migrations/Mysql/Version20160212141523.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust some (old) index names to current Doctrine DBAL behavior (see https://jira.neos.io/browse/FLOW-427) @@ -16,7 +17,7 @@ class Version20160212141523 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_f227e8f6694309e4', $indexes)) { @@ -45,7 +46,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_8e49a537694309e4', $indexes)) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160223165603.php b/Neos.Neos/Migrations/Mysql/Version20160223165603.php index a849b33a56a..35b6dc72ebe 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160223165603.php +++ b/Neos.Neos/Migrations/Mysql/Version20160223165603.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust column comment to type change @@ -16,7 +17,7 @@ class Version20160223165603 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event CHANGE data data LONGTEXT NOT NULL COMMENT '(DC2Type:flow_json_array)'"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event CHANGE data data LONGTEXT NOT NULL COMMENT '(DC2Type:array)'"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20160411101457.php b/Neos.Neos/Migrations/Mysql/Version20160411101457.php index aef7fd6c498..ce274cd8932 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160411101457.php +++ b/Neos.Neos/Migrations/Mysql/Version20160411101457.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds scheme and port to domain model @@ -16,7 +17,7 @@ class Version20160411101457 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD scheme VARCHAR(255) DEFAULT NULL, ADD port INT DEFAULT NULL'); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP scheme, DROP port'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20160411101458.php b/Neos.Neos/Migrations/Mysql/Version20160411101458.php index 8cfce2d0f32..feca2c2c7d7 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160411101458.php +++ b/Neos.Neos/Migrations/Mysql/Version20160411101458.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds primary domain to site model @@ -16,7 +17,7 @@ class Version20160411101458 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD primarydomain VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B207B8872B4A FOREIGN KEY (primarydomain) REFERENCES typo3_neos_domain_model_domain (persistence_object_identifier)'); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site DROP FOREIGN KEY FK_1854B207B8872B4A'); $this->addSql('DROP INDEX IDX_1854B207B8872B4A ON typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Mysql/Version20160711103441.php b/Neos.Neos/Migrations/Mysql/Version20160711103441.php index 218efbcb00e..15b371a0fbc 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160711103441.php +++ b/Neos.Neos/Migrations/Mysql/Version20160711103441.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename hostpattern to hostname @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain CHANGE hostpattern hostname VARCHAR(255) NOT NULL'); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain CHANGE hostname hostpattern VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci'); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125093800.php b/Neos.Neos/Migrations/Mysql/Version20161125093800.php index 723f3b9a77b..c7e30ca3767 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125093800.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125093800.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161125093800 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE typo3_neos_domain_model_domain TO neos_neos_domain_model_domain'); $this->addSql('RENAME TABLE typo3_neos_domain_model_site TO neos_neos_domain_model_site'); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE neos_neos_domain_model_domain TO typo3_neos_domain_model_domain'); $this->addSql('RENAME TABLE neos_neos_domain_model_site TO typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125124749.php b/Neos.Neos/Migrations/Mysql/Version20161125124749.php index 7f6f9e9d5d9..0a2b847efa4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125124749.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125124749.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125124749 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125171231.php b/Neos.Neos/Migrations/Mysql/Version20161125171231.php index 0500fbbb728..168bc7e3487 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125171231.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125171231.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename dtypes in neos_neos_eventlog_domain_model_event @@ -16,7 +17,7 @@ class Version20161125171231 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'typo3_neos_', 'neos_neos_')"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'neos_neos_', 'typo3_neos_')"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20170110130253.php b/Neos.Neos/Migrations/Mysql/Version20170110130253.php index 84e3b7120aa..58283f5b70c 100644 --- a/Neos.Neos/Migrations/Mysql/Version20170110130253.php +++ b/Neos.Neos/Migrations/Mysql/Version20170110130253.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20170110130253 extends AbstractMigration { @@ -22,7 +23,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { @@ -69,7 +70,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { diff --git a/Neos.Neos/Migrations/Mysql/Version20170115114801.php b/Neos.Neos/Migrations/Mysql/Version20170115114801.php index 5f543555ed5..26e9b6b22a8 100644 --- a/Neos.Neos/Migrations/Mysql/Version20170115114801.php +++ b/Neos.Neos/Migrations/Mysql/Version20170115114801.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename Typo3BackendProvider to Neos.Neos:Backend @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Neos.Neos:Backend' WHERE authenticationprovidername = 'Typo3BackendProvider'"); } @@ -35,7 +36,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Typo3BackendProvider' WHERE authenticationprovidername = 'Neos.Neos:Backend'"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20171206140453.php b/Neos.Neos/Migrations/Mysql/Version20171206140453.php index c183680b66f..f8f0b4c5621 100644 --- a/Neos.Neos/Migrations/Mysql/Version20171206140453.php +++ b/Neos.Neos/Migrations/Mysql/Version20171206140453.php @@ -2,9 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; -use Doctrine\DBAL\Platforms\MySQL57Platform; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20171206140453 extends AbstractMigration { @@ -22,7 +22,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE INDEX documentnodeidentifier ON neos_neos_eventlog_domain_model_event (documentnodeidentifier)'); } @@ -33,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX documentnodeidentifier ON neos_neos_eventlog_domain_model_event'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20210125134503.php b/Neos.Neos/Migrations/Mysql/Version20210125134503.php index 360b7b0d406..2445b934093 100644 --- a/Neos.Neos/Migrations/Mysql/Version20210125134503.php +++ b/Neos.Neos/Migrations/Mysql/Version20210125134503.php @@ -4,6 +4,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -16,11 +18,11 @@ public function getDescription(): string /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD dimensionshash VARCHAR(32) DEFAULT NULL'); $this->addSql('CREATE INDEX dimensionshash ON neos_neos_eventlog_domain_model_event (dimensionshash)'); @@ -28,11 +30,11 @@ public function up(Schema $schema): void /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP INDEX dimensionshash ON neos_neos_eventlog_domain_model_event'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP dimensionshash'); @@ -41,7 +43,7 @@ public function down(Schema $schema): void /** * @param Schema $schema * @throws \Doctrine\DBAL\Driver\Exception - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function postUp(Schema $schema): void { diff --git a/Neos.Neos/Migrations/Mysql/Version20211220145601.php b/Neos.Neos/Migrations/Mysql/Version20211220145601.php index 8417bf0f7bf..15ee4a80c8e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20211220145601.php +++ b/Neos.Neos/Migrations/Mysql/Version20211220145601.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; /** * Add workspace/parent index to NodeEvent table @@ -26,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event (workspacename, parentevent)'); } @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20231012072631.php b/Neos.Neos/Migrations/Mysql/Version20231012072631.php index 0bfc08bc314..3fbd9c90f70 100644 --- a/Neos.Neos/Migrations/Mysql/Version20231012072631.php +++ b/Neos.Neos/Migrations/Mysql/Version20231012072631.php @@ -4,6 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -17,7 +18,7 @@ public function getDescription(): string public function up(Schema $schema): void { $this->abortIf( - !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDb1027Platform, + !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform, "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MariaDb1027Platform'." ); @@ -27,7 +28,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf( - !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDb1027Platform, + !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform, "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MariaDb1027Platform'." ); diff --git a/Neos.Neos/Migrations/Postgresql/Version20120412194614.php b/Neos.Neos/Migrations/Postgresql/Version20120412194614.php index e1b74af170d..389dd077b87 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20120412194614.php +++ b/Neos.Neos/Migrations/Postgresql/Version20120412194614.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create tables for PostgreSQL @@ -16,7 +17,7 @@ class Version20120412194614 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_domain (flow3_persistence_identifier VARCHAR(40) NOT NULL, site VARCHAR(40) DEFAULT NULL, hostpattern VARCHAR(255) NOT NULL, PRIMARY KEY(flow3_persistence_identifier))"); $this->addSql("CREATE INDEX IDX_F227E8F6694309E4 ON typo3_typo3_domain_model_domain (site)"); @@ -36,7 +37,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_user DROP CONSTRAINT FK_E3F98B1321E3D446"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP CONSTRAINT FK_F227E8F6694309E4"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20120429225208.php b/Neos.Neos/Migrations/Postgresql/Version20120429225208.php index 0c021df722d..ef46a58daee 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20120429225208.php +++ b/Neos.Neos/Migrations/Postgresql/Version20120429225208.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20120429225208 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site (nodename)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow3_identity_typo3_typo3_domain_model_site"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20121002121215.php b/Neos.Neos/Migrations/Postgresql/Version20121002121215.php index 212813c88eb..681a7521458 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121002121215.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121002121215.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Flow\Persistence\Doctrine\Service; /** @@ -17,7 +18,7 @@ class Version20121002121215 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( @@ -51,7 +52,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( diff --git a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php index f3c531b2e18..d16b34329ef 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename from TYPO3 and/or Phoenix to Neos as needed @@ -16,7 +17,7 @@ class Version20121030103851 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site RENAME TO typo3_neos_domain_model_site"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain RENAME TO typo3_neos_domain_model_domain"); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site RENAME TO typo3_typo3_domain_model_site"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME TO typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20121031190214.php b/Neos.Neos/Migrations/Postgresql/Version20121031190214.php index 1c914373798..4da3797e443 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121031190214.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121031190214.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add state field to the "Domain" domain model schema @@ -16,7 +17,7 @@ class Version20121031190214 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain ADD active BOOLEAN NOT NULL"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain DROP active"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20130213180302.php b/Neos.Neos/Migrations/Postgresql/Version20130213180302.php index f3a78b45e08..2173266ee59 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20130213180302.php +++ b/Neos.Neos/Migrations/Postgresql/Version20130213180302.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20130213180302 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain (hostpattern)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php index c9c9b8ea795..cbb5b08e56c 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php +++ b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Remove the site content object proxy from all site nodes and change their node type to "TYPO3.Neos:Shortcut" @@ -16,7 +17,7 @@ class Version20131112191120 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata', 'typo3_typo3cr_domain_model_contentobjectproxy']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20141125133037.php b/Neos.Neos/Migrations/Postgresql/Version20141125133037.php index 0a58e7816ff..c83dfea03c5 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20141125133037.php +++ b/Neos.Neos/Migrations/Postgresql/Version20141125133037.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create Event Log Table @@ -16,7 +17,7 @@ class Version20141125133037 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE SEQUENCE typo3_neos_eventlog_domain_model_event_uid_seq INCREMENT BY 1 MINVALUE 1 START 1"); $this->addSql("CREATE TABLE typo3_neos_eventlog_domain_model_event (persistence_object_identifier VARCHAR(40) NOT NULL, parentevent VARCHAR(40) DEFAULT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, uid INT DEFAULT nextval('typo3_neos_eventlog_domain_model_event_uid_seq'), eventtype VARCHAR(255) NOT NULL, accountidentifier VARCHAR(255) DEFAULT NULL, data TEXT NOT NULL, dtype VARCHAR(255) NOT NULL, nodeidentifier VARCHAR(255) DEFAULT NULL, documentnodeidentifier VARCHAR(255) DEFAULT NULL, workspacename VARCHAR(255) DEFAULT NULL, dimension TEXT DEFAULT NULL, PRIMARY KEY(persistence_object_identifier))"); @@ -32,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT FK_30AB3A75B684C08"); $this->addSql("DROP TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150224171108.php b/Neos.Neos/Migrations/Postgresql/Version20150224171108.php index 84649df74a6..6d148e93616 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150224171108.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150224171108.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use Neos\Flow\Utility\Algorithms; /** * Adjust event log table to schema valid table structure @@ -16,7 +18,7 @@ class Version20150224171108 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT typo3_neos_eventlog_domain_model_event_pkey"); @@ -38,7 +40,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT fk_30ab3a75b684c08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT typo3_neos_eventlog_domain_model_event_pkey"); @@ -50,7 +52,7 @@ public function down(Schema $schema): void } else { $result = $this->connection->executeQuery("SELECT uid FROM typo3_neos_eventlog_domain_model_event"); while ($uid = $result->fetchColumn()) { - $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event SET persistence_object_identifier = '" . \Neos\Flow\Utility\Algorithms::generateUUID() . "' WHERE uid = " . $uid); + $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event SET persistence_object_identifier = '" . Algorithms::generateUUID() . "' WHERE uid = " . $uid); } } $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER COLUMN persistence_object_identifier SET NOT NULL"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150309212115.php b/Neos.Neos/Migrations/Postgresql/Version20150309212115.php index be0dfe7b460..347a9b34953 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150309212115.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150309212115.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust DB schema to a clean state (remove cruft that built up in the past) @@ -16,7 +17,7 @@ class Version20150309212115 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // Doctrine fetches the next value from the sequence itself before persisting, so no nextval() needed $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER uid DROP DEFAULT"); @@ -32,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("SELECT setval('typo3_neos_eventlog_domain_model_event_uid_seq', (SELECT MAX(uid) FROM typo3_neos_eventlog_domain_model_event))"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER uid SET DEFAULT nextval('typo3_neos_eventlog_domain_model_event_uid_seq')"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150507204453.php b/Neos.Neos/Migrations/Postgresql/Version20150507204453.php index 99be9284b3d..2d48d89f3fd 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150507204453.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150507204453.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add asset collection to site @@ -16,7 +17,7 @@ class Version20150507204453 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD assetcollection VARCHAR(40) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B2075CEB2C15 FOREIGN KEY (assetcollection) REFERENCES typo3_media_domain_model_assetcollection (persistence_object_identifier) NOT DEFERRABLE INITIALLY IMMEDIATE"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site DROP CONSTRAINT FK_1854B2075CEB2C15"); $this->addSql("DROP INDEX IDX_1854B2075CEB2C15"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150724091150.php b/Neos.Neos/Migrations/Postgresql/Version20150724091150.php index c609edd15a4..b175414d8d9 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150724091150.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150724091150.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds indices to the event log to improve performance @@ -16,7 +17,7 @@ class Version20150724091150 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE INDEX neos_eventlog_documentnodeidentifier ON typo3_neos_eventlog_domain_model_event (documentnodeidentifier)"); $this->addSql("CREATE INDEX neos_eventlog_eventtype ON typo3_neos_eventlog_domain_model_event (eventtype)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX neos_eventlog_documentnodeidentifier"); $this->addSql("DROP INDEX neos_eventlog_eventtype"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php index 9221ff767c3..270e9d2a276 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces @@ -16,24 +18,24 @@ class Version20151117125552 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - while ($workspaceRecord = $workspacesQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($workspaceRecord = $workspacesQuery->fetch(PDO::FETCH_ASSOC)) { $username = substr($workspaceRecord['name'], 5); $accountQuery = $this->connection->executeQuery('SELECT persistence_object_identifier FROM typo3_flow_security_account t0 WHERE t0.accountidentifier = \'' . $username . '\' AND t0.authenticationprovidername = \'Typo3BackendProvider\''); - $accountRecord = $accountQuery->fetch(\PDO::FETCH_ASSOC); + $accountRecord = $accountQuery->fetch(PDO::FETCH_ASSOC); $partyQuery = $this->connection->executeQuery('SELECT party_abstractparty FROM typo3_party_domain_model_abstractparty_accounts_join t0 WHERE t0.flow_security_account = \'' . $accountRecord['persistence_object_identifier'] . '\''); - $partyRecord = $partyQuery->fetch(\PDO::FETCH_ASSOC); + $partyRecord = $partyQuery->fetch(PDO::FETCH_ASSOC); $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = \'' . $partyRecord['party_abstractparty'] . '\' WHERE name = \'user-' . $username . '\''); @@ -47,7 +49,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php index 0ffdbea52b2..e3ff2f2528f 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Change column type from json to jsonb on dimensionvalues and accessroles @@ -16,7 +17,7 @@ class Version20151120170812 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); @@ -34,7 +35,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151126122252.php b/Neos.Neos/Migrations/Postgresql/Version20151126122252.php index 686cda839fe..eccbf37a07d 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151126122252.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151126122252.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust column type and index names on Event schema to match code @@ -19,7 +20,7 @@ class Version20151126122252 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_neos_eventlog_domain_model_event"); @@ -36,7 +37,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php index aff271d8c4f..99321c107ec 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20151223125946 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php index 1b4eb699941..16f6585f454 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20160104121413 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery("SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE 'user-%' AND t0.owner = ''"); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20160212141533.php b/Neos.Neos/Migrations/Postgresql/Version20160212141533.php index ae8f6e812ea..2a1c3d412bf 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160212141533.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160212141533.php @@ -2,9 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration, - - Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust some (old) index names to current Doctrine DBAL behavior (see https://jira.neos.io/browse/FLOW-427) @@ -17,7 +17,7 @@ class Version20160212141533 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // typo3_neos_domain_model_domain $this->addSql("ALTER INDEX IF EXISTS idx_f227e8f6694309e4 RENAME TO IDX_8E49A537694309E4"); @@ -35,7 +35,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // typo3_neos_domain_model_domain $this->addSql("ALTER INDEX IF EXISTS IDX_8E49A537694309E4 RENAME TO idx_f227e8f6694309e4"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160411101639.php b/Neos.Neos/Migrations/Postgresql/Version20160411101639.php index 237eb2c7e8f..c235d5c0149 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160411101639.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160411101639.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds scheme and port to domain model @@ -16,7 +17,7 @@ class Version20160411101639 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD scheme VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD port INT DEFAULT NULL'); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP scheme'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP port'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160411101640.php b/Neos.Neos/Migrations/Postgresql/Version20160411101640.php index e561e22b8db..fab48e0c0cb 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160411101640.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160411101640.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds primary domain to site model @@ -16,7 +17,7 @@ class Version20160411101640 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD primarydomain VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B207B8872B4A FOREIGN KEY (primarydomain) REFERENCES typo3_neos_domain_model_domain (persistence_object_identifier) NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site DROP CONSTRAINT FK_1854B207B8872B4A'); $this->addSql('DROP INDEX IDX_1854B207B8872B4A'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160711103440.php b/Neos.Neos/Migrations/Postgresql/Version20160711103440.php index 691e7d6e896..a8a66a10b0b 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160711103440.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160711103440.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename hostpattern to hostname @@ -15,7 +16,7 @@ class Version20160711103440 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME COLUMN hostpattern TO hostname"); @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME COLUMN hostname TO hostpattern"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125093801.php b/Neos.Neos/Migrations/Postgresql/Version20161125093801.php index b0d741c954d..3da8f13de22 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125093801.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125093801.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161125093801 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain RENAME TO neos_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site RENAME TO neos_neos_domain_model_site'); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_domain_model_domain RENAME TO typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE neos_neos_domain_model_site RENAME TO typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php index b1b6ad54278..fafa5441712 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125125249 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125171831.php b/Neos.Neos/Migrations/Postgresql/Version20161125171831.php index cc58e99d295..a3f0ef9ac5b 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125171831.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125171831.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125171831 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'typo3_neos_', 'neos_neos_')"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'neos_neos_', 'typo3_neos_')"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20161127010617.php b/Neos.Neos/Migrations/Postgresql/Version20161127010617.php index a9879b02f61..7acb55bdf62 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161127010617.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161127010617.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161127010617 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_eventlog_domain_model_event_uid_seq RENAME TO neos_neos_eventlog_domain_model_event_uid_seq'); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event_uid_seq RENAME TO typo3_neos_eventlog_domain_model_event_uid_seq'); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20170110133114.php b/Neos.Neos/Migrations/Postgresql/Version20170110133114.php index dfce4811ece..b1024468bb6 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170110133114.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170110133114.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20170110133114 extends AbstractMigration { @@ -21,7 +22,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX idx_8e49a537694309e4 RENAME TO IDX_51265BE9694309E4'); $this->addSql('ALTER INDEX flow_identity_typo3_neos_domain_model_domain RENAME TO flow_identity_neos_neos_domain_model_domain'); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX uniq_ed60f5e3e931a6f5 RENAME TO uniq_fc846daae931a6f5'); $this->addSql('ALTER INDEX idx_51265be9694309e4 RENAME TO idx_8e49a537694309e4'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20170115115240.php b/Neos.Neos/Migrations/Postgresql/Version20170115115240.php index fdbc14096a7..74df58c1e3f 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170115115240.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170115115240.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename Typo3BackendProvider to Neos.Neos:Backend @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Neos.Neos:Backend' WHERE authenticationprovidername = 'Typo3BackendProvider'"); } @@ -35,7 +36,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Typo3BackendProvider' WHERE authenticationprovidername = 'Neos.Neos:Backend'"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20170629102140.php b/Neos.Neos/Migrations/Postgresql/Version20170629102140.php index 90d817db52a..a886840fb60 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170629102140.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170629102140.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for event uid column @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("SELECT setval('neos_neos_eventlog_domain_model_event_uid_seq', (SELECT MAX(uid) FROM neos_neos_eventlog_domain_model_event))"); $this->addSql("ALTER TABLE neos_neos_eventlog_domain_model_event ALTER uid SET DEFAULT nextval('neos_neos_eventlog_domain_model_event_uid_seq')"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20211220145602.php b/Neos.Neos/Migrations/Postgresql/Version20211220145602.php index a0d9cd76624..7ecf1f47b66 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20211220145602.php +++ b/Neos.Neos/Migrations/Postgresql/Version20211220145602.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; /** * Add workspace/parent index to NodeEvent table @@ -26,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('CREATE INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event (workspacename, parentevent)'); } @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP INDEX workspacename_parentevent'); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20230727164600.php b/Neos.Neos/Migrations/Postgresql/Version20230727164600.php index e584f6e34a3..32628da794c 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20230727164600.php +++ b/Neos.Neos/Migrations/Postgresql/Version20230727164600.php @@ -3,6 +3,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; use Neos\ContentRepository\Utility; @@ -16,11 +18,11 @@ public function getDescription() : string /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema) : void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD dimensionshash VARCHAR(32) DEFAULT NULL'); $this->addSql('CREATE INDEX dimensionshash ON neos_neos_eventlog_domain_model_event (dimensionshash)'); @@ -28,11 +30,11 @@ public function up(Schema $schema) : void /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema) : void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP INDEX dimensionshash'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP dimensionshash'); @@ -41,7 +43,7 @@ public function down(Schema $schema) : void /** * @param Schema $schema * @throws \Doctrine\DBAL\Driver\Exception - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function postUp(Schema $schema): void { diff --git a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php index ec091880200..6aa613e31c5 100644 --- a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php +++ b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125123504 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php index 84fd02bdc57..18748c7e9aa 100644 --- a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php +++ b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125125004 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']);