mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Add client trigger.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
f0439c8d12
commit
a720fe1789
1 changed files with 7 additions and 1 deletions
|
@ -6,14 +6,20 @@ BEGIN TRANSACTION;
|
||||||
|
|
||||||
INSERT OR REPLACE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
INSERT OR REPLACE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
||||||
|
|
||||||
INSERT INTO adlist_by_group (adlist_id, group_id) SELECT id, 0 FROM adlist;
|
|
||||||
INSERT INTO domainlist_by_group (domainlist_id, group_id) SELECT id, 0 FROM domainlist;
|
INSERT INTO domainlist_by_group (domainlist_id, group_id) SELECT id, 0 FROM domainlist;
|
||||||
|
INSERT INTO client_by_group (client_id, group_id) SELECT id, 0 FROM client;
|
||||||
|
INSERT INTO adlist_by_group (adlist_id, group_id) SELECT id, 0 FROM adlist;
|
||||||
|
|
||||||
CREATE TRIGGER tr_domainlist_add AFTER INSERT ON domainlist
|
CREATE TRIGGER tr_domainlist_add AFTER INSERT ON domainlist
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO domainlist_by_group (domainlist_id, group_id) VALUES (NEW.id, 0);
|
INSERT INTO domainlist_by_group (domainlist_id, group_id) VALUES (NEW.id, 0);
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
CREATE TRIGGER tr_client_add AFTER INSERT ON client
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO client_by_group (client_id, group_id) VALUES (NEW.id, 0);
|
||||||
|
END;
|
||||||
|
|
||||||
CREATE TRIGGER tr_adlist_add AFTER INSERT ON adlist
|
CREATE TRIGGER tr_adlist_add AFTER INSERT ON adlist
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO adlist_by_group (adlist_id, group_id) VALUES (NEW.id, 0);
|
INSERT INTO adlist_by_group (adlist_id, group_id) VALUES (NEW.id, 0);
|
||||||
|
|
Loading…
Reference in a new issue