<?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 Version20211121140704 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 order_product_stock_reservation (id INT AUTO_INCREMENT NOT NULL, pd_order_id INT DEFAULT NULL, product_id INT DEFAULT NULL, quantity INT NOT NULL, type INT NOT NULL, status INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_DAB454238FF7BE3 (pd_order_id), INDEX IDX_DAB454234584665A (product_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE order_product_stock_reservation ADD CONSTRAINT FK_DAB454238FF7BE3 FOREIGN KEY (pd_order_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE order_product_stock_reservation ADD CONSTRAINT FK_DAB454234584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE purchase_product CHANGE arrived_quantity arrived_quantity INT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE order_product_stock_reservation');
$this->addSql('ALTER TABLE purchase_product CHANGE arrived_quantity arrived_quantity INT DEFAULT NULL');
}
}