Copy-Paste Locked Badge Query (SQL) For More Than Champion or Invitation


(Ridha) #1

This is my first topic after become a member here since 222 days ago.

  1. How to copy-paste this code?

  2. I want to give a badge for 25 successful invitations. So, I only need change the valueHAVING COUNT (*) >= 5 into HAVING COUNT (*) >= 25, and give a Gold badge type too. Am I right?

I found similar topic "Promoter" Badge broken? but I just want to confirm, because I am not a really understand in coding.

Sorry for my stupid question.


(cpradio) #2

Here are the steps for enabling the SQL Badge Queries


(Ridha) #3

Thank you Cpradio, yes I have enabled the SQL within 3 days, but its still locked.
I believe its for security purpose.
I tried to explore the Github too, but still does not know how to find the code line.


(Simon Cossar) #4

You can find the badge query SQL here: discourse/badge_queries.rb at master · discourse/discourse · GitHub


(Ridha) #5

Thank you very much Simon.
I put wrong keyword in searching the code in the repository.
After I found the sql query, I still confuse.

I want to open another support topic, to make another question relating to this.
Thank you.


What is SQL Badge Query for invited >25 People?
(Joshua Rosenfeld) #6

This topic was automatically closed after 33 hours. New replies are no longer allowed.