<?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 Version20241229172340 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE mmpp_inscription_mailing_config (id INT NOT NULL, content TEXT NOT NULL, name VARCHAR(255) NOT NULL, step INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE mmpp_formulaire_inscription_mailing (inscription_mailing_id INT NOT NULL, formulaire_id INT NOT NULL, PRIMARY KEY(inscription_mailing_id, formulaire_id))');
$this->addSql('CREATE INDEX IDX_813CF8E22AFB26E2 ON mmpp_formulaire_inscription_mailing (inscription_mailing_id)');
$this->addSql('CREATE INDEX IDX_813CF8E25053569B ON mmpp_formulaire_inscription_mailing (formulaire_id)');
$this->addSql('ALTER TABLE mmpp_formulaire_inscription_mailing ADD CONSTRAINT FK_813CF8E22AFB26E2 FOREIGN KEY (inscription_mailing_id) REFERENCES mmpp_inscription_mailing_config (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE mmpp_formulaire_inscription_mailing ADD CONSTRAINT FK_813CF8E25053569B FOREIGN KEY (formulaire_id) REFERENCES mmpp_form_formulaire (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('DROP SEQUENCE mmpp_inscription_mailing_config_id_seq CASCADE');
$this->addSql('ALTER TABLE mmpp_formulaire_inscription_mailing DROP CONSTRAINT FK_813CF8E22AFB26E2');
$this->addSql('ALTER TABLE mmpp_formulaire_inscription_mailing DROP CONSTRAINT FK_813CF8E25053569B');
$this->addSql('DROP TABLE mmpp_inscription_mailing_config');
$this->addSql('DROP TABLE mmpp_formulaire_inscription_mailing');
}
}