<?php
declare(strict_types=1);
namespace SalesBundleMigrations;
use Exception;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230622141703 extends AbstractMigration
{
public function up(Schema $schema): void
{
}
public function down(Schema $schema): void
{
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
try {
$conn = $this->connection->prepare("UPDATE `sales_bundle__quotation_line` l SET l.quantity = '1.000000' WHERE l.quantity IS NULL AND l.is_pack = 1");
$conn->executeQuery();
} catch (Exception $e) {
dump($e);
}
try {
$conn = $this->connection->prepare("UPDATE `sales_bundle__delivery_note_line` l SET l.quantity = '1.000000' WHERE l.quantity IS NULL AND l.is_pack = 1");
$conn->executeQuery();
} catch (Exception $e) {
dump($e);
}
try {
$conn = $this->connection->prepare("UPDATE `sales_bundle__credit_note_line` l SET l.quantity = '1.000000' WHERE l.quantity IS NULL AND l.is_pack = 1");
$conn->executeQuery();
} catch (Exception $e) {
dump($e);
}
try {
$conn = $this->connection->prepare("UPDATE `sales_bundle__order_line` l SET l.quantity = '1.000000' WHERE l.quantity IS NULL AND l.is_pack = 1");
$conn->executeQuery();
} catch (Exception $e) {
dump($e);
}
try {
$conn = $this->connection->prepare("UPDATE `sales_bundle__invoice_line` l SET l.quantity = '1.000000' WHERE l.quantity IS NULL AND l.is_pack = 1");
$conn->executeQuery();
} catch (Exception $e) {
dump($e);
}
shell_exec('bin/console do:fi:lo --append --group=sales_bundle__maj_base_quantity');
}
}