<?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 Version20220603025220 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_other_fee ADD shipping_id INT DEFAULT NULL, ADD ordersDetail_id INT DEFAULT NULL, DROP entity_id');
$this->addSql('ALTER TABLE orders_other_fee ADD CONSTRAINT FK_A61D097E4887F3F8 FOREIGN KEY (shipping_id) REFERENCES shipping (id)');
$this->addSql('ALTER TABLE orders_other_fee ADD CONSTRAINT FK_A61D097EB3C719BE FOREIGN KEY (ordersDetail_id) REFERENCES orders_detail (id)');
$this->addSql('CREATE INDEX IDX_A61D097E4887F3F8 ON orders_other_fee (shipping_id)');
$this->addSql('CREATE INDEX IDX_A61D097EB3C719BE ON orders_other_fee (ordersDetail_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE orders_other_fee DROP FOREIGN KEY FK_A61D097E4887F3F8');
$this->addSql('ALTER TABLE orders_other_fee DROP FOREIGN KEY FK_A61D097EB3C719BE');
$this->addSql('DROP INDEX IDX_A61D097E4887F3F8 ON orders_other_fee');
$this->addSql('DROP INDEX IDX_A61D097EB3C719BE ON orders_other_fee');
$this->addSql('ALTER TABLE orders_other_fee ADD entity_id INT NOT NULL, DROP shipping_id, DROP ordersDetail_id');
}
}