From 4ba7972ffa6dd0e70ae6078f0788cf61f2c894c5 Mon Sep 17 00:00:00 2001 From: dmtrTm <13824405+dmtrTm@users.noreply.github.com> Date: Tue, 28 Jul 2026 15:49:38 +0700 Subject: [PATCH] fix: avoid postgres 100-argument limit in findRollbackById Rolling back any application fails with PostgresError: cannot pass more than 100 arguments to a function (54023) since 0175_fantastic_peter_quill took the application table to 101 columns. findRollbackById hydrated deployment -> application -> environment -> project, so drizzle compiled all 101 application columns plus the nested blob into one json_build_array() call, above the FUNC_MAX_ARGS = 100 limit. At 99 columns it sat exactly on the limit. None of that nested data is read: the routers only use deployment.applicationId, and rollback()/removeRollbackById() read the rollback row itself. Drop the nested relations, the same shape as #4257 for findPreviewDeploymentById. Co-Authored-By: Claude Opus 5 --- packages/server/src/services/rollbacks.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/server/src/services/rollbacks.ts b/packages/server/src/services/rollbacks.ts index b3f2fc5a4..844ed0ac3 100644 --- a/packages/server/src/services/rollbacks.ts +++ b/packages/server/src/services/rollbacks.ts @@ -106,19 +106,7 @@ export const findRollbackById = async (rollbackId: string) => { const result = await db.query.rollbacks.findFirst({ where: eq(rollbacks.rollbackId, rollbackId), with: { - deployment: { - with: { - application: { - with: { - environment: { - with: { - project: true, - }, - }, - }, - }, - }, - }, + deployment: true, }, });