migrations/Version20250519103122.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  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 Version20250519103122 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE dispatch_row (id INT AUTO_INCREMENT NOT NULL, supplier_shipping_id INT DEFAULT NULL, product_id INT DEFAULT NULL, inventory_location_type10_id INT DEFAULT NULL, inventory_location_type20_id INT DEFAULT NULL, inventory_location_type30_id INT DEFAULT NULL, qty NUMERIC(10, 2) NOT NULL, position SMALLINT NOT NULL, INDEX IDX_5D9EE1B3913058E9 (supplier_shipping_id), INDEX IDX_5D9EE1B34584665A (product_id), INDEX IDX_5D9EE1B368F3FD8F (inventory_location_type10_id), INDEX IDX_5D9EE1B32F53875F (inventory_location_type20_id), INDEX IDX_5D9EE1B31233AEEF (inventory_location_type30_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B3913058E9 FOREIGN KEY (supplier_shipping_id) REFERENCES supplier_shipping (id)');
  20.         $this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B34584665A FOREIGN KEY (product_id) REFERENCES product (id)');
  21.         $this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B368F3FD8F FOREIGN KEY (inventory_location_type10_id) REFERENCES inventory_location (id)');
  22.         $this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B32F53875F FOREIGN KEY (inventory_location_type20_id) REFERENCES inventory_location (id)');
  23.         $this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B31233AEEF FOREIGN KEY (inventory_location_type30_id) REFERENCES inventory_location (id)');
  24.         $this->addSql('ALTER TABLE supplier_shipping ADD dispatch_status SMALLINT DEFAULT NULL');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('DROP TABLE dispatch_row');
  30.         $this->addSql('ALTER TABLE inventory_order CHANGE pallet_type pallet_type LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_bin`');
  31.         $this->addSql('ALTER TABLE supplier_shipping DROP dispatch_status');
  32.         $this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`');
  33.     }
  34. }