From df6dc445df2f73381829b8af8db606cea67f589d Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 3 Jan 2011 20:36:39 +0100 Subject: 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. --- util/sql/func.sql | 1 + util/sql/schema.sql | 1 + util/updates/update_2.17.sql | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 util/updates/update_2.17.sql (limited to 'util') 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 + -- cgit v1.2.3