Skip to content
Snippets Groups Projects
Commit b259300b authored by Dariusz Kędzierski's avatar Dariusz Kędzierski
Browse files

update_child_count fix

parent cc2e13fe
No related branches found
No related tags found
5 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!16Dk issue 3 concurrent block query rebase,!15Dk issue 3 concurrent block query
......@@ -311,9 +311,12 @@ class Posts:
sql = """
UPDATE
hive_posts
SET
children = (SELECT children FROM hive_posts WHERE id = :id) :op 1
WHERE id = :id"""
SET """
if op == '+':
sql += """children = (SELECT children FROM hive_posts WHERE id = :id) + 1"""
else:
sql += """children = (SELECT children FROM hive_posts WHERE id = :id) - 1"""
sql += """ WHERE id = :id"""
DB.query(sql, id=parent_id, op=op)
@classmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment