"Promoter" Badge broken?


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
) 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.

What is SQL Badge Query for invited >25 People?
Copy-Paste Locked Badge Query (SQL) For More Than Champion or Invitation
(Jeff Atwood) #2

It is @sam’s badge so he should respond.

(Sam Saffron) #3

Looks like a bug, will update the badge.

(Sam Saffron) #4

fixed in:


(Sam Saffron) #5