mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
23 lines
647 B
TypeScript
23 lines
647 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
/**
|
|
* Add location_id column to vehicles table to track vehicle base location.
|
|
*/
|
|
export class AddLocationToVehicles1870000000000 implements MigrationInterface {
|
|
name = "AddLocationToVehicles1870000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.vehicles
|
|
ADD COLUMN IF NOT EXISTS location_id uuid;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.vehicles
|
|
DROP COLUMN IF EXISTS location_id;
|
|
`);
|
|
}
|
|
}
|