vendor/bluue/shipments-bundle/migrations/Version20231228091204.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace ShipmentsBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20231228091204 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE shipments_bundle__burst ADD preparation_manager_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD shipment_manager_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  11.         $this->addSql('ALTER TABLE shipments_bundle__burst ADD CONSTRAINT FK_561AB417EAC78616 FOREIGN KEY (preparation_manager_id) REFERENCES user (id)');
  12.         $this->addSql('ALTER TABLE shipments_bundle__burst ADD CONSTRAINT FK_561AB41729DA275F FOREIGN KEY (shipment_manager_id) REFERENCES user (id)');
  13.         $this->addSql('CREATE INDEX IDX_561AB417EAC78616 ON shipments_bundle__burst (preparation_manager_id)');
  14.         $this->addSql('CREATE INDEX IDX_561AB41729DA275F ON shipments_bundle__burst (shipment_manager_id)');
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql('ALTER TABLE shipments_bundle__burst DROP FOREIGN KEY FK_561AB417EAC78616');
  19.         $this->addSql('ALTER TABLE shipments_bundle__burst DROP FOREIGN KEY FK_561AB41729DA275F');
  20.         $this->addSql('DROP INDEX IDX_561AB417EAC78616 ON shipments_bundle__burst');
  21.         $this->addSql('DROP INDEX IDX_561AB41729DA275F ON shipments_bundle__burst');
  22.         $this->addSql('ALTER TABLE shipments_bundle__burst DROP preparation_manager_id, DROP shipment_manager_id');
  23.     }
  24. }