mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
add hard capacity ceiling to weight limit rules
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user