<?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 Version20220331072408 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('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CC54C8C93');
$this->addSql('DROP INDEX IDX_C459519CC54C8C93 ON channel_layout');
$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');
$this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CED1872EF FOREIGN KEY (desktop_layout_type_id) REFERENCES channel_layout_type (id)');
$this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CC0E80D1A FOREIGN KEY (mobile_layout_type_id) REFERENCES channel_layout_type (id)');
$this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519C4C7C5DC3 FOREIGN KEY (campaigns_desktop_layout_type_id) REFERENCES channel_layout_type (id)');
$this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519C75545FBB FOREIGN KEY (campaigns_mobile_layout_type_id) REFERENCES channel_layout_type (id)');
$this->addSql('CREATE INDEX IDX_C459519CED1872EF ON channel_layout (desktop_layout_type_id)');
$this->addSql('CREATE INDEX IDX_C459519CC0E80D1A ON channel_layout (mobile_layout_type_id)');
$this->addSql('CREATE INDEX IDX_C459519C4C7C5DC3 ON channel_layout (campaigns_desktop_layout_type_id)');
$this->addSql('CREATE INDEX IDX_C459519C75545FBB ON channel_layout (campaigns_mobile_layout_type_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CED1872EF');
$this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519CC0E80D1A');
$this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519C4C7C5DC3');
$this->addSql('ALTER TABLE channel_layout DROP FOREIGN KEY FK_C459519C75545FBB');
$this->addSql('DROP INDEX IDX_C459519CED1872EF ON channel_layout');
$this->addSql('DROP INDEX IDX_C459519CC0E80D1A ON channel_layout');
$this->addSql('DROP INDEX IDX_C459519C4C7C5DC3 ON channel_layout');
$this->addSql('DROP INDEX IDX_C459519C75545FBB ON channel_layout');
$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');
$this->addSql('ALTER TABLE channel_layout ADD CONSTRAINT FK_C459519CC54C8C93 FOREIGN KEY (type_id) REFERENCES channel_layout_type (id)');
$this->addSql('CREATE INDEX IDX_C459519CC54C8C93 ON channel_layout (type_id)');
}
public function isTransactional(): bool
{
return false;
}
}