push velocity: correlate the SSO-id subquery on the grouped column

Dry-run against the real gitea DB: 'subquery uses ungrouped column u.id'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kit OC5
2026-09-23 14:06:10 -04:00
parent 4e2db1e2e0
commit 44e824c762

View File

@@ -96,7 +96,7 @@ PV_EXEMPT = {"windyadmin"}
PV_QUERY = """ PV_QUERY = """
select a.act_user_id as uid, u.lower_name as login, select a.act_user_id as uid, u.lower_name as login,
(select el.external_id from external_login_user el (select el.external_id from external_login_user el
where el.user_id = u.id order by el.external_id limit 1) as wid, where el.user_id = a.act_user_id order by el.external_id limit 1) as wid,
count(*) filter (where a.op_type in (5, 9) and a.created_unix > {h1}) as p1h, count(*) filter (where a.op_type in (5, 9) and a.created_unix > {h1}) as p1h,
count(*) filter (where a.op_type in (5, 9)) as p24h, count(*) filter (where a.op_type in (5, 9)) as p24h,
count(*) filter (where a.op_type in (16, 17)) as d24h, count(*) filter (where a.op_type in (16, 17)) as d24h,