<?php
declare(strict_types=1);
namespace StocksBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240531093648 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE stocks_bundle__mass_stock_removal (id BINARY(16) NOT 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)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, validated_at DATETIME DEFAULT NULL, INDEX IDX_2C34EDD6B03A8386 (created_by_id), INDEX IDX_2C34EDD6896DBBDE (updated_by_id), INDEX IDX_2C34EDD6C76F1F52 (deleted_by_id), INDEX IDX_2C34EDD6C69DE5E5 (validated_by_id), INDEX validated_at (validated_at), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE stocks_bundle__mass_stock_removal_line (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', mass_stock_removal_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)\', stock_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', stock_movement_reason_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_B4C2F1135685615C (mass_stock_removal_id), INDEX IDX_B4C2F1134584665A (product_id), INDEX IDX_B4C2F1139941A932 (declination_id), INDEX IDX_B4C2F113D98387BA (stock_location_id), INDEX IDX_B4C2F113D0E7D5DE (stock_movement_reason_id), INDEX IDX_B4C2F113B03A8386 (created_by_id), INDEX IDX_B4C2F113896DBBDE (updated_by_id), INDEX IDX_B4C2F113C76F1F52 (deleted_by_id), INDEX quantity (quantity), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal ADD CONSTRAINT FK_2C34EDD6B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal ADD CONSTRAINT FK_2C34EDD6896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal ADD CONSTRAINT FK_2C34EDD6C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal ADD CONSTRAINT FK_2C34EDD6C69DE5E5 FOREIGN KEY (validated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F1135685615C FOREIGN KEY (mass_stock_removal_id) REFERENCES stocks_bundle__mass_stock_removal (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F1134584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F1139941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F113D98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F113D0E7D5DE FOREIGN KEY (stock_movement_reason_id) REFERENCES stocks_bundle__stock_movement_reason (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F113B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F113896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line ADD CONSTRAINT FK_B4C2F113C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal DROP FOREIGN KEY FK_2C34EDD6B03A8386');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal DROP FOREIGN KEY FK_2C34EDD6896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal DROP FOREIGN KEY FK_2C34EDD6C76F1F52');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal DROP FOREIGN KEY FK_2C34EDD6C69DE5E5');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F1135685615C');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F1134584665A');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F1139941A932');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F113D98387BA');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F113D0E7D5DE');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F113B03A8386');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F113896DBBDE');
$this->addSql('ALTER TABLE stocks_bundle__mass_stock_removal_line DROP FOREIGN KEY FK_B4C2F113C76F1F52');
$this->addSql('DROP TABLE stocks_bundle__mass_stock_removal');
$this->addSql('DROP TABLE stocks_bundle__mass_stock_removal_line');
}
}