diff --git a/Neos.ContentRepository/Migrations/Mysql/Version20230430183156.php b/Neos.ContentRepository/Migrations/Mysql/Version20230430183156.php new file mode 100644 index 00000000000..c2603fa7c20 --- /dev/null +++ b/Neos.ContentRepository/Migrations/Mysql/Version20230430183156.php @@ -0,0 +1,38 @@ +abortIf( + !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MysqlPlatform, + "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MysqlPlatform'." + ); + + $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)'); + } + + public function down(Schema $schema): void + { + $this->abortIf( + !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MysqlPlatform, + "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MysqlPlatform'." + ); + + $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX UNIQ_CE6515692D45FE4D, ADD INDEX IDX_CE6515692D45FE4D (movedto)'); + } +} diff --git a/Neos.Media/Migrations/Mysql/Version20230430183157.php b/Neos.Media/Migrations/Mysql/Version20230430183157.php new file mode 100644 index 00000000000..28789cf5d5d --- /dev/null +++ b/Neos.Media/Migrations/Mysql/Version20230430183157.php @@ -0,0 +1,40 @@ +abortIf( + !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MysqlPlatform, + "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MysqlPlatform'." + ); + + $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F'); + $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'); + } + + public function down(Schema $schema): void + { + $this->abortIf( + !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MysqlPlatform, + "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MysqlPlatform'." + ); + + $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F'); + $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)'); + } +}