diff --git a/Neos.ContentRepository/Migrations/Mysql/Version20190503102824.php b/Neos.ContentRepository/Migrations/Mysql/Version20190503102824.php new file mode 100644 index 00000000000..35cab6afa76 --- /dev/null +++ b/Neos.ContentRepository/Migrations/Mysql/Version20190503102824.php @@ -0,0 +1,43 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + + $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)'); + } + + /** + * @param Schema $schema + * @return void + * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + + $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX UNIQ_CE6515692D45FE4D, ADD INDEX IDX_CE6515692D45FE4D (movedto)'); + } +} diff --git a/Neos.ContentRepository/Migrations/Postgresql/Version20190503102825.php b/Neos.ContentRepository/Migrations/Postgresql/Version20190503102825.php new file mode 100644 index 00000000000..990d2bc6a2a --- /dev/null +++ b/Neos.ContentRepository/Migrations/Postgresql/Version20190503102825.php @@ -0,0 +1,45 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + + $this->addSql('DROP INDEX idx_ce6515692d45fe4d'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_CE6515692D45FE4D ON neos_contentrepository_domain_model_nodedata (movedto)'); + } + + /** + * @param Schema $schema + * @return void + * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + + $this->addSql('DROP INDEX UNIQ_CE6515692D45FE4D'); + $this->addSql('CREATE INDEX idx_ce6515692d45fe4d ON neos_contentrepository_domain_model_nodedata (movedto)'); + } +}