fix: add LIKE %CUP% search across all tables in debug endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-01 12:14:21 -05:00
co-authored by Claude Sonnet 4.6
parent 0896e14e62
commit 44af9680f2
+9
View File
@@ -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