migrations/Version20220331072408.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220331072408 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CC54C8C93');
  19.         $this->addSql('DROP INDEX IDX_C459519CC54C8C93 ON channel_layout');
  20.         $this->addSql('ALTER TABLE channel_layout ADD mobile_layout_type_id INT DEFAULT NULL, ADD campaigns_desktop_layout_type_id INT DEFAULT NULL, ADD campaigns_mobile_layout_type_id INT DEFAULT NULL, CHANGE type_id desktop_layout_type_id INT DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CED1872EF FOREIGN KEY (desktop_layout_type_id) REFERENCES channel_layout_type (id)');
  22.         $this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CC0E80D1A FOREIGN KEY (mobile_layout_type_id) REFERENCES channel_layout_type (id)');
  23.         $this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519C4C7C5DC3 FOREIGN KEY (campaigns_desktop_layout_type_id) REFERENCES channel_layout_type (id)');
  24.         $this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519C75545FBB FOREIGN KEY (campaigns_mobile_layout_type_id) REFERENCES channel_layout_type (id)');
  25.         $this->addSql('CREATE INDEX IDX_C459519CED1872EF ON channel_layout (desktop_layout_type_id)');
  26.         $this->addSql('CREATE INDEX IDX_C459519CC0E80D1A ON channel_layout (mobile_layout_type_id)');
  27.         $this->addSql('CREATE INDEX IDX_C459519C4C7C5DC3 ON channel_layout (campaigns_desktop_layout_type_id)');
  28.         $this->addSql('CREATE INDEX IDX_C459519C75545FBB ON channel_layout (campaigns_mobile_layout_type_id)');
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CED1872EF');
  34.         $this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CC0E80D1A');
  35.         $this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519C4C7C5DC3');
  36.         $this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519C75545FBB');
  37.         $this->addSql('DROP INDEX IDX_C459519CED1872EF ON channel_layout');
  38.         $this->addSql('DROP INDEX IDX_C459519CC0E80D1A ON channel_layout');
  39.         $this->addSql('DROP INDEX IDX_C459519C4C7C5DC3 ON channel_layout');
  40.         $this->addSql('DROP INDEX IDX_C459519C75545FBB ON channel_layout');
  41.         $this->addSql('ALTER TABLE channel_layout ADD type_id INT DEFAULT NULL, DROP desktop_layout_type_id, DROP mobile_layout_type_id, DROP campaigns_desktop_layout_type_id, DROP campaigns_mobile_layout_type_id');
  42.         $this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CC54C8C93 FOREIGN KEY (type_id) REFERENCES channel_layout_type (id)');
  43.         $this->addSql('CREATE INDEX IDX_C459519CC54C8C93 ON channel_layout (type_id)');
  44.     }
  45.     public function isTransactional(): bool
  46.     {
  47.         return false;
  48.     }
  49. }