For example, let's take the nice question badge; it can be awarded in two ways that I know of:
- Count() votes where voteTypeId = 2 and 3; deduct downvotes from upvotes and award badge if remainder is > 10
- Check the value of posts.score and award badge if its > 10
How is data integrity governed? By the votes table or the posts.score table?
I imagine some type of callback after insert/update would work. But does it happen on votes inserts or posts.score updates, or neither? Or no callback at all, and some type of polling event? Or some type of arcane black magic?