<?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 Version20230810124417 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 source_container_id INT DEFAULT NULL, ADD destination_container_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D6ACB2BFA FOREIGN KEY (source_container_id) REFERENCES container (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DD0F2C8D FOREIGN KEY (destination_container_id) REFERENCES container (id)');
$this->addSql('CREATE INDEX IDX_1981A66D6ACB2BFA ON operation (source_container_id)');
$this->addSql('CREATE INDEX IDX_1981A66DD0F2C8D ON operation (destination_container_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_1981A66D6ACB2BFA');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66DD0F2C8D');
$this->addSql('DROP INDEX IDX_1981A66D6ACB2BFA ON operation');
$this->addSql('DROP INDEX IDX_1981A66DD0F2C8D ON operation');
$this->addSql('ALTER TABLE operation DROP source_container_id, DROP destination_container_id');
}
}