2019-04-28 12:42:52 +00:00
|
|
|
CREATE TABLE whitelist (domain TEXT UNIQUE NOT NULL, enabled BOOLEAN NOT NULL DEFAULT 1, date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)), date_modified INTEGER, comment TEXT);
|
|
|
|
CREATE TABLE blacklist (domain TEXT UNIQUE NOT NULL, enabled BOOLEAN NOT NULL DEFAULT 1, date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)), date_modified INTEGER, comment TEXT);
|
|
|
|
CREATE TABLE regex (domain TEXT UNIQUE NOT NULL, enabled BOOLEAN NOT NULL DEFAULT 1, date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)), date_modified INTEGER, comment TEXT);
|
|
|
|
CREATE TABLE adlists (address TEXT UNIQUE NOT NULL, enabled BOOLEAN NOT NULL DEFAULT 1, date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)), date_modified INTEGER, comment TEXT);
|
2019-02-05 18:05:11 +00:00
|
|
|
CREATE TABLE gravity (domain TEXT UNIQUE NOT NULL);
|
2019-02-06 17:57:48 +00:00
|
|
|
CREATE TABLE info (property TEXT NOT NULL, value TEXT NOT NULL);
|
|
|
|
|
|
|
|
INSERT INTO info VALUES("version","1");
|
2019-02-05 18:05:11 +00:00
|
|
|
|
|
|
|
CREATE VIEW vw_gravity AS SELECT DISTINCT a.domain
|
|
|
|
FROM gravity a
|
|
|
|
WHERE a.domain NOT IN (SELECT domain from whitelist WHERE enabled == 1);
|
|
|
|
|
|
|
|
CREATE VIEW vw_whitelist AS SELECT DISTINCT a.domain
|
|
|
|
FROM whitelist a
|
|
|
|
WHERE a.enabled == 1;
|
|
|
|
|
2019-04-28 12:42:52 +00:00
|
|
|
CREATE VIEW vw_blacklist AS SELECT DISTINCT a.domain
|
|
|
|
FROM blacklist a
|
|
|
|
WHERE a.enabled == 1 AND a.domain NOT IN vw_whitelist;
|
|
|
|
|
2019-04-26 15:36:00 +00:00
|
|
|
CREATE VIEW vw_regex AS SELECT DISTINCT a.domain
|
2019-02-05 18:05:11 +00:00
|
|
|
FROM regex a
|
|
|
|
WHERE a.enabled == 1;
|
2019-04-26 15:36:00 +00:00
|
|
|
|
|
|
|
CREATE VIEW vw_adlists AS SELECT DISTINCT a.address
|
|
|
|
FROM adlists a
|
|
|
|
WHERE a.enabled == 1;
|