From 073260bd71873b82a2aaaf72dbef6fe9bef5858c Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Wed, 17 Jan 2024 15:00:26 -0500 Subject: [PATCH] Internal: Migration: Fix creation unique index for the tool table - refs #3581 #4706 --- src/CoreBundle/Migrations/Schema/V200/Version20.php | 2 +- .../Migrations/Schema/V200/Version20240114174300.php | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20.php b/src/CoreBundle/Migrations/Schema/V200/Version20.php index 907b838bde..069fb4ea36 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20.php @@ -140,7 +140,7 @@ class Version20 extends AbstractMigrationChamilo $this->addSql( 'CREATE TABLE IF NOT EXISTS tool (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;' ); - $this->addSql('CREATE UNIQUE INDEX UNIQ_20F33ED15E237E06 ON tool (name)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_20F33ED12B36786B ON tool (title)'); } $table = $schema->getTable('language'); diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php b/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php index 2723f06ed4..1ec721389d 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php @@ -58,18 +58,6 @@ final class Version20240114174300 extends AbstractMigrationChamilo ); } - if ($schema->hasTable('tool')) { - $table = $schema->getTable('tool'); - if ($table->hasIndex('UNIQ_20F33ED15E237E06')) { - $this->addSql( - 'DROP INDEX UNIQ_20F33ED15E237E06 on tool' - ); - } - $this->addSql( - 'CREATE UNIQUE INDEX UNIQ_20F33ED12B36786B ON tool (title)' - ); - } - if ($schema->hasTable('resource_tag')) { $this->addSql( 'ALTER TABLE resource_tag CHANGE name title VARCHAR(255) NOT NULL'