diff --git a/src/CoreBundle/Entity/TrackELogin.php b/src/CoreBundle/Entity/TrackELogin.php index fd57268960..5acac88a55 100644 --- a/src/CoreBundle/Entity/TrackELogin.php +++ b/src/CoreBundle/Entity/TrackELogin.php @@ -9,7 +9,8 @@ use Doctrine\ORM\Mapping as ORM; * TrackELogin. * * @ORM\Table(name="track_e_login", indexes={ - * @ORM\Index(name="login_user_id", columns={"login_user_id"}) + * @ORM\Index(name="login_user_id", columns={"login_user_id"}), + * @ORM\Index(name="idx_track_e_login_date", columns={"login_date"}) * }) * @ORM\Entity */ diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20.php b/src/CoreBundle/Migrations/Schema/V200/Version20.php index e6238e97e4..4b7f3739e4 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20.php @@ -808,6 +808,11 @@ class Version20 extends AbstractMigrationChamilo $this->addSql('CREATE INDEX idx_track_e_attempt_tms ON track_e_attempt (tms)'); } + $table = $schema->getTable('track_e_login'); + if (!$table->hasIndex('idx_track_e_login_date')) { + $this->addSql('CREATE INDEX idx_track_e_login_date ON track_e_login (login_date)'); + } + $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');