mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
fmt
This commit is contained in:
parent
94e545fe52
commit
a27cf8920b
3 changed files with 16 additions and 23 deletions
|
@ -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_\\.]*
|
||||
|
|
|
@ -32,10 +32,10 @@ FROM (
|
|||
post
|
||||
WHERE
|
||||
post.id = comment.post_id
|
||||
AND (post.deleted OR post.removed)
|
||||
))
|
||||
GROUP BY
|
||||
community.id) AS counted
|
||||
AND (post.deleted
|
||||
OR post.removed)))
|
||||
GROUP BY
|
||||
community.id) AS counted
|
||||
WHERE
|
||||
community_aggregates.community_id = counted.community_id;
|
||||
|
||||
|
|
|
@ -86,19 +86,15 @@ 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
|
||||
WHERE
|
||||
new_removal.removed
|
||||
GROUP BY
|
||||
thing_id) AS first_removal
|
||||
WHERE
|
||||
report.thing_id = first_removal.thing_id
|
||||
AND NOT report.resolved
|
||||
AND COALESCE(report.updated < first_removal.when_, TRUE);
|
||||
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
|
||||
WHERE
|
||||
report.thing_id = first_removal.thing_id
|
||||
AND NOT report.resolved
|
||||
AND COALESCE(report.updated < first_removal.when_, TRUE);
|
||||
RETURN NULL;
|
||||
END $$;
|
||||
CREATE TRIGGER resolve_reports
|
||||
|
@ -451,8 +447,8 @@ BEGIN
|
|||
WHERE
|
||||
community.id = community_id
|
||||
LIMIT 1)
|
||||
GROUP BY
|
||||
community_id) AS diff
|
||||
GROUP BY
|
||||
community_id) AS diff
|
||||
WHERE
|
||||
a.community_id = diff.community_id;
|
||||
RETURN NULL;
|
||||
|
|
Loading…
Reference in a new issue