<?php
declare(strict_types=1);
namespace ShipmentsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240625081608 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE shipments_bundle__order_preparation_history (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', burst_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', order_options_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', order_line_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)\', controlled_quantity NUMERIC(20, 6) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_F35CDD6BCC799A1F (burst_id), INDEX IDX_F35CDD6B8901F8A4 (order_options_id), INDEX IDX_F35CDD6BBB01DC09 (order_line_id), INDEX IDX_F35CDD6BB03A8386 (created_by_id), INDEX IDX_F35CDD6B896DBBDE (updated_by_id), INDEX created_at (created_at), INDEX updated_at (updated_at), INDEX controlled_quantity (controlled_quantity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history ADD CONSTRAINT FK_F35CDD6BCC799A1F FOREIGN KEY (burst_id) REFERENCES shipments_bundle__burst (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history ADD CONSTRAINT FK_F35CDD6B8901F8A4 FOREIGN KEY (order_options_id) REFERENCES shipments_bundle__order_options (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history ADD CONSTRAINT FK_F35CDD6BBB01DC09 FOREIGN KEY (order_line_id) REFERENCES sales_bundle__order_line (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history ADD CONSTRAINT FK_F35CDD6BB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history ADD CONSTRAINT FK_F35CDD6B896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_options ADD shopping_cart_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD shopping_cart_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE shipments_bundle__order_options ADD CONSTRAINT FK_3F7A5CB145F80CD FOREIGN KEY (shopping_cart_id) REFERENCES shipments_bundle__shopping_cart (id)');
$this->addSql('ALTER TABLE shipments_bundle__order_options ADD CONSTRAINT FK_3F7A5CB12CE932F6 FOREIGN KEY (shopping_cart_location_id) REFERENCES shipments_bundle__shopping_cart_location (id)');
$this->addSql('CREATE INDEX IDX_3F7A5CB145F80CD ON shipments_bundle__order_options (shopping_cart_id)');
$this->addSql('CREATE INDEX IDX_3F7A5CB12CE932F6 ON shipments_bundle__order_options (shopping_cart_location_id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD order_line_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7BB01DC09 FOREIGN KEY (order_line_id) REFERENCES sales_bundle__order_line (id)');
$this->addSql('CREATE INDEX IDX_F9B6EAE7BB01DC09 ON shipments_bundle__picking_history (order_line_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history DROP FOREIGN KEY FK_F35CDD6BCC799A1F');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history DROP FOREIGN KEY FK_F35CDD6B8901F8A4');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history DROP FOREIGN KEY FK_F35CDD6BBB01DC09');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history DROP FOREIGN KEY FK_F35CDD6BB03A8386');
$this->addSql('ALTER TABLE shipments_bundle__order_preparation_history DROP FOREIGN KEY FK_F35CDD6B896DBBDE');
$this->addSql('DROP TABLE shipments_bundle__order_preparation_history');
$this->addSql('ALTER TABLE shipments_bundle__order_options DROP FOREIGN KEY FK_3F7A5CB145F80CD');
$this->addSql('ALTER TABLE shipments_bundle__order_options DROP FOREIGN KEY FK_3F7A5CB12CE932F6');
$this->addSql('DROP INDEX IDX_3F7A5CB145F80CD ON shipments_bundle__order_options');
$this->addSql('DROP INDEX IDX_3F7A5CB12CE932F6 ON shipments_bundle__order_options');
$this->addSql('ALTER TABLE shipments_bundle__order_options DROP shopping_cart_id, DROP shopping_cart_location_id');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7BB01DC09');
$this->addSql('DROP INDEX IDX_F9B6EAE7BB01DC09 ON shipments_bundle__picking_history');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP order_line_id');
}
}