mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 22:25:42 +00:00
- Introduced DEACTIVATED status for trains, allowing staff to park trains indefinitely. - Implemented methods to deactivate and reactivate trains in the TrainBuilderService. - Added UI components for train deactivation and reactivation in TrainBuilderDetailPage. - Created a dropdown setting for admin-managed import train numbers, with corresponding migrations. - Updated yard code length to accommodate soft-delete suffix. - Enhanced train status handling to include DEACTIVATED state.
22 lines
771 B
TypeScript
22 lines
771 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Yard soft-delete now appends `@<epoch-ms>` to the unique code (SEBETA →
|
|
* SEBETA@1755612345678) so the name can be reused by a new yard while
|
|
* UQ_yards_code still spans soft-deleted rows. varchar(20) can't hold long
|
|
* codes plus the 14-char suffix, so widen to 40.
|
|
*/
|
|
export class WidenYardCodeForSoftDeleteSuffix2390000000000 implements MigrationInterface {
|
|
name = 'WidenYardCodeForSoftDeleteSuffix2390000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "freight"."yards" ALTER COLUMN "code" TYPE varchar(40)`,
|
|
);
|
|
}
|
|
|
|
public async down(): Promise<void> {
|
|
// Narrowing would fail on suffixed codes; keep 40.
|
|
}
|
|
}
|