mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
fix
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
/**
|
||||
* Add code, power_plate_no and trailer_plate_no columns to vehicles.
|
||||
* These fields existed in the DTO and UI form but had no entity columns,
|
||||
* so submitted values were silently dropped.
|
||||
*/
|
||||
export class AddVehicleCodeAndPlates1890000000001 implements MigrationInterface {
|
||||
name = "AddVehicleCodeAndPlates1890000000001";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.vehicles
|
||||
ADD COLUMN IF NOT EXISTS code varchar,
|
||||
ADD COLUMN IF NOT EXISTS power_plate_no varchar,
|
||||
ADD COLUMN IF NOT EXISTS trailer_plate_no varchar
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.vehicles
|
||||
DROP COLUMN IF EXISTS code,
|
||||
DROP COLUMN IF EXISTS power_plate_no,
|
||||
DROP COLUMN IF EXISTS trailer_plate_no
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user