mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 22:58:17 +00:00
feat(warehouses): record container vs bulk freight type
Nullable freight_type on the warehouse, null meaning it takes both. No backfill: every existing warehouse is unrestricted today and writing a value would narrow allocation behind the operator's back. Reuses FREIGHT_TYPES from the booking entity rather than a third copy of the same two values.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
/**
|
||||
* `freight.warehouses.freight_type` — CONTAINER or BULK, or null for a site
|
||||
* that takes both.
|
||||
*
|
||||
* Nullable with no backfill on purpose: every existing warehouse predates the
|
||||
* field and is unrestricted today, so writing a value would narrow live
|
||||
* allocation behind the operator's back.
|
||||
*/
|
||||
export class WarehouseFreightType3820000000000 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE freight.warehouses ADD COLUMN IF NOT EXISTS freight_type varchar(16)`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE freight.warehouses DROP COLUMN IF EXISTS freight_type`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user