vendor/bluue/products-bundle/migrations/Version20230118160219.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 Version20230118160219 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('CREATE TABLE products_bundle__substitute_product (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', substitute_product_context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', substitute_declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_A685F3F8F8679EE4 (product_context_id), INDEX IDX_A685F3F89941A932 (declination_id), INDEX IDX_A685F3F826560288 (substitute_product_context_id), INDEX IDX_A685F3F86F642EC2 (substitute_declination_id), INDEX IDX_A685F3F8B03A8386 (created_by_id), INDEX IDX_A685F3F8896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  11.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8F8679EE4 FOREIGN KEY (product_context_id) REFERENCES products_bundle__product_context (id)');
  12.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F89941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
  13.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F826560288 FOREIGN KEY (substitute_product_context_id) REFERENCES products_bundle__product_context (id)');
  14.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F86F642EC2 FOREIGN KEY (substitute_declination_id) REFERENCES products_bundle__declination (id)');
  15.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  16.         $this->addSql('ALTER TABLE products_bundle__substitute_product ADD CONSTRAINT FK_A685F3F8896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.         $this->addSql('DROP TABLE products_bundle__substitute_product');
  21.     }
  22. }