<?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 Version20220902153818 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 order_item DROP FOREIGN KEY FK_52EA1F09F972E70B');
$this->addSql('DROP INDEX IDX_52EA1F09F972E70B ON order_item');
$this->addSql('ALTER TABLE order_item CHANGE product_shop_mode_id product_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE order_item ADD CONSTRAINT FK_52EA1F094584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('CREATE INDEX IDX_52EA1F094584665A ON order_item (product_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE order_item DROP FOREIGN KEY FK_52EA1F094584665A');
$this->addSql('DROP INDEX IDX_52EA1F094584665A ON order_item');
$this->addSql('ALTER TABLE order_item CHANGE product_id product_shop_mode_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE order_item ADD CONSTRAINT FK_52EA1F09F972E70B FOREIGN KEY (product_shop_mode_id) REFERENCES product_shop_mode (id)');
$this->addSql('CREATE INDEX IDX_52EA1F09F972E70B ON order_item (product_shop_mode_id)');
}
}