<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250519103122 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B3913058E9 FOREIGN KEY (supplier_shipping_id) REFERENCES supplier_shipping (id)');
$this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B34584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B368F3FD8F FOREIGN KEY (inventory_location_type10_id) REFERENCES inventory_location (id)');
$this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B32F53875F FOREIGN KEY (inventory_location_type20_id) REFERENCES inventory_location (id)');
$this->addSql('ALTER TABLE dispatch_row ADD CONSTRAINT FK_5D9EE1B31233AEEF FOREIGN KEY (inventory_location_type30_id) REFERENCES inventory_location (id)');
$this->addSql('ALTER TABLE supplier_shipping ADD dispatch_status SMALLINT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE dispatch_row');
$this->addSql('ALTER TABLE inventory_order CHANGE pallet_type pallet_type LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE supplier_shipping DROP dispatch_status');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`');
}
}