mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 20:10:56 +00:00
25 lines
824 B
TypeScript
25 lines
824 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Every new wagon-transfer request must state WHY the wagons are needed; the
|
|
* reason is shown on the OCC request queue. Nullable in the DB — legacy rows
|
|
* predate the requirement; the DTO enforces it for new requests.
|
|
*/
|
|
export class AddTransferRequestReason2240000000000 implements MigrationInterface {
|
|
name = 'AddTransferRequestReason2240000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.wagon_transfer_requests
|
|
ADD COLUMN IF NOT EXISTS reason text NULL
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.wagon_transfer_requests
|
|
DROP COLUMN IF EXISTS reason
|
|
`);
|
|
}
|
|
}
|