<?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 Version20211209150832 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 dossier DROP FOREIGN KEY FK_3D48E0377854071C');
$this->addSql('DROP INDEX IDX_3D48E0377854071C ON dossier');
$this->addSql('ALTER TABLE dossier DROP commercial_id');
$this->addSql('ALTER TABLE entreprise ADD commercial_id INT DEFAULT NULL, ADD reseau_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE entreprise ADD CONSTRAINT FK_D19FA607854071C FOREIGN KEY (commercial_id) REFERENCES commercial (id)');
$this->addSql('ALTER TABLE entreprise ADD CONSTRAINT FK_D19FA60445D170C FOREIGN KEY (reseau_id) REFERENCES reseau (id)');
$this->addSql('CREATE INDEX IDX_D19FA607854071C ON entreprise (commercial_id)');
$this->addSql('CREATE INDEX IDX_D19FA60445D170C ON entreprise (reseau_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE dossier ADD commercial_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE dossier ADD CONSTRAINT FK_3D48E0377854071C FOREIGN KEY (commercial_id) REFERENCES commercial (id)');
$this->addSql('CREATE INDEX IDX_3D48E0377854071C ON dossier (commercial_id)');
$this->addSql('ALTER TABLE entreprise DROP FOREIGN KEY FK_D19FA607854071C');
$this->addSql('ALTER TABLE entreprise DROP FOREIGN KEY FK_D19FA60445D170C');
$this->addSql('DROP INDEX IDX_D19FA607854071C ON entreprise');
$this->addSql('DROP INDEX IDX_D19FA60445D170C ON entreprise');
$this->addSql('ALTER TABLE entreprise DROP commercial_id, DROP reseau_id');
}
}