Browse Source

Add index on c_quiz_question_rel_category

Angel Fernando Quiroz Campos 8 years ago
parent
commit
11e38c94ee

+ 1 - 0
app/Migrations/Schema/V111/Version111.php

@@ -263,6 +263,7 @@ class Version111 extends AbstractMigrationChamilo
             $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('ticket_allow_student_add', 'true', 'Yes'), ('ticket_allow_student_add', 'false', 'No')");
             $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('ticket_allow_category_edition', 'true', 'Yes'), ('ticket_allow_category_edition', 'false', 'No')");
 
+            $this->addSql("ALTER TABLE c_quiz_question_rel_category ADD INDEX idx_qqrc_qid (question_id)");
         }
     }
 

+ 2 - 1
src/Chamilo/CourseBundle/Entity/CQuizQuestionRelCategory.php

@@ -11,7 +11,8 @@ use Doctrine\ORM\Mapping as ORM;
  * @ORM\Table(
  *  name="c_quiz_question_rel_category",
  *  indexes={
- *      @ORM\Index(name="course", columns={"c_id"})
+ *      @ORM\Index(name="course", columns={"c_id"}),
+ *      @ORM\Index(name="idx_qqrc_qid", columns={"question_id"})
  *  }
  * )
  * @ORM\Entity