vendor/bluue/products-bundle/migrations/Version20230331091204.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace ProductsBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20230331091204 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE products_bundle__attribute_context ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD deleted_at DATETIME DEFAULT NULL');
  11.         $this->addSql('ALTER TABLE products_bundle__attribute_context ADD CONSTRAINT FK_2BEB560CB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  12.         $this->addSql('ALTER TABLE products_bundle__attribute_context ADD CONSTRAINT FK_2BEB560C896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  13.         $this->addSql('ALTER TABLE products_bundle__attribute_context ADD CONSTRAINT FK_2BEB560CC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  14.         $this->addSql('CREATE INDEX IDX_2BEB560CB03A8386 ON products_bundle__attribute_context (created_by_id)');
  15.         $this->addSql('CREATE INDEX IDX_2BEB560C896DBBDE ON products_bundle__attribute_context (updated_by_id)');
  16.         $this->addSql('CREATE INDEX IDX_2BEB560CC76F1F52 ON products_bundle__attribute_context (deleted_by_id)');
  17.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__attribute_context (deleted_at)');
  18.         $this->addSql('CREATE INDEX created_at ON products_bundle__attribute_context (created_at)');
  19.         $this->addSql('CREATE INDEX updated_at ON products_bundle__attribute_context (updated_at)');
  20.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD deleted_at DATETIME DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD CONSTRAINT FK_4A85C4B8B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  22.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD CONSTRAINT FK_4A85C4B8896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  23.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD CONSTRAINT FK_4A85C4B8C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  24.         $this->addSql('CREATE INDEX IDX_4A85C4B8B03A8386 ON products_bundle__attribute_group_context (created_by_id)');
  25.         $this->addSql('CREATE INDEX IDX_4A85C4B8896DBBDE ON products_bundle__attribute_group_context (updated_by_id)');
  26.         $this->addSql('CREATE INDEX IDX_4A85C4B8C76F1F52 ON products_bundle__attribute_group_context (deleted_by_id)');
  27.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__attribute_group_context (deleted_at)');
  28.         $this->addSql('CREATE INDEX created_at ON products_bundle__attribute_group_context (created_at)');
  29.         $this->addSql('CREATE INDEX updated_at ON products_bundle__attribute_group_context (updated_at)');
  30.         $this->addSql('ALTER TABLE products_bundle__brand_context ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD deleted_at DATETIME DEFAULT NULL');
  31.         $this->addSql('ALTER TABLE products_bundle__brand_context ADD CONSTRAINT FK_238239EFB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  32.         $this->addSql('ALTER TABLE products_bundle__brand_context ADD CONSTRAINT FK_238239EF896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  33.         $this->addSql('ALTER TABLE products_bundle__brand_context ADD CONSTRAINT FK_238239EFC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  34.         $this->addSql('CREATE INDEX IDX_238239EFB03A8386 ON products_bundle__brand_context (created_by_id)');
  35.         $this->addSql('CREATE INDEX IDX_238239EF896DBBDE ON products_bundle__brand_context (updated_by_id)');
  36.         $this->addSql('CREATE INDEX IDX_238239EFC76F1F52 ON products_bundle__brand_context (deleted_by_id)');
  37.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__brand_context (deleted_at)');
  38.         $this->addSql('CREATE INDEX created_at ON products_bundle__brand_context (created_at)');
  39.         $this->addSql('CREATE INDEX updated_at ON products_bundle__brand_context (updated_at)');
  40.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__declination_context (deleted_at)');
  41.         $this->addSql('CREATE INDEX created_at ON products_bundle__declination_context (created_at)');
  42.         $this->addSql('CREATE INDEX updated_at ON products_bundle__declination_context (updated_at)');
  43.         $this->addSql('ALTER TABLE products_bundle__attribute_context MODIFY created_at DATETIME NOT NULL, MODIFY updated_at DATETIME NOT NULL');
  44.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context MODIFY created_at DATETIME NOT NULL, MODIFY updated_at DATETIME NOT NULL');
  45.         $this->addSql('ALTER TABLE products_bundle__brand_context MODIFY created_at DATETIME NOT NULL, MODIFY updated_at DATETIME NOT NULL');
  46.     }
  47.     public function down(Schema $schema): void
  48.     {
  49.         $this->addSql('ALTER TABLE products_bundle__attribute_context DROP FOREIGN KEY FK_2BEB560CB03A8386');
  50.         $this->addSql('ALTER TABLE products_bundle__attribute_context DROP FOREIGN KEY FK_2BEB560C896DBBDE');
  51.         $this->addSql('ALTER TABLE products_bundle__attribute_context DROP FOREIGN KEY FK_2BEB560CC76F1F52');
  52.         $this->addSql('DROP INDEX IDX_2BEB560CB03A8386 ON products_bundle__attribute_context');
  53.         $this->addSql('DROP INDEX IDX_2BEB560C896DBBDE ON products_bundle__attribute_context');
  54.         $this->addSql('DROP INDEX IDX_2BEB560CC76F1F52 ON products_bundle__attribute_context');
  55.         $this->addSql('DROP INDEX deleted_at ON products_bundle__attribute_context');
  56.         $this->addSql('DROP INDEX created_at ON products_bundle__attribute_context');
  57.         $this->addSql('DROP INDEX updated_at ON products_bundle__attribute_context');
  58.         $this->addSql('ALTER TABLE products_bundle__attribute_context DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at, DROP deleted_at');
  59.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context DROP FOREIGN KEY FK_4A85C4B8B03A8386');
  60.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context DROP FOREIGN KEY FK_4A85C4B8896DBBDE');
  61.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context DROP FOREIGN KEY FK_4A85C4B8C76F1F52');
  62.         $this->addSql('DROP INDEX IDX_4A85C4B8B03A8386 ON products_bundle__attribute_group_context');
  63.         $this->addSql('DROP INDEX IDX_4A85C4B8896DBBDE ON products_bundle__attribute_group_context');
  64.         $this->addSql('DROP INDEX IDX_4A85C4B8C76F1F52 ON products_bundle__attribute_group_context');
  65.         $this->addSql('DROP INDEX deleted_at ON products_bundle__attribute_group_context');
  66.         $this->addSql('DROP INDEX created_at ON products_bundle__attribute_group_context');
  67.         $this->addSql('DROP INDEX updated_at ON products_bundle__attribute_group_context');
  68.         $this->addSql('ALTER TABLE products_bundle__attribute_group_context DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at, DROP deleted_at');
  69.         $this->addSql('ALTER TABLE products_bundle__brand_context DROP FOREIGN KEY FK_238239EFB03A8386');
  70.         $this->addSql('ALTER TABLE products_bundle__brand_context DROP FOREIGN KEY FK_238239EF896DBBDE');
  71.         $this->addSql('ALTER TABLE products_bundle__brand_context DROP FOREIGN KEY FK_238239EFC76F1F52');
  72.         $this->addSql('DROP INDEX IDX_238239EFB03A8386 ON products_bundle__brand_context');
  73.         $this->addSql('DROP INDEX IDX_238239EF896DBBDE ON products_bundle__brand_context');
  74.         $this->addSql('DROP INDEX IDX_238239EFC76F1F52 ON products_bundle__brand_context');
  75.         $this->addSql('DROP INDEX deleted_at ON products_bundle__brand_context');
  76.         $this->addSql('DROP INDEX created_at ON products_bundle__brand_context');
  77.         $this->addSql('DROP INDEX updated_at ON products_bundle__brand_context');
  78.         $this->addSql('ALTER TABLE products_bundle__brand_context DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at, DROP deleted_at');
  79.         $this->addSql('DROP INDEX deleted_at ON products_bundle__declination_context');
  80.         $this->addSql('DROP INDEX created_at ON products_bundle__declination_context');
  81.         $this->addSql('DROP INDEX updated_at ON products_bundle__declination_context');
  82.     }
  83. }