It looks like the “Promoter” badge isn’t getting assigned properly, at least on our forum.
The SQL for it is:
SELECT u.id user_id, current_timestamp granted_at
FROM users u
WHERE u.id IN (
SELECT invited_by_id
FROM invites i
JOIN users u2 ON u2.id = i.user_id
WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked
GROUP BY invited_by_id
HAVING COUNT(*) > 1
) AND u.active AND NOT u.blocked AND u.id > 0 AND
(:backfill OR u.id IN (:user_ids) )
The problem appears to be the HAVING COUNT(*) > 1
… shouldn’t that be HAVING COUNT(*) >= 1
? Requiring someone to have invited more than one person to get the Promoter badge seems strange.