mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
Update replaceable_schema.sql
This commit is contained in:
parent
0f200435d7
commit
e6dc68d6d1
1 changed files with 6 additions and 7 deletions
|
@ -70,7 +70,7 @@ BEGIN
|
|||
resolved = TRUE, resolver_id = mod_person_id, updated = now()
|
||||
FROM new_removal
|
||||
WHERE
|
||||
report.%1$s_id = new_removal.%1$a_id
|
||||
report.%1$s_id = new_removal.%1$s_id
|
||||
AND new_removal.removed;
|
||||
RETURN NULL;
|
||||
END $$;
|
||||
|
@ -214,8 +214,8 @@ BEGIN
|
|||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
-- Update aggregates for target, then update aggregates for target's creator
|
||||
WITH
|
||||
-- Update aggregates for target
|
||||
target_diff (
|
||||
creator_id, score
|
||||
) AS ( UPDATE
|
||||
|
@ -230,11 +230,10 @@ BEGIN
|
|||
target_aggregates.comment_id = diff.target_id
|
||||
RETURNING
|
||||
%2$s, diff.upvotes - diff.downvotes)
|
||||
-- Update aggregates for target's creator
|
||||
UPDATE
|
||||
person_aggregates
|
||||
SET
|
||||
%1$s_score = %1$s_score + diff.score;
|
||||
%1$s_score = %1$s_score + diff.score
|
||||
FROM (
|
||||
SELECT
|
||||
creator_id,
|
||||
|
|
Loading…
Reference in a new issue