<?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 Version20220518143240 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 inventories_bundle__inventory (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', warehouse_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', brand_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)\', validated_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)\', reference VARCHAR(128) DEFAULT NULL, name VARCHAR(128) NOT NULL, x VARCHAR(128) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, validated_at DATETIME DEFAULT NULL, INDEX IDX_F5586DDC5080ECDE (warehouse_id), INDEX IDX_F5586DDC44F5D008 (brand_id), INDEX IDX_F5586DDCB03A8386 (created_by_id), INDEX IDX_F5586DDC896DBBDE (updated_by_id), INDEX IDX_F5586DDCC76F1F52 (deleted_by_id), INDEX IDX_F5586DDCC69DE5E5 (validated_by_id), INDEX IDX_F5586DDC12469DE2 (category_id), INDEX IDX_F5586DDC2ADD6D8C (supplier_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE inventories_bundle__inventory_original_product (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', inventory_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', 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)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_52C557F9EEA759 (inventory_id), INDEX IDX_52C557F4584665A (product_id), INDEX IDX_52C557F9941A932 (declination_id), INDEX IDX_52C557FB03A8386 (created_by_id), INDEX IDX_52C557F896DBBDE (updated_by_id), INDEX IDX_52C557FC76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE inventories_bundle__inventory_product (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', inventory_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', 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)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_7CD8FE119EEA759 (inventory_id), INDEX IDX_7CD8FE114584665A (product_id), INDEX IDX_7CD8FE119941A932 (declination_id), INDEX IDX_7CD8FE11B03A8386 (created_by_id), INDEX IDX_7CD8FE11896DBBDE (updated_by_id), INDEX IDX_7CD8FE11C76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE inventories_bundle__inventory_product_quantity (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', inventory_product_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', stock_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', sub_location_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)\', quantity INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_4A5838466A33D9 (inventory_product_id), INDEX IDX_4A58384DCD6110 (stock_id), INDEX IDX_4A5838464D218E (location_id), INDEX IDX_4A58384E3B45410 (sub_location_id), INDEX IDX_4A58384B03A8386 (created_by_id), INDEX IDX_4A58384896DBBDE (updated_by_id), INDEX IDX_4A58384C76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC5080ECDE FOREIGN KEY (warehouse_id) REFERENCES stocks_bundle__warehouse (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC44F5D008 FOREIGN KEY (brand_id) REFERENCES products_bundle__brand (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDCB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDCC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDCC69DE5E5 FOREIGN KEY (validated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC12469DE2 FOREIGN KEY (category_id) REFERENCES categories_bundle__category (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES suppliers_bundle__supplier (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557F9EEA759 FOREIGN KEY (inventory_id) REFERENCES inventories_bundle__inventory (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557F4584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557F9941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557FB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD CONSTRAINT FK_52C557FC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE119EEA759 FOREIGN KEY (inventory_id) REFERENCES inventories_bundle__inventory (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE114584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE119941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE11B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE11896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product ADD CONSTRAINT FK_7CD8FE11C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A5838466A33D9 FOREIGN KEY (inventory_product_id) REFERENCES inventories_bundle__inventory_product (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A58384DCD6110 FOREIGN KEY (stock_id) REFERENCES stocks_bundle__stock (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A5838464D218E FOREIGN KEY (location_id) REFERENCES stocks_bundle__location (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A58384E3B45410 FOREIGN KEY (sub_location_id) REFERENCES stocks_bundle__sub_location (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A58384B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A58384896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity ADD CONSTRAINT FK_4A58384C76F1F52 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 inventories_bundle__inventory_original_product DROP FOREIGN KEY FK_52C557F9EEA759');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product DROP FOREIGN KEY FK_7CD8FE119EEA759');
$this->addSql('ALTER TABLE inventories_bundle__inventory_product_quantity DROP FOREIGN KEY FK_4A5838466A33D9');
$this->addSql('DROP TABLE inventories_bundle__inventory');
$this->addSql('DROP TABLE inventories_bundle__inventory_original_product');
$this->addSql('DROP TABLE inventories_bundle__inventory_product');
$this->addSql('DROP TABLE inventories_bundle__inventory_product_quantity');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1.000000000000\' NOT NULL');
}
}