vendor/bluue/products-bundle/migrations/Version20241125100008.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20241125100008 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->addSql('ALTER TABLE products_bundle__product_attachment ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_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');
  14.         $this->addSql('ALTER TABLE products_bundle__product_attachment ADD CONSTRAINT FK_C878BAA3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  15.         $this->addSql('ALTER TABLE products_bundle__product_attachment ADD CONSTRAINT FK_C878BAA3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  16.         $this->addSql('CREATE INDEX IDX_C878BAA3B03A8386 ON products_bundle__product_attachment (created_by_id)');
  17.         $this->addSql('CREATE INDEX IDX_C878BAA3896DBBDE ON products_bundle__product_attachment (updated_by_id)');
  18.         $this->addSql('CREATE INDEX created_at ON products_bundle__product_attachment (created_at)');
  19.         $this->addSql('CREATE INDEX updated_at ON products_bundle__product_attachment (updated_at)');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->addSql('ALTER TABLE products_bundle__product_attachment DROP FOREIGN KEY FK_C878BAA3B03A8386');
  24.         $this->addSql('ALTER TABLE products_bundle__product_attachment DROP FOREIGN KEY FK_C878BAA3896DBBDE');
  25.         $this->addSql('DROP INDEX IDX_C878BAA3B03A8386 ON products_bundle__product_attachment');
  26.         $this->addSql('DROP INDEX IDX_C878BAA3896DBBDE ON products_bundle__product_attachment');
  27.         $this->addSql('DROP INDEX created_at ON products_bundle__product_attachment');
  28.         $this->addSql('DROP INDEX updated_at ON products_bundle__product_attachment');
  29.         $this->addSql('ALTER TABLE products_bundle__product_attachment DROP created_by_id, DROP updated_by_id, DROP created_at, DROP updated_at');
  30.     }
  31. }