mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
intercity fix
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
/**
|
||||
* The draft/finalize phase is abolished: train schedules are created SCHEDULED
|
||||
* and the Finalize button is gone from the backoffice. Promote every surviving
|
||||
* DRAFT schedule so it stays reachable (dispatch requires SCHEDULED and there
|
||||
* is no manual promotion path anymore). Idempotent; one-way — the original
|
||||
* DRAFT set is not recorded, so down() cannot restore it.
|
||||
*/
|
||||
export class PromoteDraftSchedulesToScheduled3100000000000 implements MigrationInterface {
|
||||
name = "PromoteDraftSchedulesToScheduled3100000000000";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`UPDATE freight.train_schedules
|
||||
SET status = 'SCHEDULED'
|
||||
WHERE status = 'DRAFT'
|
||||
AND deleted_at IS NULL`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(): Promise<void> {
|
||||
// One-way data promotion — nothing to restore.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user