mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-17 21:59:55 +00:00
Order results of queries to list views by id key
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
983117d788
commit
5e26e8245b
@ -33,7 +33,9 @@ CREATE VIEW vw_gravity AS SELECT a.domain
|
||||
|
||||
CREATE VIEW vw_whitelist AS SELECT a.domain
|
||||
FROM whitelist a
|
||||
WHERE a.enabled == 1;
|
||||
WHERE a.enabled == 1
|
||||
ORDER BY a.id;
|
||||
|
||||
CREATE TRIGGER tr_whitelist_update AFTER UPDATE ON whitelist
|
||||
BEGIN
|
||||
UPDATE whitelist SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE domain = NEW.domain;
|
||||
@ -41,7 +43,9 @@ CREATE TRIGGER tr_whitelist_update AFTER UPDATE ON whitelist
|
||||
|
||||
CREATE VIEW vw_blacklist AS SELECT a.domain
|
||||
FROM blacklist a
|
||||
WHERE a.enabled == 1 AND a.domain NOT IN vw_whitelist;
|
||||
WHERE a.enabled == 1 AND a.domain NOT IN vw_whitelist
|
||||
ORDER BY a.id;
|
||||
|
||||
CREATE TRIGGER tr_blacklist_update AFTER UPDATE ON blacklist
|
||||
BEGIN
|
||||
UPDATE blacklist SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE domain = NEW.domain;
|
||||
@ -49,7 +53,9 @@ CREATE TRIGGER tr_blacklist_update AFTER UPDATE ON blacklist
|
||||
|
||||
CREATE VIEW vw_regex AS SELECT a.domain
|
||||
FROM regex a
|
||||
WHERE a.enabled == 1;
|
||||
WHERE a.enabled == 1
|
||||
ORDER BY a.id;
|
||||
|
||||
CREATE TRIGGER tr_regex_update AFTER UPDATE ON regex
|
||||
BEGIN
|
||||
UPDATE regex SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE domain = NEW.domain;
|
||||
@ -57,7 +63,9 @@ CREATE TRIGGER tr_regex_update AFTER UPDATE ON regex
|
||||
|
||||
CREATE VIEW vw_adlists AS SELECT a.address
|
||||
FROM adlists a
|
||||
WHERE a.enabled == 1;
|
||||
WHERE a.enabled == 1
|
||||
ORDER BY a.id;
|
||||
|
||||
CREATE TRIGGER tr_adlists_update AFTER UPDATE ON adlists
|
||||
BEGIN
|
||||
UPDATE adlists SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE address = NEW.address;
|
||||
|
Loading…
Reference in New Issue
Block a user