<?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 Version20211012174934 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('CREATE TABLE order_product (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE `order` ADD gift_set_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F52993984C5D4F4C FOREIGN KEY (gift_set_id) REFERENCES gift_set (id)');
$this->addSql('CREATE INDEX IDX_F52993984C5D4F4C ON `order` (gift_set_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE order_product');
$this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F52993984C5D4F4C');
$this->addSql('DROP INDEX IDX_F52993984C5D4F4C ON `order`');
$this->addSql('ALTER TABLE `order` DROP gift_set_id');
}
}