<?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 Version20250630204735 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add more digits to invoice tables to prevent overflow truncation';
}
public function up(Schema $schema): void
{
$this->addSql(sql: "ALTER TABLE invoice_tax_detail CHANGE taxable_amount taxable_amount DECIMAL(13, 4) NOT NULL, CHANGE tax_amount tax_amount DECIMAL(13, 4) NOT NULL");
$this->addSql(sql: "ALTER TABLE invoice_item CHANGE unit_price unit_price DECIMAL(13, 4) NOT NULL, CHANGE subtotal subtotal DECIMAL(13, 4) NOT NULL, CHANGE tax_amount tax_amount DECIMAL(13, 4) NOT NULL");
}
public function down(Schema $schema): void
{
$this->addSql(sql: "ALTER TABLE invoice_tax_detail CHANGE taxable_amount taxable_amount DECIMAL(10, 4) NOT NULL, CHANGE tax_amount tax_amount DECIMAL(10, 4) NOT NULL");
$this->addSql(sql: "ALTER TABLE invoice_item CHANGE unit_price unit_price DECIMAL(10, 4) NOT NULL, CHANGE subtotal subtotal DECIMAL(10, 4) NOT NULL, CHANGE tax_amount tax_amount DECIMAL(10, 4) NOT NULL");
}
public function isTransactional(): bool
{
return false;
}
}