<?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 Version20220103150918 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 commercial DROP FOREIGN KEY FK_7653F3AE445D170C');
$this->addSql('DROP INDEX IDX_7653F3AE445D170C ON commercial');
$this->addSql('ALTER TABLE commercial ADD reseau_division_id INT DEFAULT NULL, DROP reseau_id');
$this->addSql('ALTER TABLE commercial ADD CONSTRAINT FK_7653F3AE791F3057 FOREIGN KEY (reseau_division_id) REFERENCES reseau_division (id)');
$this->addSql('CREATE INDEX IDX_7653F3AE791F3057 ON commercial (reseau_division_id)');
$this->addSql('ALTER TABLE entreprise CHANGE siret siret VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE commercial DROP FOREIGN KEY FK_7653F3AE791F3057');
$this->addSql('DROP INDEX IDX_7653F3AE791F3057 ON commercial');
$this->addSql('ALTER TABLE commercial ADD reseau_id INT NOT NULL, DROP reseau_division_id');
$this->addSql('ALTER TABLE commercial ADD CONSTRAINT FK_7653F3AE445D170C FOREIGN KEY (reseau_id) REFERENCES reseau (id)');
$this->addSql('CREATE INDEX IDX_7653F3AE445D170C ON commercial (reseau_id)');
$this->addSql('ALTER TABLE entreprise CHANGE siret siret VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`');
}
}