Add sql index

pull/3006/head
Julio Montoya 5 years ago
parent c2b3a2f5c7
commit 932af3f8d0
  1. 2
      src/CoreBundle/Entity/TrackEAttempt.php
  2. 5
      src/CoreBundle/Migrations/Schema/V200/Version20.php

@ -16,7 +16,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Index(name="exe_id", columns={"exe_id"}),
* @ORM\Index(name="user_id", columns={"user_id"}),
* @ORM\Index(name="question_id", columns={"question_id"}),
* @ORM\Index(name="session_id", columns={"session_id"})
* @ORM\Index(name="idx_track_e_attempt_tms", columns={"tms"}),
* }
* )
* @ORM\Entity

@ -803,6 +803,11 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE usergroup ADD author_id INT DEFAULT NULL');
}
$table = $schema->getTable('track_e_attempt');
if (!$table->hasIndex('idx_track_e_attempt_tms')) {
$this->addSql('CREATE INDEX idx_track_e_attempt_tms ON track_e_attempt (tms)');
}
$this->addSql('ALTER TABLE c_group_info ADD CONSTRAINT FK_CE06532491D79BD3 FOREIGN KEY (c_id) REFERENCES course (id);');
$this->addSql('ALTER TABLE course_category CHANGE auth_course_child auth_course_child VARCHAR(40) DEFAULT NULL');

Loading…
Cancel
Save