summaryrefslogtreecommitdiffhomepage
path: root/apioforum/db.py
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-07-17 23:27:37 +0000
committerubq323 <ubq323>2021-07-17 23:27:37 +0000
commita2c82ca4f96420234460ea5fdea5df37078117d7 (patch)
treeb12848493c3630cb2aab445fc20542736b304ea9 /apioforum/db.py
parent2eae97d6a08da4b832ccc69ce66bd15009001737 (diff)
vote meters idk
Diffstat (limited to 'apioforum/db.py')
-rw-r--r--apioforum/db.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/apioforum/db.py b/apioforum/db.py
index 25bda94..ba1f6a3 100644
--- a/apioforum/db.py
+++ b/apioforum/db.py
@@ -115,6 +115,10 @@ ALTER TABLE posts ADD COLUMN vote INTEGER REFERENCES votes(id);
CREATE VIEW vote_counts AS
SELECT poll, option_idx, count(*) AS num FROM votes WHERE current GROUP BY option_idx,poll;
""",
+"""
+CREATE VIEW total_vote_counts AS
+ SELECT poll, count(*) AS total_votes FROM votes WHERE current GROUP BY poll;
+""",
]