<?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 Version20240308175046 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_sous_thematique (blog_id INT NOT NULL, sous_thematique_id INT NOT NULL, INDEX IDX_6E0FFCC1DAE07E97 (blog_id), INDEX IDX_6E0FFCC17A025320 (sous_thematique_id), PRIMARY KEY(blog_id, sous_thematique_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE blog_sous_thematique ADD CONSTRAINT FK_6E0FFCC1DAE07E97 FOREIGN KEY (blog_id) REFERENCES blog (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE blog_sous_thematique ADD CONSTRAINT FK_6E0FFCC17A025320 FOREIGN KEY (sous_thematique_id) REFERENCES sous_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_sous_thematique DROP FOREIGN KEY FK_6E0FFCC1DAE07E97');
$this->addSql('ALTER TABLE blog_sous_thematique DROP FOREIGN KEY FK_6E0FFCC17A025320');
$this->addSql('DROP TABLE blog_sous_thematique');
$this->addSql('ALTER TABLE blog ADD description VARCHAR(255) NOT NULL');
}
}