SQLA migration: fix RemovedIn20Warning
s
This commit is contained in:
parent
449e2557d0
commit
ff09ba4209
4 changed files with 11 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue