<?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 Version20220802121533 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 periode ADD description_id INT DEFAULT NULL, ADD bilan_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE periode ADD CONSTRAINT FK_93C32DF3D9F966B FOREIGN KEY (description_id) REFERENCES descriptions (id)');
$this->addSql('ALTER TABLE periode ADD CONSTRAINT FK_93C32DF3705F7C57 FOREIGN KEY (bilan_id) REFERENCES bilan (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_93C32DF3D9F966B ON periode (description_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_93C32DF3705F7C57 ON periode (bilan_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE periode DROP FOREIGN KEY FK_93C32DF3D9F966B');
$this->addSql('ALTER TABLE periode DROP FOREIGN KEY FK_93C32DF3705F7C57');
$this->addSql('DROP INDEX UNIQ_93C32DF3D9F966B ON periode');
$this->addSql('DROP INDEX UNIQ_93C32DF3705F7C57 ON periode');
$this->addSql('ALTER TABLE periode DROP description_id, DROP bilan_id');
}
}