Merge pull request #1198 from nosolored/t0001

Add index to accelerate query - refs #8200
1.10.x
Angel Fernando Quiroz Campos 9 years ago committed by GitHub
commit a8283aa99f
  1. 29
      app/Migrations/Schema/V110/Version20160707131900.php
  2. 3
      src/Chamilo/CourseBundle/Entity/CQuizAnswer.php

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