summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-03-30 18:52:47 +0200
committerYorhel <git@yorhel.nl>2009-03-30 18:52:47 +0200
commit09ace0e1e97f9e92f8d4f29a7a9b2556263ef02b (patch)
treee10bd050bb65516a781f32e15d5142aa93563f19 /util
parent621ea2bc69a2a80f32011103c3cce85b276e39ab (diff)
Tiny bugfix in the tag<->vn calculation
Use a user's highest vote on a child tag in the calculation of the rating of a parent, rather than the average.
Diffstat (limited to 'util')
-rw-r--r--util/updates/update_2.3.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/updates/update_2.3.sql b/util/updates/update_2.3.sql
index db7a2ca7..1a8c9571 100644
--- a/util/updates/update_2.3.sql
+++ b/util/updates/update_2.3.sql
@@ -143,7 +143,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, AVG(vote)::real AS vote, COALESCE(AVG(spoiler), 0)::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;