mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 22:30:55 +00:00
20 lines
656 B
TypeScript
20 lines
656 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class AddDistanceColumnsToVehicles1821000000002 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.vehicles
|
|
ADD COLUMN IF NOT EXISTS estimated_distance_km NUMERIC,
|
|
ADD COLUMN IF NOT EXISTS actual_distance_km NUMERIC;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.vehicles
|
|
DROP COLUMN IF EXISTS estimated_distance_km,
|
|
DROP COLUMN IF EXISTS actual_distance_km;
|
|
`);
|
|
}
|
|
}
|