From 710036adae672486abf35be122a5d571d681d428 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 3 Feb 2019 13:34:08 +0100 Subject: [PATCH] Add DISABLED field to white- and blacklist defaulting to false. The two views respect the DISABLED fields for both lists. Signed-off-by: DL6ER --- advanced/Templates/gravity.db.schema | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/advanced/Templates/gravity.db.schema b/advanced/Templates/gravity.db.schema index 1eee8491..2fd9a9d1 100644 --- a/advanced/Templates/gravity.db.schema +++ b/advanced/Templates/gravity.db.schema @@ -1,13 +1,14 @@ -CREATE TABLE whitelist (domain TEXT UNIQUE NOT NULL, comment TEXT, DateAdded DATETIME); +CREATE TABLE whitelist (domain TEXT UNIQUE NOT NULL, comment TEXT, disabled BOOLEAN DEFAULT 0, DateAdded DATETIME); -CREATE TABLE blacklist (domain TEXT UNIQUE NOT NULL, comment TEXT, DateAdded DATETIME); +CREATE TABLE blacklist (domain TEXT UNIQUE NOT NULL, comment TEXT, disabled BOOLEAN DEFAULT 0, DateAdded DATETIME); CREATE TABLE gravity (domain TEXT UNIQUE NOT NULL); CREATE VIEW vw_gravity AS SELECT DISTINCT a.domain FROM gravity a -WHERE a.domain NOT IN (SELECT domain from whitelist); +WHERE a.domain NOT IN (SELECT domain from whitelist WHERE disabled != 1); CREATE VIEW vw_blacklist AS SELECT DISTINCT a.domain FROM blacklist a -WHERE a.domain NOT IN (SELECT domain from whitelist); +WHERE a.disabled != 1 AND + a.domain NOT IN (SELECT domain from whitelist WHERE disabled != 1);