mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
fmt
This commit is contained in:
parent
22abe64959
commit
fb95056b2c
2 changed files with 14 additions and 20 deletions
|
@ -2,4 +2,4 @@
|
|||
nogrouping=1
|
||||
|
||||
# Don't add whitespace around % (used for `format`) in dollar-quoted function body
|
||||
placeholder=[^\s;]+%[^\s;]+
|
||||
placeholder=[a-zA-Z0-9_\\.]*%[a-zA-Z0-9_\\.]*
|
||||
|
|
|
@ -215,8 +215,7 @@ BEGIN
|
|||
AS $$
|
||||
BEGIN
|
||||
-- Update aggregates for target, then update aggregates for target's creator
|
||||
WITH
|
||||
target_diff (
|
||||
WITH target_diff (
|
||||
creator_id, score
|
||||
) AS ( UPDATE
|
||||
%1$s_aggregates AS target_aggregates
|
||||
|
@ -233,15 +232,10 @@ BEGIN
|
|||
UPDATE
|
||||
person_aggregates
|
||||
SET
|
||||
%1$s_score = %1$s_score + diff.score
|
||||
FROM (
|
||||
%1$s_score = %1$s_score + diff.score FROM (
|
||||
SELECT
|
||||
creator_id,
|
||||
sum(score)
|
||||
FROM
|
||||
target_diff
|
||||
GROUP BY
|
||||
creator_id) AS diff
|
||||
creator_id, sum(score)
|
||||
FROM target_diff GROUP BY creator_id) AS diff
|
||||
WHERE
|
||||
person_aggregates.person_id = diff.creator_id;
|
||||
RETURN NULL;
|
||||
|
|
Loading…
Reference in a new issue