<?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 Version20220203210017 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 blog_article_blog_tag (blog_article_id INT NOT NULL, blog_tag_id INT NOT NULL, INDEX IDX_2707E6049452A475 (blog_article_id), INDEX IDX_2707E6042F9DC6D0 (blog_tag_id), PRIMARY KEY(blog_article_id, blog_tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE blog_article_blog_tag ADD CONSTRAINT FK_2707E6049452A475 FOREIGN KEY (blog_article_id) REFERENCES blog_article (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE blog_article_blog_tag ADD CONSTRAINT FK_2707E6042F9DC6D0 FOREIGN KEY (blog_tag_id) REFERENCES blog_tag (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE blog_article_blog_tag');
}
}