src/Migrations/Version20220929123048.php line 1
- <?php
- declare(strict_types=1);
- namespace DoctrineMigrations;
- use Doctrine\DBAL\Schema\Schema;
- use Doctrine\Migrations\AbstractMigration;
- /**
- * Auto-generated Migration: Please modify to your needs!
- */
- final class Version20220929123048 extends AbstractMigration
- {
- public function getDescription(): string
- {
- return '';
- }
- public function up(Schema $schema): void
- {
- // this up() migration is auto-generated, please modify it to your needs
- $this->addSql('CREATE TABLE olymp_online_course_override (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, caption VARCHAR(255) NOT NULL, course_id INT DEFAULT NULL, INDEX IDX_343BCDF912469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('ALTER TABLE olymp_online_course_override ADD CONSTRAINT FK_343BCDF912469DE2 FOREIGN KEY (category_id) REFERENCES olymp_online_category (id)');
- $this->addSql('ALTER TABLE olymp_online_participant ADD course_override_id INT DEFAULT NULL');
- $this->addSql('ALTER TABLE olymp_online_participant ADD CONSTRAINT FK_EC81141772551111 FOREIGN KEY (course_override_id) REFERENCES olymp_online_course_override (id)');
- $this->addSql('CREATE INDEX IDX_EC81141772551111 ON olymp_online_participant (course_override_id)');
- }
- public function down(Schema $schema): void
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->addSql('ALTER TABLE olymp_online_participant DROP FOREIGN KEY FK_EC81141772551111');
- $this->addSql('ALTER TABLE olymp_online_course_override DROP FOREIGN KEY FK_343BCDF912469DE2');
- $this->addSql('DROP TABLE olymp_online_course_override');
- $this->addSql('DROP INDEX IDX_EC81141772551111 ON olymp_online_participant');
- $this->addSql('ALTER TABLE olymp_online_participant DROP course_override_id');
- }
- }