import { MigrationInterface, QueryRunner } from 'typeorm'; /** * Wagons the requester specifically asked for. A transfer request stays * count-driven (`quantity` is what must be delivered), but a requester who * picked wagons off the yard desk now records WHICH ones — OCC sees the numbers * on the queue and the fulfil picker pre-selects them. * * Stored as a uuid[] column rather than a join table: the list is read and * written whole, never queried by wagon, and a preference carries no lifecycle * of its own (no FK — a purged wagon simply drops out of the display). */ export class TransferRequestPreferredWagons3400000000000 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE freight.wagon_transfer_requests ADD COLUMN IF NOT EXISTS preferred_wagon_ids uuid[] `); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE freight.wagon_transfer_requests DROP COLUMN IF EXISTS preferred_wagon_ids `); } }