mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
29 lines
914 B
TypeScript
29 lines
914 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Add a hard per-unit weight ceiling to weight limit rules.
|
|
*
|
|
* maxVgmTons stays the soft "overweight" threshold (surcharge + warning);
|
|
* max_capacity_tons is the absolute ceiling above which a booking cannot be
|
|
* created at all. Null means no ceiling (existing behavior).
|
|
*/
|
|
export class AddMaxCapacityToWeightLimitRules1930000000000
|
|
implements MigrationInterface
|
|
{
|
|
name = "AddMaxCapacityToWeightLimitRules1930000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.weight_limit_rules
|
|
ADD COLUMN IF NOT EXISTS max_capacity_tons numeric(8, 3);
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.weight_limit_rules
|
|
DROP COLUMN IF EXISTS max_capacity_tons;
|
|
`);
|
|
}
|
|
}
|