From 932af3f8d0946423059b495a58a5bc929d53a61a Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 19 Sep 2019 15:25:04 +0200 Subject: [PATCH] Add sql index --- src/CoreBundle/Entity/TrackEAttempt.php | 2 +- src/CoreBundle/Migrations/Schema/V200/Version20.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CoreBundle/Entity/TrackEAttempt.php b/src/CoreBundle/Entity/TrackEAttempt.php index f2af1b4c35..7f8b7f7a0f 100644 --- a/src/CoreBundle/Entity/TrackEAttempt.php +++ b/src/CoreBundle/Entity/TrackEAttempt.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 diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20.php b/src/CoreBundle/Migrations/Schema/V200/Version20.php index 647ede172d..e6238e97e4 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20.php @@ -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');