Merge pull request #1437 from Tria-plc/freight_feature/usermanagement

fix issues
This commit is contained in:
marshal
2026-08-28 13:35:20 +03:00
committed by GitHub
14 changed files with 435 additions and 49 deletions

View File

@@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
/**
* Why a train schedule was cancelled, captured at cancel time. Staff pick a
* reason in the cancel dialog and every view of the cancelled schedule reads it
* back — a cancelled train on the board used to say nothing about why it died.
*/
export class ScheduleCancellationReason3780000000000 implements MigrationInterface {
name = 'ScheduleCancellationReason3780000000000';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "freight"."train_schedules"
ADD COLUMN IF NOT EXISTS "cancellation_reason" varchar(500),
ADD COLUMN IF NOT EXISTS "cancelled_at" timestamptz,
ADD COLUMN IF NOT EXISTS "cancelled_by_user_id" uuid
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "freight"."train_schedules"
DROP COLUMN IF EXISTS "cancellation_reason",
DROP COLUMN IF EXISTS "cancelled_at",
DROP COLUMN IF EXISTS "cancelled_by_user_id"
`);
}
}