<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230118160219 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE products_bundle__substitute_product (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', substitute_product_context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', substitute_declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_A685F3F8F8679EE4 (product_context_id), INDEX IDX_A685F3F89941A932 (declination_id), INDEX IDX_A685F3F826560288 (substitute_product_context_id), INDEX IDX_A685F3F86F642EC2 (substitute_declination_id), INDEX IDX_A685F3F8B03A8386 (created_by_id), INDEX IDX_A685F3F8896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8F8679EE4 FOREIGN KEY (product_context_id) REFERENCES products_bundle__product_context (id)');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F89941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F826560288 FOREIGN KEY (substitute_product_context_id) REFERENCES products_bundle__product_context (id)');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F86F642EC2 FOREIGN KEY (substitute_declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE products_bundle__substitute_product');
}
}