Apart from @FranciscoD point out, automatic discourse Badged are disable by default and only can be enable by discourse staff, because Discourse leave in a container, is a bad SQL is executed, that affect the performance off all discourse instance in the same Container…
Apart from this too… we suppose we are a GOOD SQL person… and a GOOD Ruby Developer…
This is my personal investigation about this:
- Install plug-in
beginner guide to creating plug-in, is a series of 7
- Rails tools for generating plug-in
There are few ways to define Badged on Discourse:
- Automatic Badged:
PROS Althought Discourse has a good gamification system but a plus is always Welcome
CONS That all, is nothing to mention
- By Group
- Custom Badged (Injecting SQL Queries) :
- For Technical decision discourse voted for disable this option by default in Hosting service by upstream but is still available for Hosted by your own. Why this decision? because Discourse live on a Container if you execute a BAD SQL stament affect the performance for all forum in the same container.
- In our Case, if We would like to extrapolate Some badged from Fedora Badged System:
- 1 your first accept answer
- 10 your 10 accept answer
- 40 your 40 accept answer
- 100 your 100 accept answer
- 500 your 500 accept answer
- Need to Contact Discourse Support badge-sql-can-no-longer-be-edited-by-default and procedure How to Enable, if you a set of three commands, and You can safely disable badge SQL after authoring your required badges for extra safety.
- Example of Step 2.
> # A badge for 10 accepted answers
SELECT id user_id, current_timestamp granted_at
WHERE id IN (
FROM post_custom_fields pc
JOIN badge_posts p1 ON p1.id = pc.post_id
JOIN topics t1 ON p1.topic_id = t1.id
WHERE p1.user_id <> t1.user_id AND
name = 'is_accepted_answer' AND
value IS NOT NULL AND
p1.user_id IN (
WHERE :backfill OR p1.id IN (:post_ids)
GROUP BY p1.user_id
HAVING COUNT(*) > 9
- Show badge on the public badges page and Enable badge
- You can test it in SQL Data Explorer Plug-in… and test the performance
- Need someone from Fedora Project to contact Discourse Support, and talk about it.
REFERENCE : what-cool-badge-queries-have-you-come-up-with
NOTE: All of this SQL Badged Queries are Well tested and support by the Discourse Community.
In the last Fedora Event #Nest there was an iniciative or propose for changing/evalute a new alternative for a Badged System, more info here: