<?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 Version20220310133743 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 banner_store (banner_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', store_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_52386960684EC833 (banner_id), INDEX IDX_52386960B092A811 (store_id), PRIMARY KEY(banner_id, store_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE banner_store ADD CONSTRAINT FK_52386960684EC833 FOREIGN KEY (banner_id) REFERENCES banner (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE banner_store ADD CONSTRAINT FK_52386960B092A811 FOREIGN KEY (store_id) REFERENCES store (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE banner ADD stores_excluded TINYINT(1) NOT NULL AFTER drupal_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE banner_store');
$this->addSql('ALTER TABLE banner DROP stores_excluded');
}
public function isTransactional(): bool
{
return false;
}
}