mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-27 19:22:50 +00:00
@@ -16,6 +16,9 @@ export default async function migration() {
|
|||||||
thc."targetId",
|
thc."targetId",
|
||||||
t."siteId",
|
t."siteId",
|
||||||
s."orgId",
|
s."orgId",
|
||||||
|
r."name" AS "resourceName",
|
||||||
|
t."ip",
|
||||||
|
t."port",
|
||||||
thc."hcEnabled",
|
thc."hcEnabled",
|
||||||
thc."hcPath",
|
thc."hcPath",
|
||||||
thc."hcScheme",
|
thc."hcScheme",
|
||||||
@@ -33,13 +36,17 @@ export default async function migration() {
|
|||||||
thc."hcTlsServerName"
|
thc."hcTlsServerName"
|
||||||
FROM "targetHealthCheck" thc
|
FROM "targetHealthCheck" thc
|
||||||
JOIN "targets" t ON thc."targetId" = t."targetId"
|
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 {
|
const existingHealthChecks = healthChecksQuery.rows as {
|
||||||
targetHealthCheckId: number;
|
targetHealthCheckId: number;
|
||||||
targetId: number;
|
targetId: number;
|
||||||
siteId: number;
|
siteId: number;
|
||||||
orgId: string;
|
orgId: string;
|
||||||
|
resourceName: string;
|
||||||
|
ip: string;
|
||||||
|
port: number;
|
||||||
hcEnabled: boolean;
|
hcEnabled: boolean;
|
||||||
hcPath: string | null;
|
hcPath: string | null;
|
||||||
hcScheme: string | null;
|
hcScheme: string | null;
|
||||||
@@ -385,6 +392,7 @@ export default async function migration() {
|
|||||||
"targetId",
|
"targetId",
|
||||||
"orgId",
|
"orgId",
|
||||||
"siteId",
|
"siteId",
|
||||||
|
"name",
|
||||||
"hcEnabled",
|
"hcEnabled",
|
||||||
"hcPath",
|
"hcPath",
|
||||||
"hcScheme",
|
"hcScheme",
|
||||||
@@ -405,6 +413,7 @@ export default async function migration() {
|
|||||||
${hc.targetId},
|
${hc.targetId},
|
||||||
${hc.orgId},
|
${hc.orgId},
|
||||||
${hc.siteId},
|
${hc.siteId},
|
||||||
|
${`Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`},
|
||||||
${hc.hcEnabled},
|
${hc.hcEnabled},
|
||||||
${hc.hcPath},
|
${hc.hcPath},
|
||||||
${hc.hcScheme},
|
${hc.hcScheme},
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ export default async function migration() {
|
|||||||
thc."targetId",
|
thc."targetId",
|
||||||
t."siteId",
|
t."siteId",
|
||||||
s."orgId",
|
s."orgId",
|
||||||
|
r."name" AS "resourceName",
|
||||||
|
t."ip",
|
||||||
|
t."port",
|
||||||
thc."hcEnabled",
|
thc."hcEnabled",
|
||||||
thc."hcPath",
|
thc."hcPath",
|
||||||
thc."hcScheme",
|
thc."hcScheme",
|
||||||
@@ -39,13 +42,17 @@ export default async function migration() {
|
|||||||
thc."hcTlsServerName"
|
thc."hcTlsServerName"
|
||||||
FROM 'targetHealthCheck' thc
|
FROM 'targetHealthCheck' thc
|
||||||
JOIN 'targets' t ON thc."targetId" = t."targetId"
|
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 {
|
.all() as {
|
||||||
targetHealthCheckId: number;
|
targetHealthCheckId: number;
|
||||||
targetId: number;
|
targetId: number;
|
||||||
siteId: number;
|
siteId: number;
|
||||||
orgId: string;
|
orgId: string;
|
||||||
|
resourceName: string;
|
||||||
|
ip: string;
|
||||||
|
port: number;
|
||||||
hcEnabled: number;
|
hcEnabled: number;
|
||||||
hcPath: string | null;
|
hcPath: string | null;
|
||||||
hcScheme: string | null;
|
hcScheme: string | null;
|
||||||
@@ -392,6 +399,7 @@ export default async function migration() {
|
|||||||
"targetId",
|
"targetId",
|
||||||
"orgId",
|
"orgId",
|
||||||
"siteId",
|
"siteId",
|
||||||
|
"name",
|
||||||
"hcEnabled",
|
"hcEnabled",
|
||||||
"hcPath",
|
"hcPath",
|
||||||
"hcScheme",
|
"hcScheme",
|
||||||
@@ -407,7 +415,7 @@ export default async function migration() {
|
|||||||
"hcStatus",
|
"hcStatus",
|
||||||
"hcHealth",
|
"hcHealth",
|
||||||
"hcTlsServerName"
|
"hcTlsServerName"
|
||||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||||
);
|
);
|
||||||
|
|
||||||
const insertAll = db.transaction(() => {
|
const insertAll = db.transaction(() => {
|
||||||
@@ -417,6 +425,7 @@ export default async function migration() {
|
|||||||
hc.targetId,
|
hc.targetId,
|
||||||
hc.orgId,
|
hc.orgId,
|
||||||
hc.siteId,
|
hc.siteId,
|
||||||
|
`Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`,
|
||||||
hc.hcEnabled,
|
hc.hcEnabled,
|
||||||
hc.hcPath,
|
hc.hcPath,
|
||||||
hc.hcScheme,
|
hc.hcScheme,
|
||||||
|
|||||||
Reference in New Issue
Block a user