<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220706165658 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE visiting_card_tag (visiting_card_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_BE604B13EB37EBA0 (visiting_card_id), INDEX IDX_BE604B13BAD26311 (tag_id), PRIMARY KEY(visiting_card_id, tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE visiting_card_flag (visiting_card_id INT NOT NULL, flag_id INT NOT NULL, INDEX IDX_21469122EB37EBA0 (visiting_card_id), INDEX IDX_21469122919FE4E5 (flag_id), PRIMARY KEY(visiting_card_id, flag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE visiting_card_pictogram (visiting_card_id INT NOT NULL, pictogram_id INT NOT NULL, INDEX IDX_A0B369B1EB37EBA0 (visiting_card_id), INDEX IDX_A0B369B116B7C33B (pictogram_id), PRIMARY KEY(visiting_card_id, pictogram_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE visiting_card_tag ADD CONSTRAINT FK_BE604B13EB37EBA0 FOREIGN KEY (visiting_card_id) REFERENCES visiting_card (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visiting_card_tag ADD CONSTRAINT FK_BE604B13BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visiting_card_flag ADD CONSTRAINT FK_21469122EB37EBA0 FOREIGN KEY (visiting_card_id) REFERENCES visiting_card (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visiting_card_flag ADD CONSTRAINT FK_21469122919FE4E5 FOREIGN KEY (flag_id) REFERENCES flag (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visiting_card_pictogram ADD CONSTRAINT FK_A0B369B1EB37EBA0 FOREIGN KEY (visiting_card_id) REFERENCES visiting_card (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE visiting_card_pictogram ADD CONSTRAINT FK_A0B369B116B7C33B FOREIGN KEY (pictogram_id) REFERENCES pictogram (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE visiting_card_tag');
$this->addSql('DROP TABLE visiting_card_flag');
$this->addSql('DROP TABLE visiting_card_pictogram');
}
}