mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
fmt
This commit is contained in:
parent
0066a4b42b
commit
a5bcd0834b
1 changed files with 10 additions and 6 deletions
|
@ -288,8 +288,12 @@ unused_person_aggregates_update_result AS (
|
||||||
|
|
||||||
CALL r.create_triggers ('post', $$ WITH post_group AS (
|
CALL r.create_triggers ('post', $$ WITH post_group AS (
|
||||||
SELECT
|
SELECT
|
||||||
(post).community_id, (post).creator_id, (post).local, coalesce(sum(count_diff), 0) AS posts,
|
(post).community_id, (post).creator_id, (post).local, coalesce(sum(count_diff), 0) AS posts, coalesce(sum(count_diff * (
|
||||||
coalesce(sum(count_diff * (SELECT comments FROM post_aggregates WHERE post_id = (post).id LIMIT 1)), 0) AS comments FROM combined_transition_tables
|
SELECT
|
||||||
|
comments
|
||||||
|
FROM post_aggregates
|
||||||
|
WHERE
|
||||||
|
post_id = (post).id LIMIT 1)), 0) AS comments FROM combined_transition_tables
|
||||||
WHERE
|
WHERE
|
||||||
NOT ((post).deleted
|
NOT ((post).deleted
|
||||||
OR (post).removed)
|
OR (post).removed)
|
||||||
|
|
Loading…
Reference in a new issue