<?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 Version20230111144239 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 child_tags_articles (child_tags_id INT NOT NULL, articles_id INT NOT NULL, INDEX IDX_D9A8A22EFCF07AF (child_tags_id), INDEX IDX_D9A8A221EBAF6CC (articles_id), PRIMARY KEY(child_tags_id, articles_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE child_tags_articles ADD CONSTRAINT FK_D9A8A22EFCF07AF FOREIGN KEY (child_tags_id) REFERENCES child_tags (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE child_tags_articles ADD CONSTRAINT FK_D9A8A221EBAF6CC FOREIGN KEY (articles_id) REFERENCES articles (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE child_tags_articles DROP FOREIGN KEY FK_D9A8A22EFCF07AF');
$this->addSql('ALTER TABLE child_tags_articles DROP FOREIGN KEY FK_D9A8A221EBAF6CC');
$this->addSql('DROP TABLE child_tags_articles');
}
}