Fix- Add index to accelerate query - refs #8200

1.10.x
nosolored 9 years ago
parent 42a88a8629
commit ce7f036ff4
  1. 3
      app/Migrations/Schema/V110/Version20151221150100.php
  2. 29
      app/Migrations/Schema/V110/Version20160707131900.php
  3. 3
      src/Chamilo/CourseBundle/Entity/CQuizAnswer.php

@ -16,9 +16,6 @@ class Version20151221150100 extends AbstractMigrationChamilo
*/
public function up(Schema $schema)
{
$this->addSql("
ALTER TABLE c_quiz_answer ADD INDEX idx_quiz_qid (question_id)");
$this->addSql("
UPDATE track_e_attempt a
INNER JOIN c_quiz_answer qa

@ -0,0 +1,29 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V110;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Fix c_quiz_answer's correct field for id_auto
*/
class Version20160707131900 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql("
ALTER TABLE c_quiz_answer ADD INDEX idx_cqa_q (question_id)");
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
}
}

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

Loading…
Cancel
Save