From 6fba944b11495951957d51cbfe71e1ae286ef55a Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 19 Mar 2026 10:37:34 +0000 Subject: [PATCH] fix: Correct migration ordering so KubernetesCluster table is created before ALTER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeORM sorts migrations by the timestamp in the last 13 chars of the class name. Migration 1773761409952 (ALTER TABLE) had a lower timestamp than 1774000000000 (CREATE TABLE), causing it to run first on a non-existent table and crash the app during startup. Renamed 1773761409952 → 1774000000001 so the CREATE TABLE migration executes first. --- ...409952-MigrationName.ts => 1774000000001-MigrationName.ts} | 4 ++-- .../Server/Infrastructure/Postgres/SchemaMigrations/Index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename Common/Server/Infrastructure/Postgres/SchemaMigrations/{1773761409952-MigrationName.ts => 1774000000001-MigrationName.ts} (98%) diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1774000000001-MigrationName.ts similarity index 98% rename from Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts rename to Common/Server/Infrastructure/Postgres/SchemaMigrations/1774000000001-MigrationName.ts index 896dd1bf0f..0f7cda154b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1774000000001-MigrationName.ts @@ -1,7 +1,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -export class MigrationName1773761409952 implements MigrationInterface { - public name = "MigrationName1773761409952"; +export class MigrationName1774000000001 implements MigrationInterface { + public name = "MigrationName1774000000001"; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts index ccd8cd1825..c3113e4b7f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts @@ -267,7 +267,7 @@ import { MigrationName1773344537755 } from "./1773344537755-MigrationName"; import { MigrationName1773402621107 } from "./1773402621107-MigrationName"; import { MigrationName1773676206197 } from "./1773676206197-MigrationName"; import { MigrationName1774000000000 } from "./1774000000000-MigrationName"; -import { MigrationName1773761409952 } from "./1773761409952-MigrationName"; +import { MigrationName1774000000001 } from "./1774000000001-MigrationName"; export default [ InitialMigration, @@ -539,5 +539,5 @@ export default [ MigrationName1773402621107, MigrationName1773676206197, MigrationName1774000000000, - MigrationName1773761409952, + MigrationName1774000000001, ];