fix(housekeeping): add where clause to check episode_id is not null on reset comments count

This commit is contained in:
Yassine Doghri 2023-11-30 15:46:00 +00:00
parent de8b84c874
commit 119742cdbb
1 changed files with 1 additions and 0 deletions

View File

@ -386,6 +386,7 @@ class EpisodeModel extends UuidModel
->select('fediverse_posts.episode_id as episode_id, COUNT(*) as `comments_count`')
->join('fediverse_posts as fp', 'fediverse_posts.id = fp.in_reply_to_id')
->where('fediverse_posts.in_reply_to_id', null)
->where('fediverse_posts.episode_id IS NOT', null)
->groupBy('fediverse_posts.episode_id')
->getCompiledSelect();