<?php
declare(strict_types=1);
namespace InventoriesBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230405140456 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE inventories_bundle__inventory_original_product_quantity (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', inventory_original_product_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', stock_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_DB3F60ABB07E756E (inventory_original_product_id), INDEX IDX_DB3F60ABD98387BA (stock_location_id), INDEX IDX_DB3F60ABB03A8386 (created_by_id), INDEX IDX_DB3F60AB896DBBDE (updated_by_id), INDEX IDX_DB3F60ABC76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity ADD CONSTRAINT FK_DB3F60ABB07E756E FOREIGN KEY (inventory_original_product_id) REFERENCES inventories_bundle__inventory_original_product (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity ADD CONSTRAINT FK_DB3F60ABD98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity ADD CONSTRAINT FK_DB3F60ABB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity ADD CONSTRAINT FK_DB3F60AB896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity ADD CONSTRAINT FK_DB3F60ABC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product DROP quantity');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity DROP FOREIGN KEY FK_DB3F60ABB07E756E');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity DROP FOREIGN KEY FK_DB3F60ABD98387BA');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity DROP FOREIGN KEY FK_DB3F60ABB03A8386');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity DROP FOREIGN KEY FK_DB3F60AB896DBBDE');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product_quantity DROP FOREIGN KEY FK_DB3F60ABC76F1F52');
$this->addSql('DROP TABLE inventories_bundle__inventory_original_product_quantity');
$this->addSql('ALTER TABLE inventories_bundle__inventory_original_product ADD quantity INT NOT NULL');
}
}