import { MigrationInterface, QueryRunner } from "typeorm"; /** * Export cargo reaches a train two ways, and until now only one was modelled. * * DIRECT_TO_TRAIN — the customer's truck pulls alongside and the cargo goes * straight onto the wagon. It never enters a warehouse, so no GRN is ever * raised; the Carriage Acceptance Sheet is the only document handed over. * * WAREHOUSE — cargo is received into the warehouse, GRN'd, then loaded. This is * the existing flow and stays gated on the GRN. * * NULL means WAREHOUSE, so existing rows keep today's behaviour with no backfill. */ export class BookingExportHandoverMode3370000000000 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE freight.bookings ADD COLUMN IF NOT EXISTS export_handover_mode varchar(20) `); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE freight.bookings DROP COLUMN IF EXISTS export_handover_mode `); } }