path: root/util
diff options
authorYorhel <>2020-10-15 16:02:23 +0200
committerYorhel <>2020-10-15 16:04:22 +0200
commitf0ba4719534608093c1b1cd7a2e34c392c86891e (patch)
tree889a65c13fd9eb2867f07c04a9841e73822c567e /util
parent7430acd68bf99585e461ef4fad4b40be45466d70 (diff)
reviews: Allow anonymous voting + display overrule counting
Anonymous votes count for 0.01, regular votes for 1 and overrule votes for 1000. It's a bit crude, but ought to do the job. Reason for this change is that most reviews don't seem to get any votes at all. With this anonymous voting we can do some sort of scoring/ordering even with potentially less reliable votes.
Diffstat (limited to 'util')
1 files changed, 4 insertions, 0 deletions
diff --git a/util/updates/2020-10-15-reviews-anonymous-votes.sql b/util/updates/2020-10-15-reviews-anonymous-votes.sql
new file mode 100644
index 00000000..721543f6
--- /dev/null
+++ b/util/updates/2020-10-15-reviews-anonymous-votes.sql
@@ -0,0 +1,4 @@
+ALTER TABLE reviews_votes ADD COLUMN ip inet;
+CREATE UNIQUE INDEX reviews_votes_id_ip ON reviews_votes (id,ip);
+\i sql/func.sql
+SELECT update_reviews_votes_cache(id) FROM reviews;