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: ...@@ -311,9 +311,12 @@ class Posts:
sql = """ sql = """
UPDATE UPDATE
hive_posts hive_posts
SET SET """
children = (SELECT children FROM hive_posts WHERE id = :id) :op 1 if op == '+':
WHERE id = :id""" 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) DB.query(sql, id=parent_id, op=op)
@classmethod @classmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment