From f32d3d76e34127088f8ad1841dabe3e5e16e3bfa Mon Sep 17 00:00:00 2001 From: Hagernesh Date: Thu, 18 Jun 2026 07:06:13 +0000 Subject: [PATCH] fix(warehouse): resolve migration timestamp collisions for Batch 5/6 - Rename 1790000000000/1 (collided with CreateWarehouseModule / WarehouseBatch2) to 1791000000000/1 so they sort after the existing warehouse migrations - Make Batch 5 migration idempotent (createTable ifNotExists + ADD COLUMN IF NOT EXISTS) so it is safe whether or not it already ran Co-Authored-By: Claude Opus 4.8 (1M context) --- ...s => 1791000000000-AddWarehouseAllocationAndFeeRules.ts} | 6 +++--- ...Invoices.ts => 1791000000001-AddWarehouseFeeInvoices.ts} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename apps/edr-freight-api/src/migrations/{1790000000000-AddWarehouseAllocationAndFeeRules.ts => 1791000000000-AddWarehouseAllocationAndFeeRules.ts} (96%) rename apps/edr-freight-api/src/migrations/{1790000000001-AddWarehouseFeeInvoices.ts => 1791000000001-AddWarehouseFeeInvoices.ts} (96%) diff --git a/apps/edr-freight-api/src/migrations/1790000000000-AddWarehouseAllocationAndFeeRules.ts b/apps/edr-freight-api/src/migrations/1791000000000-AddWarehouseAllocationAndFeeRules.ts similarity index 96% rename from apps/edr-freight-api/src/migrations/1790000000000-AddWarehouseAllocationAndFeeRules.ts rename to apps/edr-freight-api/src/migrations/1791000000000-AddWarehouseAllocationAndFeeRules.ts index 05b1259f4..077a068df 100644 --- a/apps/edr-freight-api/src/migrations/1790000000000-AddWarehouseAllocationAndFeeRules.ts +++ b/apps/edr-freight-api/src/migrations/1791000000000-AddWarehouseAllocationAndFeeRules.ts @@ -1,10 +1,10 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { MigrationInterface, QueryRunner, Table } from 'typeorm'; /** * Batch 5 — warehouse allocation rules, storage/demurrage fee rules, - * and demurrage lifecycle timestamps on inventory. + * and demurrage lifecycle timestamps on inventory. Idempotent. */ -export class AddWarehouseAllocationAndFeeRules1790000000000 implements MigrationInterface { +export class AddWarehouseAllocationAndFeeRules1791000000000 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { await queryRunner.createTable( new Table({ diff --git a/apps/edr-freight-api/src/migrations/1790000000001-AddWarehouseFeeInvoices.ts b/apps/edr-freight-api/src/migrations/1791000000001-AddWarehouseFeeInvoices.ts similarity index 96% rename from apps/edr-freight-api/src/migrations/1790000000001-AddWarehouseFeeInvoices.ts rename to apps/edr-freight-api/src/migrations/1791000000001-AddWarehouseFeeInvoices.ts index c34eb240a..662a35739 100644 --- a/apps/edr-freight-api/src/migrations/1790000000001-AddWarehouseFeeInvoices.ts +++ b/apps/edr-freight-api/src/migrations/1791000000001-AddWarehouseFeeInvoices.ts @@ -1,7 +1,7 @@ import { MigrationInterface, QueryRunner, Table } from 'typeorm'; -/** Batch 6 — warehouse fee invoices + invoice items. */ -export class AddWarehouseFeeInvoices1790000000001 implements MigrationInterface { +/** Batch 6 — warehouse fee invoices + invoice items. Idempotent (createTable ifNotExists). */ +export class AddWarehouseFeeInvoices1791000000001 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { await queryRunner.createTable( new Table({