<?php
declare(strict_types=1);
namespace SalesBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230206105955 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE sales_bundle__credit_note_line ADD is_pack TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line ADD is_pack TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__invoice_line ADD is_pack TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__order_line ADD is_pack TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__quotation_line ADD is_pack TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line ADD pack_parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line ADD CONSTRAINT FK_224DA1A718E465C6 FOREIGN KEY (pack_parent_id) REFERENCES sales_bundle__credit_note_line (id)');
$this->addSql('CREATE INDEX IDX_224DA1A718E465C6 ON sales_bundle__credit_note_line (pack_parent_id)');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line ADD pack_parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line ADD CONSTRAINT FK_CF8E237F18E465C6 FOREIGN KEY (pack_parent_id) REFERENCES sales_bundle__delivery_note_line (id)');
$this->addSql('CREATE INDEX IDX_CF8E237F18E465C6 ON sales_bundle__delivery_note_line (pack_parent_id)');
$this->addSql('ALTER TABLE sales_bundle__invoice_line ADD pack_parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice_line ADD CONSTRAINT FK_891FCC0D18E465C6 FOREIGN KEY (pack_parent_id) REFERENCES sales_bundle__invoice_line (id)');
$this->addSql('CREATE INDEX IDX_891FCC0D18E465C6 ON sales_bundle__invoice_line (pack_parent_id)');
$this->addSql('ALTER TABLE sales_bundle__order_line ADD pack_parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__order_line ADD CONSTRAINT FK_38D3FC5118E465C6 FOREIGN KEY (pack_parent_id) REFERENCES sales_bundle__order_line (id)');
$this->addSql('CREATE INDEX IDX_38D3FC5118E465C6 ON sales_bundle__order_line (pack_parent_id)');
$this->addSql('ALTER TABLE sales_bundle__quotation_line ADD pack_parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation_line ADD CONSTRAINT FK_5E40159A18E465C6 FOREIGN KEY (pack_parent_id) REFERENCES sales_bundle__quotation_line (id)');
$this->addSql('CREATE INDEX IDX_5E40159A18E465C6 ON sales_bundle__quotation_line (pack_parent_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE sales_bundle__credit_note_line DROP is_pack');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line DROP is_pack');
$this->addSql('ALTER TABLE sales_bundle__invoice_line DROP is_pack');
$this->addSql('ALTER TABLE sales_bundle__order_line DROP is_pack');
$this->addSql('ALTER TABLE sales_bundle__quotation_line DROP is_pack');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line DROP FOREIGN KEY FK_224DA1A718E465C6');
$this->addSql('DROP INDEX IDX_224DA1A718E465C6 ON sales_bundle__credit_note_line');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line DROP pack_parent_id');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line DROP FOREIGN KEY FK_CF8E237F18E465C6');
$this->addSql('DROP INDEX IDX_CF8E237F18E465C6 ON sales_bundle__delivery_note_line');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line DROP pack_parent_id');
$this->addSql('ALTER TABLE sales_bundle__invoice_line DROP FOREIGN KEY FK_891FCC0D18E465C6');
$this->addSql('DROP INDEX IDX_891FCC0D18E465C6 ON sales_bundle__invoice_line');
$this->addSql('ALTER TABLE sales_bundle__invoice_line DROP pack_parent_id');
$this->addSql('ALTER TABLE sales_bundle__order_line DROP FOREIGN KEY FK_38D3FC5118E465C6');
$this->addSql('DROP INDEX IDX_38D3FC5118E465C6 ON sales_bundle__order_line');
$this->addSql('ALTER TABLE sales_bundle__order_line DROP pack_parent_id');
$this->addSql('ALTER TABLE sales_bundle__quotation_line DROP FOREIGN KEY FK_5E40159A18E465C6');
$this->addSql('DROP INDEX IDX_5E40159A18E465C6 ON sales_bundle__quotation_line');
$this->addSql('ALTER TABLE sales_bundle__quotation_line DROP pack_parent_id');
}
}