summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-03 20:36:39 +0100
committerYorhel <git@yorhel.nl>2011-01-03 21:35:40 +0100
commitdf6dc445df2f73381829b8af8db606cea67f589d (patch)
tree7e88dbf3d20420b08791371c33578496a7e59fc4 /util
parent5894b1f62abbe8837067bdf34a559d78e0a5f3a5 (diff)
SQL: Added tags_vn.ignore column and updated queries to respect this
This is the first step in adding support for overruling tag votes by moderators. Also removed some unused options from dbTagStats(); the tag-vote-stats-by-user pages have been removed in the previous VNDB update, which was the only page using these additional options.
Diffstat (limited to 'util')
-rw-r--r--util/sql/func.sql1
-rw-r--r--util/sql/schema.sql1
-rw-r--r--util/updates/update_2.17.sql8
3 files changed, 10 insertions, 0 deletions
diff --git a/util/sql/func.sql b/util/sql/func.sql
index 0248c69a..2f87bdb9 100644
--- a/util/sql/func.sql
+++ b/util/sql/func.sql
@@ -103,6 +103,7 @@ BEGIN
WITH RECURSIVE tags_vn_all(lvl, tag, vid, uid, vote, spoiler, meta) AS (
SELECT 15, tag, vid, uid, vote, spoiler, false
FROM tags_vn
+ WHERE NOT ignore
UNION ALL
SELECT lvl-1, tp.parent, ta.vid, ta.uid, ta.vote, ta.spoiler, t.meta
FROM tags_vn_all ta
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index 676d6400..2a3a394a 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -217,6 +217,7 @@ CREATE TABLE tags_vn (
vote smallint NOT NULL DEFAULT 3 CHECK (vote >= -3 AND vote <= 3 AND vote <> 0),
spoiler smallint CHECK(spoiler >= 0 AND spoiler <= 2),
date timestamptz NOT NULL DEFAULT NOW(),
+ ignore boolean NOT NULL DEFAULT false,
PRIMARY KEY(tag, vid, uid)
);
diff --git a/util/updates/update_2.17.sql b/util/updates/update_2.17.sql
new file mode 100644
index 00000000..54487d0a
--- /dev/null
+++ b/util/updates/update_2.17.sql
@@ -0,0 +1,8 @@
+
+-- tag overrule feature
+ALTER TABLE tags_vn ADD COLUMN ignore boolean NOT NULL DEFAULT false;
+
+
+-- load new function(s)
+\i util/sql/func.sql
+