<?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 Version20221011075529 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 direction ADD CONSTRAINT FK_3E4AD1B3CCF9E01E FOREIGN KEY (departement_id) REFERENCES departement (id)');
$this->addSql('ALTER TABLE operations ADD direction_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE operations ADD CONSTRAINT FK_28145348AF73D997 FOREIGN KEY (direction_id) REFERENCES direction (id)');
$this->addSql('CREATE INDEX IDX_28145348AF73D997 ON operations (direction_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE direction DROP FOREIGN KEY FK_3E4AD1B3CCF9E01E');
$this->addSql('ALTER TABLE operations DROP FOREIGN KEY FK_28145348AF73D997');
$this->addSql('DROP INDEX IDX_28145348AF73D997 ON operations');
$this->addSql('ALTER TABLE operations DROP direction_id');
}
}