<?php
declare(strict_types=1);
namespace ShipmentsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230811073057 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE shipments_bundle__picking_history (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', burst_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) NOT 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)\', quantity NUMERIC(20, 6) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_F9B6EAE7CC799A1F (burst_id), INDEX IDX_F9B6EAE74584665A (product_id), INDEX IDX_F9B6EAE79941A932 (declination_id), INDEX IDX_F9B6EAE7B03A8386 (created_by_id), INDEX IDX_F9B6EAE7896DBBDE (updated_by_id), INDEX created_at (created_at), INDEX updated_at (updated_at), INDEX quantity (quantity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7CC799A1F FOREIGN KEY (burst_id) REFERENCES shipments_bundle__burst (id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE74584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE79941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7CC799A1F');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE74584665A');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE79941A932');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7B03A8386');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7896DBBDE');
$this->addSql('DROP TABLE shipments_bundle__picking_history');
}
}