From 62cb41c3b8780bffe5a8ea58a6a7b5053d9e1059 Mon Sep 17 00:00:00 2001
From: Yorhel <git@yorhel.nl>
Date: Sun, 18 Oct 2009 18:06:14 +0200
Subject: SQL: Fixed calculation of tags_vn_bayesian.spoiler

---
 util/dump.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'util/dump.sql')

diff --git a/util/dump.sql b/util/dump.sql
index 145c09e8..9fbff0a2 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -589,7 +589,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, COALESCE(AVG(spoiler), 0)::real AS spoiler
+    SELECT tag, vid, uid, MAX(vote)::real AS vote, AVG(spoiler)::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;
-- 
cgit v1.2.3

