<?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 Version20221018171704 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 ADD destination_supplier_id INT DEFAULT NULL, ADD destination_provider_id INT DEFAULT NULL, ADD destination_slot_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DFEF86B7 FOREIGN KEY (destination_supplier_id) REFERENCES supplier (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D2F614391 FOREIGN KEY (destination_provider_id) REFERENCES provider (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D37DC2EE4 FOREIGN KEY (destination_slot_id) REFERENCES slot (id)');
$this->addSql('CREATE INDEX IDX_1981A66DFEF86B7 ON operation (destination_supplier_id)');
$this->addSql('CREATE INDEX IDX_1981A66D2F614391 ON operation (destination_provider_id)');
$this->addSql('CREATE INDEX IDX_1981A66D37DC2EE4 ON operation (destination_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_1981A66DFEF86B7');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D2F614391');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D37DC2EE4');
$this->addSql('DROP INDEX IDX_1981A66DFEF86B7 ON operation');
$this->addSql('DROP INDEX IDX_1981A66D2F614391 ON operation');
$this->addSql('DROP INDEX IDX_1981A66D37DC2EE4 ON operation');
$this->addSql('ALTER TABLE operation DROP destination_supplier_id, DROP destination_provider_id, DROP destination_slot_id');
}
}