<?php
declare(strict_types=1);
namespace ImportProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221206155307 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE import_products_bundle__import (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', file_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', tax_rule_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', currency_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', context_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)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', category_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', supplier_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', number INT NOT NULL, status_name VARCHAR(50) DEFAULT NULL, nb_products_success INT DEFAULT NULL, nb_products_error INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_D1BBFCC993CB796C (file_id), INDEX IDX_D1BBFCC93506A35B (tax_rule_id), INDEX IDX_D1BBFCC938248176 (currency_id), INDEX IDX_D1BBFCC96B00C1CF (context_id), INDEX IDX_D1BBFCC9B03A8386 (created_by_id), INDEX IDX_D1BBFCC9896DBBDE (updated_by_id), INDEX IDX_D1BBFCC9C76F1F52 (deleted_by_id), INDEX IDX_D1BBFCC912469DE2 (category_id), INDEX IDX_D1BBFCC92ADD6D8C (supplier_id), INDEX status_name (status_name), INDEX nb_products_success (nb_products_success), INDEX nb_products_error (nb_products_error), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE import_products_bundle__import_error (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', import_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)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', description LONGTEXT NOT NULL, options JSON NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_2AFE3451B6A263D9 (import_id), INDEX IDX_2AFE3451B03A8386 (created_by_id), INDEX IDX_2AFE3451896DBBDE (updated_by_id), INDEX IDX_2AFE3451C76F1F52 (deleted_by_id), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC993CB796C FOREIGN KEY (file_id) REFERENCES file_manager (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC93506A35B FOREIGN KEY (tax_rule_id) REFERENCES tax_rule (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC938248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC96B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC9B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC9896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC9C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE import_products_bundle__import_error ADD CONSTRAINT FK_2AFE3451B6A263D9 FOREIGN KEY (import_id) REFERENCES import_products_bundle__import (id)');
$this->addSql('ALTER TABLE import_products_bundle__import_error ADD CONSTRAINT FK_2AFE3451B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE import_products_bundle__import_error ADD CONSTRAINT FK_2AFE3451896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE import_products_bundle__import_error ADD CONSTRAINT FK_2AFE3451C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC993CB796C');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC93506A35B');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC938248176');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC96B00C1CF');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC9B03A8386');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC9896DBBDE');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC9C76F1F52');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC912469DE2');
$this->addSql('ALTER TABLE import_products_bundle__import DROP FOREIGN KEY FK_D1BBFCC92ADD6D8C');
$this->addSql('ALTER TABLE import_products_bundle__import_error DROP FOREIGN KEY FK_2AFE3451B6A263D9');
$this->addSql('ALTER TABLE import_products_bundle__import_error DROP FOREIGN KEY FK_2AFE3451B03A8386');
$this->addSql('ALTER TABLE import_products_bundle__import_error DROP FOREIGN KEY FK_2AFE3451896DBBDE');
$this->addSql('ALTER TABLE import_products_bundle__import_error DROP FOREIGN KEY FK_2AFE3451C76F1F52');
$this->addSql('DROP TABLE import_products_bundle__import');
$this->addSql('DROP TABLE import_products_bundle__import_error');
}
}