Internal: Migration: Fix creation unique index for the tool table - refs #3581 #4706

pull/5096/head
Angel Fernando Quiroz Campos 10 months ago
parent a27ff91588
commit 073260bd71
  1. 2
      src/CoreBundle/Migrations/Schema/V200/Version20.php
  2. 12
      src/CoreBundle/Migrations/Schema/V200/Version20240114174300.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');

@ -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'

Loading…
Cancel
Save