FIX: ensures score is 0 and not null if no associated reviewable_scores
This commit is contained in:
parent
b1cb95fc23
commit
c66ae19037
|
@ -26,7 +26,7 @@ class RequireReviewableScores < ActiveRecord::Migration[5.2]
|
|||
|
||||
execute(<<~SQL)
|
||||
UPDATE reviewables SET score = (
|
||||
SELECT SUM(score)
|
||||
SELECT COALESCE(SUM(score), 0)
|
||||
FROM reviewable_scores
|
||||
WHERE reviewable_scores.reviewable_id = reviewables.id
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue