Skip to content

Commit

Permalink
Update sc_hot and sc_trend only for posts, skip or comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Leśniak committed Aug 5, 2024
1 parent 9134560 commit 6b11a49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hive/db/sql_scripts/update_posts_rshares.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ IF (_last_block - _first_block) > 10000 THEN
SET
abs_rshares = votes_rshares.abs_rshares
,vote_rshares = votes_rshares.rshares
,sc_hot = CASE hp.is_paidout WHEN True Then 0 ELSE hivemind_app.calculate_hot( votes_rshares.rshares, hp.created_at) END
,sc_trend = CASE hp.is_paidout WHEN True Then 0 ELSE hivemind_app.calculate_trending( votes_rshares.rshares, hp.created_at) END
,sc_hot = CASE hp.is_paidout OR hp.parent_id > 0 WHEN True Then 0 ELSE hivemind_app.calculate_hot( votes_rshares.rshares, hp.created_at) END
,sc_trend = CASE hp.is_paidout OR hp.parent_id > 0 WHEN True Then 0 ELSE hivemind_app.calculate_trending( votes_rshares.rshares, hp.created_at) END
,total_votes = votes_rshares.total_votes
,net_votes = votes_rshares.net_votes
FROM votes_rshares_view votes_rshares
Expand All @@ -43,8 +43,8 @@ ELSE
SET
abs_rshares = votes_rshares.abs_rshares
,vote_rshares = votes_rshares.rshares
,sc_hot = CASE hp.is_paidout WHEN True Then 0 ELSE hivemind_app.calculate_hot( votes_rshares.rshares, hp.created_at) END
,sc_trend = CASE hp.is_paidout WHEN True Then 0 ELSE hivemind_app.calculate_trending( votes_rshares.rshares, hp.created_at) END
,sc_hot = CASE hp.is_paidout OR hp.parent_id > 0 WHEN True Then 0 ELSE hivemind_app.calculate_hot( votes_rshares.rshares, hp.created_at) END
,sc_trend = CASE hp.is_paidout OR hp.parent_id > 0 WHEN True Then 0 ELSE hivemind_app.calculate_trending( votes_rshares.rshares, hp.created_at) END
,total_votes = votes_rshares.total_votes
,net_votes = votes_rshares.net_votes
FROM
Expand Down

0 comments on commit 6b11a49

Please sign in to comment.