<?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 Version20210528092925 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 lnpages ADD chapitre_id INT NOT NULL');
$this->addSql('ALTER TABLE lnpages ADD CONSTRAINT FK_5D285AD1FBEEF7B FOREIGN KEY (chapitre_id) REFERENCES lnchapitres (id)');
$this->addSql('CREATE INDEX IDX_5D285AD1FBEEF7B ON lnpages (chapitre_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lnpages DROP FOREIGN KEY FK_5D285AD1FBEEF7B');
$this->addSql('DROP INDEX IDX_5D285AD1FBEEF7B ON lnpages');
$this->addSql('ALTER TABLE lnpages DROP chapitre_id');
}
}