<?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 Version20231120211310 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD CONSTRAINT FK_3BAC0D71E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD CONSTRAINT FK_3BAC0D7F9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_3BAC0D71E7D55D4 ON sales_bundle__credit_note (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_3BAC0D7F9E4B26E ON sales_bundle__credit_note (delivery_contact_id)');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD CONSTRAINT FK_9CC42D71E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD CONSTRAINT FK_9CC42D7F9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_9CC42D71E7D55D4 ON sales_bundle__delivery_note (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_9CC42D7F9E4B26E ON sales_bundle__delivery_note (delivery_contact_id)');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD CONSTRAINT FK_BB8C2B4C1E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD CONSTRAINT FK_BB8C2B4CF9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_BB8C2B4C1E7D55D4 ON sales_bundle__invoice (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_BB8C2B4CF9E4B26E ON sales_bundle__invoice (delivery_contact_id)');
$this->addSql('ALTER TABLE sales_bundle__order ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__order ADD CONSTRAINT FK_FBA82B621E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE sales_bundle__order ADD CONSTRAINT FK_FBA82B62F9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_FBA82B621E7D55D4 ON sales_bundle__order (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_FBA82B62F9E4B26E ON sales_bundle__order (delivery_contact_id)');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DF1E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DFF9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('CREATE INDEX IDX_A0FC50DF1E7D55D4 ON sales_bundle__quotation (invoice_contact_id)');
$this->addSql('CREATE INDEX IDX_A0FC50DFF9E4B26E ON sales_bundle__quotation (delivery_contact_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP FOREIGN KEY FK_3BAC0D71E7D55D4');
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP FOREIGN KEY FK_3BAC0D7F9E4B26E');
$this->addSql('DROP INDEX IDX_3BAC0D71E7D55D4 ON sales_bundle__credit_note');
$this->addSql('DROP INDEX IDX_3BAC0D7F9E4B26E ON sales_bundle__credit_note');
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP invoice_contact_id, DROP delivery_contact_id');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP FOREIGN KEY FK_9CC42D71E7D55D4');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP FOREIGN KEY FK_9CC42D7F9E4B26E');
$this->addSql('DROP INDEX IDX_9CC42D71E7D55D4 ON sales_bundle__delivery_note');
$this->addSql('DROP INDEX IDX_9CC42D7F9E4B26E ON sales_bundle__delivery_note');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP invoice_contact_id, DROP delivery_contact_id');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP FOREIGN KEY FK_BB8C2B4C1E7D55D4');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP FOREIGN KEY FK_BB8C2B4CF9E4B26E');
$this->addSql('DROP INDEX IDX_BB8C2B4C1E7D55D4 ON sales_bundle__invoice');
$this->addSql('DROP INDEX IDX_BB8C2B4CF9E4B26E ON sales_bundle__invoice');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP invoice_contact_id, DROP delivery_contact_id');
$this->addSql('ALTER TABLE sales_bundle__order DROP FOREIGN KEY FK_FBA82B621E7D55D4');
$this->addSql('ALTER TABLE sales_bundle__order DROP FOREIGN KEY FK_FBA82B62F9E4B26E');
$this->addSql('DROP INDEX IDX_FBA82B621E7D55D4 ON sales_bundle__order');
$this->addSql('DROP INDEX IDX_FBA82B62F9E4B26E ON sales_bundle__order');
$this->addSql('ALTER TABLE sales_bundle__order DROP invoice_contact_id, DROP delivery_contact_id');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DF1E7D55D4');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DFF9E4B26E');
$this->addSql('DROP INDEX IDX_A0FC50DF1E7D55D4 ON sales_bundle__quotation');
$this->addSql('DROP INDEX IDX_A0FC50DFF9E4B26E ON sales_bundle__quotation');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP invoice_contact_id, DROP delivery_contact_id');
}
}