mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 05:30:55 +00:00
27 lines
833 B
TypeScript
27 lines
833 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Per-vehicle actual distance on a last-mile delivery. A booking served by
|
|
* several trucks records each truck's km; the record's total (last_mile.exact_km)
|
|
* is their sum and drives the invoice.
|
|
*/
|
|
export class AddLastMileAssignmentDistance1890000000010
|
|
implements MigrationInterface
|
|
{
|
|
name = "AddLastMileAssignmentDistance1890000000010";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.last_mile_vehicle_assignments
|
|
ADD COLUMN IF NOT EXISTS distance_km numeric(10,2)
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.last_mile_vehicle_assignments
|
|
DROP COLUMN IF EXISTS distance_km
|
|
`);
|
|
}
|
|
}
|