mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: grant first quote at the date post was created
Previously due to #b2dc65f9534ea date on the quoted_posts table could not be trusted. This changes it so we use the date on the actual post as the grant date. Note: there is an edge case where you create a post and only add a quote a week later. In this case the badge will not be awarded at the correct time (it will display it was granted a week ago). That said this is far more rare than the current situation.
This commit is contained in:
@@ -23,7 +23,7 @@ SQL
|
||||
SQL
|
||||
|
||||
FirstQuote = <<SQL
|
||||
SELECT ids.user_id, q.post_id, q.created_at granted_at
|
||||
SELECT ids.user_id, q.post_id, p3.created_at granted_at
|
||||
FROM
|
||||
(
|
||||
SELECT p1.user_id, MIN(q1.id) id
|
||||
@@ -34,6 +34,7 @@ SQL
|
||||
GROUP BY p1.user_id
|
||||
) ids
|
||||
JOIN quoted_posts q ON q.id = ids.id
|
||||
JOIN badge_posts p3 ON q.post_id = p3.id
|
||||
SQL
|
||||
|
||||
FirstLink = <<SQL
|
||||
|
||||
Reference in New Issue
Block a user