<?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 Version20220829173406 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` DROP FOREIGN KEY FK_F52993986C8A81A9');
$this->addSql('DROP INDEX IDX_F52993986C8A81A9 ON `order`');
$this->addSql('ALTER TABLE `order` CHANGE products_id product_id INT NOT NULL');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F52993984584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('CREATE INDEX IDX_F52993984584665A ON `order` (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` DROP FOREIGN KEY FK_F52993984584665A');
$this->addSql('DROP INDEX IDX_F52993984584665A ON `order`');
$this->addSql('ALTER TABLE `order` CHANGE product_id products_id INT NOT NULL');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F52993986C8A81A9 FOREIGN KEY (products_id) REFERENCES product (id)');
$this->addSql('CREATE INDEX IDX_F52993986C8A81A9 ON `order` (products_id)');
}
}