<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230119153640 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE products_bundle__related_product (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', parent_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', child_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', position INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_2CA95B4A727ACA70 (parent_id), INDEX IDX_2CA95B4ADD62C21B (child_id), INDEX IDX_2CA95B4AB03A8386 (created_by_id), INDEX IDX_2CA95B4A896DBBDE (updated_by_id), INDEX IDX_2CA95B4AC76F1F52 (deleted_by_id), INDEX position (position), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__related_product ADD CONSTRAINT FK_2CA95B4A727ACA70 FOREIGN KEY (parent_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE products_bundle__related_product ADD CONSTRAINT FK_2CA95B4ADD62C21B FOREIGN KEY (child_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE products_bundle__related_product ADD CONSTRAINT FK_2CA95B4AB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__related_product ADD CONSTRAINT FK_2CA95B4A896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__related_product ADD CONSTRAINT FK_2CA95B4AC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__related_product DROP FOREIGN KEY FK_2CA95B4A727ACA70');
$this->addSql('ALTER TABLE products_bundle__related_product DROP FOREIGN KEY FK_2CA95B4ADD62C21B');
$this->addSql('ALTER TABLE products_bundle__related_product DROP FOREIGN KEY FK_2CA95B4AB03A8386');
$this->addSql('ALTER TABLE products_bundle__related_product DROP FOREIGN KEY FK_2CA95B4A896DBBDE');
$this->addSql('ALTER TABLE products_bundle__related_product DROP FOREIGN KEY FK_2CA95B4AC76F1F52');
$this->addSql('DROP TABLE products_bundle__related_product');
}
}