From eddf956f63ccfaa54865473582cf32a609f0bb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 8 Jan 2023 23:57:00 +0100 Subject: [PATCH] Do not use RENAME INDEX as it is not supported in older MariaDB versions --- migrations/Version20230108165410.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migrations/Version20230108165410.php b/migrations/Version20230108165410.php index 637ab437..4124a95a 100644 --- a/migrations/Version20230108165410.php +++ b/migrations/Version20230108165410.php @@ -44,8 +44,10 @@ final class Version20230108165410 extends AbstractMultiPlatformMigration $this->addSql('ALTER TABLE projects DROP FOREIGN KEY devices_parent_id_fk'); } $this->addSql('ALTER TABLE projects ADD status VARCHAR(64) DEFAULT NULL, ADD description LONGTEXT NOT NULL'); - $this->addSql('ALTER TABLE projects RENAME INDEX idx_11074e9a727aca70 TO IDX_5C93B3A4727ACA70'); - $this->addSql('ALTER TABLE projects RENAME INDEX idx_11074e9a6dedcec2 TO IDX_5C93B3A46DEDCEC2'); + $this->addSql('CREATE INDEX IDX_5C93B3A4727ACA70 ON projects (parent_id)'); + $this->addSql('DROP INDEX idx_11074e9a727aca70 ON projects'); + $this->addSql('CREATE INDEX IDX_5C93B3A46DEDCEC2 ON projects (id_preview_attachement)'); + $this->addSql('DROP INDEX idx_11074e9a6dedcec2 ON projects'); $this->addSql('ALTER TABLE projects ADD CONSTRAINT FK_11074E9A6DEDCEC2 FOREIGN KEY (id_preview_attachement) REFERENCES attachments (id)'); $this->addSql('ALTER TABLE projects ADD CONSTRAINT FK_5C93B3A4727ACA70 FOREIGN KEY (parent_id) REFERENCES projects (id)'); }