Merge pull request #5676 from christianbeeznest/fixes-updates37

Internal: Add sticky index to course table
pull/5677/head
christianbeeznest 1 year ago committed by GitHub
commit 7f502497c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      src/CoreBundle/Entity/Course.php
  2. 4
      src/CoreBundle/Migrations/Schema/V200/Version20191101132000.php

@ -50,6 +50,7 @@ use Symfony\Component\Validator\Constraints as Assert;
security: "is_granted('ROLE_USER')"
)]
#[ORM\Table(name: 'course')]
#[ORM\Index(columns: ['sticky'], name: 'idx_course_sticky')]
#[UniqueEntity('code')]
#[UniqueEntity('visualCode')]
#[ORM\Entity(repositoryClass: CourseRepository::class)]

@ -36,6 +36,10 @@ class Version20191101132000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE course ADD sticky TINYINT(1) NOT NULL');
}
if (!$table->hasIndex('idx_course_sticky')) {
$this->addSql('CREATE INDEX idx_course_sticky ON course (sticky)');
}
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE course ADD COLUMN resource_node_id INT DEFAULT NULL;');
$this->addSql(

Loading…
Cancel
Save