<?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 Version20220629052046 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 orders_send_request ADD shipping_id INT DEFAULT NULL, ADD partner_id INT DEFAULT NULL, ADD tracking_no VARCHAR(100) NOT NULL');
$this->addSql('ALTER TABLE orders_send_request ADD CONSTRAINT FK_FD77397F4887F3F8 FOREIGN KEY (shipping_id) REFERENCES shipping (id)');
$this->addSql('ALTER TABLE orders_send_request ADD CONSTRAINT FK_FD77397F9393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id)');
$this->addSql('CREATE INDEX IDX_FD77397F4887F3F8 ON orders_send_request (shipping_id)');
$this->addSql('CREATE INDEX IDX_FD77397F9393F8FE ON orders_send_request (partner_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE orders_send_request DROP FOREIGN KEY FK_FD77397F4887F3F8');
$this->addSql('ALTER TABLE orders_send_request DROP FOREIGN KEY FK_FD77397F9393F8FE');
$this->addSql('DROP INDEX IDX_FD77397F4887F3F8 ON orders_send_request');
$this->addSql('DROP INDEX IDX_FD77397F9393F8FE ON orders_send_request');
$this->addSql('ALTER TABLE orders_send_request DROP shipping_id, DROP partner_id, DROP tracking_no');
}
}