Add indexes related to course surveys - refs BT#14142

pull/2487/head
Angel Fernando Quiroz Campos 7 years ago
parent f7d182105e
commit 04dd4b2b15
  1. 36
      app/Migrations/Schema/V200/Version20180319145700.php
  2. 5
      src/CourseBundle/Entity/CSurvey.php
  3. 4
      src/CourseBundle/Entity/CSurveyInvitation.php
  4. 3
      src/CourseBundle/Entity/CSurveyQuestion.php
  5. 3
      src/CourseBundle/Entity/CSurveyQuestionOption.php

@ -0,0 +1,36 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Class Version20180319145700
*
* Add indexes related to course surveys
*
* @package Chamilo\CoreBundle\Migrations\Schema\V200
*/
class Version20180319145700 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('CREATE INDEX idx_survey_q_qid ON c_survey_question (question_id)');
$this->addSql('CREATE INDEX idx_survey_code ON c_survey (code)');
$this->addSql('CREATE INDEX idx_survey_inv_code ON c_survey_invitation (survey_code)');
$this->addSql('CREATE INDEX idx_survey_qo_qid ON c_survey_question_option (question_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
}
}

@ -11,8 +11,9 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(
* name="c_survey",
* indexes={
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="session_id", columns={"session_id"})
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="session_id", columns={"session_id"}),
* @ORM\Index(name="idx_survey_code", columns={"code"})
* }
* )
* @ORM\Entity

@ -3,6 +3,7 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Course;
use Doctrine\ORM\Mapping as ORM;
/**
@ -11,7 +12,8 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(
* name="c_survey_invitation",
* indexes={
* @ORM\Index(name="course", columns={"c_id"})
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="idx_survey_inv_code", columns={"survey_code"})
* }
* )
* @ORM\Entity

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

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

Loading…
Cancel
Save