From 5aa7559d43404af70c4380f113a8e62e07864a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:14:46 +0100 Subject: [PATCH] Fix SQL join type mismatch (application_id varchar vs id bigint) and add is_api field Co-Authored-By: Claude Opus 4.5 --- src/lib/coolify-db.ts | 13 ++++++++----- src/lib/deployments.ts | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/coolify-db.ts b/src/lib/coolify-db.ts index 3cdc362..b7ca8d5 100644 --- a/src/lib/coolify-db.ts +++ b/src/lib/coolify-db.ts @@ -58,6 +58,7 @@ function rowToDeployment(row: Record): Deployment { git_commit_sha: (row.commit as string) || undefined, commit_message: (row.commit_message as string) || undefined, is_webhook: row.is_webhook as boolean | undefined, + is_api: row.is_api as boolean | undefined, logs: (row.logs as string) || undefined, duration, }; @@ -69,7 +70,7 @@ export async function fetchDeployments(limit = 50): Promise { SELECT q.deployment_uuid, a.uuid AS application_uuid, - a.name AS application_name, + COALESCE(q.application_name, a.name) AS application_name, a.fqdn AS application_fqdn, q.status, q.created_at, @@ -77,9 +78,10 @@ export async function fetchDeployments(limit = 50): Promise { a.git_branch, q.commit, q.commit_message, - q.is_webhook + q.is_webhook, + q.is_api FROM application_deployment_queues q - LEFT JOIN applications a ON a.id = q.application_id + LEFT JOIN applications a ON a.id = q.application_id::bigint ORDER BY q.created_at DESC LIMIT $1 `, [limit]); @@ -106,7 +108,7 @@ export async function fetchDeploymentDetail(uuid: string): Promise