<?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 Version20230216095253 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD commercial_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD CONSTRAINT FK_3BAC0D77854071C FOREIGN KEY (commercial_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_3BAC0D77854071C ON sales_bundle__credit_note (commercial_id)');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD commercial_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD CONSTRAINT FK_9CC42D77854071C FOREIGN KEY (commercial_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_9CC42D77854071C ON sales_bundle__delivery_note (commercial_id)');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD commercial_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD CONSTRAINT FK_BB8C2B4C7854071C FOREIGN KEY (commercial_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_BB8C2B4C7854071C ON sales_bundle__invoice (commercial_id)');
$this->addSql('ALTER TABLE sales_bundle__order ADD commercial_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__order ADD CONSTRAINT FK_FBA82B627854071C FOREIGN KEY (commercial_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_FBA82B627854071C ON sales_bundle__order (commercial_id)');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD commercial_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DF7854071C FOREIGN KEY (commercial_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_A0FC50DF7854071C ON sales_bundle__quotation (commercial_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP FOREIGN KEY FK_3BAC0D77854071C');
$this->addSql('DROP INDEX IDX_3BAC0D77854071C ON sales_bundle__credit_note');
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP commercial_id');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP FOREIGN KEY FK_9CC42D77854071C');
$this->addSql('DROP INDEX IDX_9CC42D77854071C ON sales_bundle__delivery_note');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP commercial_id');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP FOREIGN KEY FK_BB8C2B4C7854071C');
$this->addSql('DROP INDEX IDX_BB8C2B4C7854071C ON sales_bundle__invoice');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP commercial_id');
$this->addSql('ALTER TABLE sales_bundle__order DROP FOREIGN KEY FK_FBA82B627854071C');
$this->addSql('DROP INDEX IDX_FBA82B627854071C ON sales_bundle__order');
$this->addSql('ALTER TABLE sales_bundle__order DROP commercial_id');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DF7854071C');
$this->addSql('DROP INDEX IDX_A0FC50DF7854071C ON sales_bundle__quotation');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP commercial_id');
}
}