<?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 Version20220707134404 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('ALTER TABLE article ADD formulaire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E665053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id)');
$this->addSql('CREATE INDEX IDX_23A0E665053569B ON article (formulaire_id)');
$this->addSql('ALTER TABLE page ADD formulaire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6205053569B FOREIGN KEY (formulaire_id) REFERENCES formulaire (id)');
$this->addSql('CREATE INDEX IDX_140AB6205053569B ON page (formulaire_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E665053569B');
$this->addSql('DROP INDEX IDX_23A0E665053569B ON article');
$this->addSql('ALTER TABLE article DROP formulaire_id');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6205053569B');
$this->addSql('DROP INDEX IDX_140AB6205053569B ON page');
$this->addSql('ALTER TABLE page DROP formulaire_id');
}
}