vendor/bluue/shipments-bundle/migrations/Version20230811073057.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 Version20230811073057 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('CREATE TABLE shipments_bundle__picking_history (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', burst_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', 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)\', quantity NUMERIC(20, 6) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_F9B6EAE7CC799A1F (burst_id), INDEX IDX_F9B6EAE74584665A (product_id), INDEX IDX_F9B6EAE79941A932 (declination_id), INDEX IDX_F9B6EAE7B03A8386 (created_by_id), INDEX IDX_F9B6EAE7896DBBDE (updated_by_id), INDEX created_at (created_at), INDEX updated_at (updated_at), INDEX quantity (quantity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  11.         $this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7CC799A1F FOREIGN KEY (burst_id) REFERENCES shipments_bundle__burst (id)');
  12.         $this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE74584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
  13.         $this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE79941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
  14.         $this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  15.         $this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  16.     }
  17.     public function down(Schema $schema): void
  18.     {
  19.         $this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7CC799A1F');
  20.         $this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE74584665A');
  21.         $this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE79941A932');
  22.         $this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7B03A8386');
  23.         $this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7896DBBDE');
  24.         $this->addSql('DROP TABLE shipments_bundle__picking_history');
  25.     }
  26. }