migrations/Delete/Version20250215170024_InvoicingProforma.php line 1
<?php
declare(strict_types=1);
namespace DoctrineMigrations\Delete;
use App\Doctrine\Type\Expediting\TransportMode;
use App\Doctrine\Type\Finance\PayableStatus;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250215170024_InvoicingProforma extends AbstractMigration
{
public function getDescription(): string
{
return 'Add invoicing proforma';
}
public function up(Schema $schema): void
{
$payableStatus = PayableStatus::getName();
$transportMode = TransportMode::getName();
$this->addSql("CREATE TABLE invoicing_proforma (
id SERIAL PRIMARY KEY,
work_order_id INTEGER REFERENCES public.work_order (id),
shipping_plan_id INTEGER REFERENCES public.expediting_shipping_plan (id),
batch_id INTEGER REFERENCES public.expediting_z_batch (id),
slug CHARACTER VARYING NOT NULL,
number CHARACTER VARYING NOT NULL,
reference CHARACTER VARYING NOT NULL,
status {$payableStatus} NOT NULL,
transport_mode {$transportMode} NOT NULL,
version INTEGER,
work_orders CHARACTER VARYING,
order_number CHARACTER VARYING NOT NULL,
origin CHARACTER VARYING NOT NULL,
pickup_place CHARACTER VARYING NOT NULL,
pickup_country_code CHARACTER VARYING NOT NULL,
destination_country_code CHARACTER VARYING NOT NULL,
tariff_zone CHARACTER VARYING,
boxes_count INTEGER NOT NULL,
weight DECIMAL(18, 5) NOT NULL,
volume DECIMAL(18, 5) NOT NULL,
chargeable_weight DECIMAL(18, 5),
value DECIMAL(18, 5),
europe BOOLEAN NOT NULL,
lines JSONB,
created_by INTEGER REFERENCES public.user (id),
updated_by INTEGER REFERENCES public.user (id),
created_at TIMESTAMP(0) WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP(0) WITH TIME ZONE,
deleted_at TIMESTAMP(0) WITH TIME ZONE
)");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS invoicing_proforma");
}
}