<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220601085457 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 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), 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), 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 ADD CONSTRAINT FK_D1BBFCC912469DE2 FOREIGN KEY (category_id) REFERENCES categories_bundle__category (id)');
$this->addSql('ALTER TABLE import_products_bundle__import ADD CONSTRAINT FK_D1BBFCC92ADD6D8C FOREIGN KEY (supplier_id) REFERENCES suppliers_bundle__supplier (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)');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE import_products_bundle__import_error DROP FOREIGN KEY FK_2AFE3451B6A263D9');
$this->addSql('DROP TABLE import_products_bundle__import');
$this->addSql('DROP TABLE import_products_bundle__import_error');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1.000000000000\' NOT NULL');
}
}