vendor/bluue/products-bundle/migrations/Version20230330131607.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 Version20230330131607 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE products_bundle__feature_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__feature_context ADD CONSTRAINT FK_13B08B35B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  12.         $this->addSql('ALTER TABLE products_bundle__feature_context ADD CONSTRAINT FK_13B08B35896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  13.         $this->addSql('ALTER TABLE products_bundle__feature_context ADD CONSTRAINT FK_13B08B35C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  14.         $this->addSql('CREATE INDEX IDX_13B08B35B03A8386 ON products_bundle__feature_context (created_by_id)');
  15.         $this->addSql('CREATE INDEX IDX_13B08B35896DBBDE ON products_bundle__feature_context (updated_by_id)');
  16.         $this->addSql('CREATE INDEX IDX_13B08B35C76F1F52 ON products_bundle__feature_context (deleted_by_id)');
  17.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__feature_context (deleted_at)');
  18.         $this->addSql('CREATE INDEX created_at ON products_bundle__feature_context (created_at)');
  19.         $this->addSql('CREATE INDEX updated_at ON products_bundle__feature_context (updated_at)');
  20.         $this->addSql('ALTER TABLE products_bundle__feature_value_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__feature_value_context ADD CONSTRAINT FK_434334D2B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  22.         $this->addSql('ALTER TABLE products_bundle__feature_value_context ADD CONSTRAINT FK_434334D2896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  23.         $this->addSql('ALTER TABLE products_bundle__feature_value_context ADD CONSTRAINT FK_434334D2C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  24.         $this->addSql('CREATE INDEX IDX_434334D2B03A8386 ON products_bundle__feature_value_context (created_by_id)');
  25.         $this->addSql('CREATE INDEX IDX_434334D2896DBBDE ON products_bundle__feature_value_context (updated_by_id)');
  26.         $this->addSql('CREATE INDEX IDX_434334D2C76F1F52 ON products_bundle__feature_value_context (deleted_by_id)');
  27.         $this->addSql('CREATE INDEX deleted_at ON products_bundle__feature_value_context (deleted_at)');
  28.         $this->addSql('CREATE INDEX created_at ON products_bundle__feature_value_context (created_at)');
  29.         $this->addSql('CREATE INDEX updated_at ON products_bundle__feature_value_context (updated_at)');
  30.         $this->addSql('ALTER TABLE products_bundle__feature_context MODIFY created_at DATETIME NOT NULL, MODIFY updated_at DATETIME NOT NULL');
  31.         $this->addSql('ALTER TABLE products_bundle__feature_value_context MODIFY created_at DATETIME NOT NULL, MODIFY updated_at DATETIME NOT NULL');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         $this->addSql('ALTER TABLE products_bundle__feature_context DROP FOREIGN KEY FK_13B08B35B03A8386');
  36.         $this->addSql('ALTER TABLE products_bundle__feature_context DROP FOREIGN KEY FK_13B08B35896DBBDE');
  37.         $this->addSql('ALTER TABLE products_bundle__feature_context DROP FOREIGN KEY FK_13B08B35C76F1F52');
  38.         $this->addSql('DROP INDEX IDX_13B08B35B03A8386 ON products_bundle__feature_context');
  39.         $this->addSql('DROP INDEX IDX_13B08B35896DBBDE ON products_bundle__feature_context');
  40.         $this->addSql('DROP INDEX IDX_13B08B35C76F1F52 ON products_bundle__feature_context');
  41.         $this->addSql('DROP INDEX deleted_at ON products_bundle__feature_context');
  42.         $this->addSql('DROP INDEX created_at ON products_bundle__feature_context');
  43.         $this->addSql('DROP INDEX updated_at ON products_bundle__feature_context');
  44.         $this->addSql('ALTER TABLE products_bundle__feature_context DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at, DROP deleted_at');
  45.         $this->addSql('ALTER TABLE products_bundle__feature_value_context DROP FOREIGN KEY FK_434334D2B03A8386');
  46.         $this->addSql('ALTER TABLE products_bundle__feature_value_context DROP FOREIGN KEY FK_434334D2896DBBDE');
  47.         $this->addSql('ALTER TABLE products_bundle__feature_value_context DROP FOREIGN KEY FK_434334D2C76F1F52');
  48.         $this->addSql('DROP INDEX IDX_434334D2B03A8386 ON products_bundle__feature_value_context');
  49.         $this->addSql('DROP INDEX IDX_434334D2896DBBDE ON products_bundle__feature_value_context');
  50.         $this->addSql('DROP INDEX IDX_434334D2C76F1F52 ON products_bundle__feature_value_context');
  51.         $this->addSql('DROP INDEX deleted_at ON products_bundle__feature_value_context');
  52.         $this->addSql('DROP INDEX created_at ON products_bundle__feature_value_context');
  53.         $this->addSql('DROP INDEX updated_at ON products_bundle__feature_value_context');
  54.         $this->addSql('ALTER TABLE products_bundle__feature_value_context DROP created_by_id, DROP updated_by_id, DROP deleted_by_id, DROP created_at, DROP updated_at, DROP deleted_at');
  55.     }
  56. }