From 44af9680f2a46b6650a9db3f7e8fc652042b76f4 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 1 Jul 2026 12:14:21 -0500 Subject: [PATCH] fix: add LIKE %CUP% search across all tables in debug endpoint Co-Authored-By: Claude Sonnet 4.6 --- app/routes/debug_fb.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/routes/debug_fb.py b/app/routes/debug_fb.py index 27bff97..363df62 100644 --- a/app/routes/debug_fb.py +++ b/app/routes/debug_fb.py @@ -23,6 +23,15 @@ async def find_cups(request: Request, user: dict = Depends(get_current_user)): results = {} + # 0. Tablas/campos que contengan "CUP" + ok0, _, rows0 = fb.execute_query(""" + SELECT TRIM(f.RDB$RELATION_NAME) AS tabla, TRIM(f.RDB$FIELD_NAME) AS campo + FROM RDB$RELATION_FIELDS f + WHERE f.RDB$FIELD_NAME LIKE '%CUP%' + ORDER BY 1, 2 + """) + results["campos_cup_en_bd"] = rows0 if ok0 else [] + # 1. Columnas de ARTICULO ok1, err1, rows1 = fb.execute_query(""" SELECT TRIM(f.RDB$FIELD_NAME) AS campo