Skip to content

Commit

Permalink
Merge pull request #31 from neos/bugfix/check-index-before-removal
Browse files Browse the repository at this point in the history
BUGFIX: Check for index existence before removal
  • Loading branch information
ahaeslich authored Oct 4, 2023
2 parents 9c8f2e4 + 08ee073 commit ae54f94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Migrations/Mysql/Version20220912100052.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public function up(Schema $schema): void
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MySqlPlatform'."
);

$this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');
$indexes = $this->sm->listTableIndexes('neos_redirecthandler_databasestorage_domain_model_redirect');
if (array_key_exists('sourceuripathhash', $indexes)) {
$this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');
}
}

public function down(Schema $schema): void
Expand Down

0 comments on commit ae54f94

Please sign in to comment.