This commit is contained in:
Dull Bananas 2023-12-27 22:43:28 +00:00
parent 94e545fe52
commit a27cf8920b
3 changed files with 16 additions and 23 deletions

View file

@ -1,5 +1,2 @@
# Keep normal formatting between `BEGIN` and `COMMIT` statements
nogrouping=1
# Don't add whitespace around % (used for `format`) in dollar-quoted function body
placeholder=[a-zA-Z0-9_\\.]*%[a-zA-Z0-9_\\.]*

View file

@ -32,8 +32,8 @@ FROM (
post
WHERE
post.id = comment.post_id
AND (post.deleted OR post.removed)
))
AND (post.deleted
OR post.removed)))
GROUP BY
community.id) AS counted
WHERE

View file

@ -86,15 +86,11 @@ BEGIN
UPDATE
thing_report
SET
resolved = TRUE, resolver_id = first_removal.mod_person_id, updated = first_removal.when_
FROM ( SELECT
thing_id,
min(when_) AS when_
FROM new_removal
resolved = TRUE, resolver_id = first_removal.mod_person_id, updated = first_removal.when_ FROM (
SELECT
thing_id, min(when_) AS when_ FROM new_removal
WHERE
new_removal.removed
GROUP BY
thing_id) AS first_removal
new_removal.removed GROUP BY thing_id) AS first_removal
WHERE
report.thing_id = first_removal.thing_id
AND NOT report.resolved