<?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 Version20220831114257 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 referentiel_perimetre_comptable (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, code VARCHAR(190) NOT NULL, UNIQUE INDEX UNIQ_C5A03CC277153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE referentiel_plateforme ADD perimetre_comptable_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE referentiel_plateforme ADD CONSTRAINT FK_8BA1E3E5CC63C340 FOREIGN KEY (perimetre_comptable_id) REFERENCES referentiel_perimetre_comptable (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8BA1E3E5CC63C340 ON referentiel_plateforme (perimetre_comptable_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE referentiel_plateforme DROP FOREIGN KEY FK_8BA1E3E5CC63C340');
$this->addSql('DROP TABLE referentiel_perimetre_comptable');
$this->addSql('DROP INDEX UNIQ_8BA1E3E5CC63C340 ON referentiel_plateforme');
$this->addSql('ALTER TABLE referentiel_plateforme DROP perimetre_comptable_id');
}
}