SQLA migration: fix RemovedIn20Warnings

This commit is contained in:
justcool393 2023-02-18 22:19:10 -06:00 committed by Ben Rog-Wilhelm
parent 449e2557d0
commit ff09ba4209
4 changed files with 11 additions and 15 deletions

View file

@ -141,13 +141,13 @@ def bulk_recompute_descendant_counts(predicate = None, db=None):
True
)
.group_by(parent_comments.corresponding_column(Comment.id))
.with_only_columns([
.with_only_columns(
parent_comments.corresponding_column(Comment.id),
func.coalesce(
func.sum(child_comments.corresponding_column(Comment.descendant_count) + text(str(1))),
text(str(0))
).label('descendant_count')
])
)
.subquery(name='descendant_counts')
),
adapt_on_names=True