<?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 Version20240513155017 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
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 establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__credit_note ADD CONSTRAINT FK_3BAC0D78565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('CREATE INDEX IDX_3BAC0D78565851 ON sales_bundle__credit_note (establishment_id)');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note ADD CONSTRAINT FK_9CC42D78565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('CREATE INDEX IDX_9CC42D78565851 ON sales_bundle__delivery_note (establishment_id)');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice ADD CONSTRAINT FK_BB8C2B4C8565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('CREATE INDEX IDX_BB8C2B4C8565851 ON sales_bundle__invoice (establishment_id)');
$this->addSql('ALTER TABLE sales_bundle__order ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__order ADD CONSTRAINT FK_FBA82B628565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('CREATE INDEX IDX_FBA82B628565851 ON sales_bundle__order (establishment_id)');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DF8565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('CREATE INDEX IDX_A0FC50DF8565851 ON sales_bundle__quotation (establishment_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_3BAC0D78565851');
$this->addSql('DROP INDEX IDX_3BAC0D78565851 ON sales_bundle__credit_note');
$this->addSql('ALTER TABLE sales_bundle__credit_note DROP establishment_id');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP FOREIGN KEY FK_9CC42D78565851');
$this->addSql('DROP INDEX IDX_9CC42D78565851 ON sales_bundle__delivery_note');
$this->addSql('ALTER TABLE sales_bundle__delivery_note DROP establishment_id');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP FOREIGN KEY FK_BB8C2B4C8565851');
$this->addSql('DROP INDEX IDX_BB8C2B4C8565851 ON sales_bundle__invoice');
$this->addSql('ALTER TABLE sales_bundle__invoice DROP establishment_id');
$this->addSql('ALTER TABLE sales_bundle__order DROP FOREIGN KEY FK_FBA82B628565851');
$this->addSql('DROP INDEX IDX_FBA82B628565851 ON sales_bundle__order');
$this->addSql('ALTER TABLE sales_bundle__order DROP establishment_id');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DF8565851');
$this->addSql('DROP INDEX IDX_A0FC50DF8565851 ON sales_bundle__quotation');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP establishment_id');
}
}