diff --git a/server/setup/scriptsPg/1.18.0.ts b/server/setup/scriptsPg/1.18.0.ts index df22faa2d..88b2fb5bc 100644 --- a/server/setup/scriptsPg/1.18.0.ts +++ b/server/setup/scriptsPg/1.18.0.ts @@ -16,6 +16,9 @@ export default async function migration() { thc."targetId", t."siteId", s."orgId", + r."name" AS "resourceName", + t."ip", + t."port", thc."hcEnabled", thc."hcPath", thc."hcScheme", @@ -33,13 +36,17 @@ export default async function migration() { thc."hcTlsServerName" FROM "targetHealthCheck" thc JOIN "targets" t ON thc."targetId" = t."targetId" - JOIN "sites" s ON t."siteId" = s."siteId"` + JOIN "sites" s ON t."siteId" = s."siteId" + JOIN "resources" r ON t."resourceId" = r."resourceId"` ); const existingHealthChecks = healthChecksQuery.rows as { targetHealthCheckId: number; targetId: number; siteId: number; orgId: string; + resourceName: string; + ip: string; + port: number; hcEnabled: boolean; hcPath: string | null; hcScheme: string | null; @@ -385,6 +392,7 @@ export default async function migration() { "targetId", "orgId", "siteId", + "name", "hcEnabled", "hcPath", "hcScheme", @@ -405,6 +413,7 @@ export default async function migration() { ${hc.targetId}, ${hc.orgId}, ${hc.siteId}, + ${`Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`}, ${hc.hcEnabled}, ${hc.hcPath}, ${hc.hcScheme}, diff --git a/server/setup/scriptsSqlite/1.18.0.ts b/server/setup/scriptsSqlite/1.18.0.ts index 49ee8c450..a5078e2d3 100644 --- a/server/setup/scriptsSqlite/1.18.0.ts +++ b/server/setup/scriptsSqlite/1.18.0.ts @@ -22,6 +22,9 @@ export default async function migration() { thc."targetId", t."siteId", s."orgId", + r."name" AS "resourceName", + t."ip", + t."port", thc."hcEnabled", thc."hcPath", thc."hcScheme", @@ -39,13 +42,17 @@ export default async function migration() { thc."hcTlsServerName" FROM 'targetHealthCheck' thc JOIN 'targets' t ON thc."targetId" = t."targetId" - JOIN 'sites' s ON t."siteId" = s."siteId"` + JOIN 'sites' s ON t."siteId" = s."siteId" + JOIN 'resources' r ON t."resourceId" = r."resourceId"` ) .all() as { targetHealthCheckId: number; targetId: number; siteId: number; orgId: string; + resourceName: string; + ip: string; + port: number; hcEnabled: number; hcPath: string | null; hcScheme: string | null; @@ -392,6 +399,7 @@ export default async function migration() { "targetId", "orgId", "siteId", + "name", "hcEnabled", "hcPath", "hcScheme", @@ -407,7 +415,7 @@ export default async function migration() { "hcStatus", "hcHealth", "hcTlsServerName" - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` ); const insertAll = db.transaction(() => { @@ -417,6 +425,7 @@ export default async function migration() { hc.targetId, hc.orgId, hc.siteId, + `Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`, hc.hcEnabled, hc.hcPath, hc.hcScheme,