Add sql index

pull/3006/head
Julio Montoya 5 years ago
parent 932af3f8d0
commit 88ab243b9a
  1. 3
      src/CoreBundle/Entity/TrackELogin.php
  2. 5
      src/CoreBundle/Migrations/Schema/V200/Version20.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
*/

@ -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');

Loading…
Cancel
Save