summaryrefslogtreecommitdiff
path: root/util/dump.sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-27 22:18:27 +0100
committerYorhel <git@yorhel.nl>2009-11-02 22:16:24 +0100
commit4895ea63323b94f0b128d6874be997a24d3a3b0d (patch)
treeaf8f634aaa7ecd63f63745b061c37b74f4b92f29 /util/dump.sql
parent9d75f5b0e22c1560a048f92c30cd6e572728d6b8 (diff)
SQL: Fixed another bug with the tags_vn_bayesian.spoiler calculation
Diffstat (limited to 'util/dump.sql')
-rw-r--r--util/dump.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/dump.sql b/util/dump.sql
index 0fdf5696..cd6f9434 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -575,7 +575,7 @@ BEGIN
SELECT * FROM tags_vn UNION SELECT * FROM tag_vn_childs();
-- grouped by (tag, vid, uid), so only one user votes on one parent tag per VN entry
CREATE OR REPLACE TEMPORARY VIEW tags_vn_grouped AS
- SELECT tag, vid, uid, MAX(vote)::real AS vote, AVG(spoiler)::real AS spoiler
+ SELECT tag, vid, uid, MAX(vote)::real AS vote, COALESCE(AVG(spoiler), 0)::real AS spoiler
FROM tags_vn_all GROUP BY tag, vid, uid;
-- grouped by (tag, vid) and serialized into a table
DROP INDEX IF EXISTS tags_vn_bayesian_tag;