discourse/discourse — pull request #2372 by vikhyat (2014-05-21 07:38:49+00:00)
Title: Multiple grant badges

(not ready for merge yet)

Missing a database-level constraint to ensure that single-grant badges are never granted more than once. Best way to do it would be to use a trigger but I didn't add it yet since I saw that Discourse does not currently use any triggers. Another way would be to add a check constraint using a function to bypass the restriction on subqueries. Thoughts @SamSaffron?