<?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 Version20240308133507 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_thematique (blog_id INT NOT NULL, thematique_id INT NOT NULL, INDEX IDX_DC48F741DAE07E97 (blog_id), INDEX IDX_DC48F741476556AF (thematique_id), PRIMARY KEY(blog_id, thematique_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE blog_thematique ADD CONSTRAINT FK_DC48F741DAE07E97 FOREIGN KEY (blog_id) REFERENCES blog (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE blog_thematique ADD CONSTRAINT FK_DC48F741476556AF FOREIGN KEY (thematique_id) REFERENCES thematique (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 blog_thematique DROP FOREIGN KEY FK_DC48F741DAE07E97');
$this->addSql('ALTER TABLE blog_thematique DROP FOREIGN KEY FK_DC48F741476556AF');
$this->addSql('DROP TABLE blog_thematique');
}
}