<?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 Version20221109145558 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 supply_id INT DEFAULT NULL, ADD delivery_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DFF28C0D8 FOREIGN KEY (supply_id) REFERENCES supply (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D12136921 FOREIGN KEY (delivery_id) REFERENCES delivery (id)');
$this->addSql('CREATE INDEX IDX_1981A66DFF28C0D8 ON operation (supply_id)');
$this->addSql('CREATE INDEX IDX_1981A66D12136921 ON operation (delivery_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_1981A66DFF28C0D8');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D12136921');
$this->addSql('DROP INDEX IDX_1981A66DFF28C0D8 ON operation');
$this->addSql('DROP INDEX IDX_1981A66D12136921 ON operation');
$this->addSql('ALTER TABLE operation DROP supply_id, DROP delivery_id');
}
}