vendor/bluue/sales-bundle/migrations/Version20240513155017.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace SalesBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240513155017 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE sales_bundle__credit_note ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  19.         $this->addSql('ALTER TABLE sales_bundle__credit_note ADD CONSTRAINT FK_3BAC0D78565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  20.         $this->addSql('CREATE INDEX IDX_3BAC0D78565851 ON sales_bundle__credit_note (establishment_id)');
  21.         $this->addSql('ALTER TABLE sales_bundle__delivery_note ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  22.         $this->addSql('ALTER TABLE sales_bundle__delivery_note ADD CONSTRAINT FK_9CC42D78565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  23.         $this->addSql('CREATE INDEX IDX_9CC42D78565851 ON sales_bundle__delivery_note (establishment_id)');
  24.         $this->addSql('ALTER TABLE sales_bundle__invoice ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  25.         $this->addSql('ALTER TABLE sales_bundle__invoice ADD CONSTRAINT FK_BB8C2B4C8565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  26.         $this->addSql('CREATE INDEX IDX_BB8C2B4C8565851 ON sales_bundle__invoice (establishment_id)');
  27.         $this->addSql('ALTER TABLE sales_bundle__order ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  28.         $this->addSql('ALTER TABLE sales_bundle__order ADD CONSTRAINT FK_FBA82B628565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  29.         $this->addSql('CREATE INDEX IDX_FBA82B628565851 ON sales_bundle__order (establishment_id)');
  30.         $this->addSql('ALTER TABLE sales_bundle__quotation ADD establishment_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  31.         $this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DF8565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  32.         $this->addSql('CREATE INDEX IDX_A0FC50DF8565851 ON sales_bundle__quotation (establishment_id)');
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         // this down() migration is auto-generated, please modify it to your needs
  37.         $this->addSql('ALTER TABLE sales_bundle__credit_note DROP FOREIGN KEY FK_3BAC0D78565851');
  38.         $this->addSql('DROP INDEX IDX_3BAC0D78565851 ON sales_bundle__credit_note');
  39.         $this->addSql('ALTER TABLE sales_bundle__credit_note DROP establishment_id');
  40.         $this->addSql('ALTER TABLE sales_bundle__delivery_note DROP FOREIGN KEY FK_9CC42D78565851');
  41.         $this->addSql('DROP INDEX IDX_9CC42D78565851 ON sales_bundle__delivery_note');
  42.         $this->addSql('ALTER TABLE sales_bundle__delivery_note DROP establishment_id');
  43.         $this->addSql('ALTER TABLE sales_bundle__invoice DROP FOREIGN KEY FK_BB8C2B4C8565851');
  44.         $this->addSql('DROP INDEX IDX_BB8C2B4C8565851 ON sales_bundle__invoice');
  45.         $this->addSql('ALTER TABLE sales_bundle__invoice DROP establishment_id');
  46.         $this->addSql('ALTER TABLE sales_bundle__order DROP FOREIGN KEY FK_FBA82B628565851');
  47.         $this->addSql('DROP INDEX IDX_FBA82B628565851 ON sales_bundle__order');
  48.         $this->addSql('ALTER TABLE sales_bundle__order DROP establishment_id');
  49.         $this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DF8565851');
  50.         $this->addSql('DROP INDEX IDX_A0FC50DF8565851 ON sales_bundle__quotation');
  51.         $this->addSql('ALTER TABLE sales_bundle__quotation DROP establishment_id');
  52.     }
  53. }