<?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 Version20221018153307 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 operation DROP FOREIGN KEY FK_1981A66D2ADD6D8C');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66DA53A8AA');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D59E5119C');
$this->addSql('DROP INDEX IDX_1981A66D2ADD6D8C ON operation');
$this->addSql('DROP INDEX IDX_1981A66DA53A8AA ON operation');
$this->addSql('DROP INDEX IDX_1981A66D59E5119C ON operation');
$this->addSql('ALTER TABLE operation ADD source_supplier_id INT DEFAULT NULL, ADD source_provider_id INT DEFAULT NULL, ADD source_slot_id INT DEFAULT NULL, DROP supplier_id, DROP provider_id, DROP slot_id');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D16A23D2C FOREIGN KEY (source_supplier_id) REFERENCES supplier (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D362CF80A FOREIGN KEY (source_provider_id) REFERENCES provider (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D103AA9F4 FOREIGN KEY (source_slot_id) REFERENCES slot (id)');
$this->addSql('CREATE INDEX IDX_1981A66D16A23D2C ON operation (source_supplier_id)');
$this->addSql('CREATE INDEX IDX_1981A66D362CF80A ON operation (source_provider_id)');
$this->addSql('CREATE INDEX IDX_1981A66D103AA9F4 ON operation (source_slot_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D16A23D2C');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D362CF80A');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D103AA9F4');
$this->addSql('DROP INDEX IDX_1981A66D16A23D2C ON operation');
$this->addSql('DROP INDEX IDX_1981A66D362CF80A ON operation');
$this->addSql('DROP INDEX IDX_1981A66D103AA9F4 ON operation');
$this->addSql('ALTER TABLE operation ADD supplier_id INT DEFAULT NULL, ADD provider_id INT DEFAULT NULL, ADD slot_id INT DEFAULT NULL, DROP source_supplier_id, DROP source_provider_id, DROP source_slot_id');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES supplier (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DA53A8AA FOREIGN KEY (provider_id) REFERENCES provider (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D59E5119C FOREIGN KEY (slot_id) REFERENCES slot (id)');
$this->addSql('CREATE INDEX IDX_1981A66D2ADD6D8C ON operation (supplier_id)');
$this->addSql('CREATE INDEX IDX_1981A66DA53A8AA ON operation (provider_id)');
$this->addSql('CREATE INDEX IDX_1981A66D59E5119C ON operation (slot_id)');
}
}