diff options
author | ubq323 <ubq323> | 2021-07-18 15:11:59 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-07-18 15:11:59 +0000 |
commit | 0ff607c6aba0bde59f63e7e4d737b1eca4977c7d (patch) | |
tree | c322299799b12b947e379a737beb93ed68bed6fa /apioforum/db.py | |
parent | 183061d9a17e3613db2063ccd291af3fac904f11 (diff) | |
parent | 2d92be0e223a8b54749d0b2d304a78b16b92000d (diff) |
this was a particularly horrible merge conflict but i think it all works now
Diffstat (limited to 'apioforum/db.py')
-rw-r--r-- | apioforum/db.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apioforum/db.py b/apioforum/db.py index 97bd0e2..abcd774 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -151,6 +151,10 @@ CREATE VIEW most_recent_posts AS CREATE VIEW number_of_posts AS SELECT thread, count(*) AS num_replies FROM posts GROUP BY thread; """, +""" +CREATE VIEW total_vote_counts AS + SELECT poll, count(*) AS total_votes FROM votes WHERE current AND NOT is_retraction GROUP BY poll; +""", ] def init_db(): |