<?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 Version20211231092046 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 shop_order_item_credit_invoice_item (id INT UNSIGNED NOT NULL, order_item_id INT UNSIGNED DEFAULT NULL, UNIQUE INDEX UNIQ_727F46CE415FB15 (order_item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shop_order_item_credit_invoice_item ADD CONSTRAINT FK_727F46CE415FB15 FOREIGN KEY (order_item_id) REFERENCES shop_order_item (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE shop_order_item_credit_invoice_item ADD CONSTRAINT FK_727F46CBF396750 FOREIGN KEY (id) REFERENCES shop_invoice_item (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE shop_order_item_credit_invoice_item');
}
}