mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Automatically recreate standard group after deletion to avoid violating foreign key constraints even if foreign key enforcing is disabled (SQLite's default behavior)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
cbc210b014
commit
01850c2128
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,10 @@ CREATE TABLE domain_groups
|
||||||
"description" TEXT
|
"description" TEXT
|
||||||
);
|
);
|
||||||
INSERT INTO domain_groups ("id","description") VALUES (0,'Standard group');
|
INSERT INTO domain_groups ("id","description") VALUES (0,'Standard group');
|
||||||
|
CREATE TRIGGER domain_groups_standard_group AFTER DELETE ON domain_groups WHEN OLD.id = 0
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO domain_groups ("id","description") VALUES (0,'Standard group');
|
||||||
|
END;
|
||||||
|
|
||||||
CREATE TABLE whitelist
|
CREATE TABLE whitelist
|
||||||
(
|
(
|
||||||
|
@ -49,6 +53,10 @@ CREATE TABLE adlist_groups
|
||||||
"description" TEXT
|
"description" TEXT
|
||||||
);
|
);
|
||||||
INSERT INTO adlist_groups ("id","description") VALUES (0,'Standard group');
|
INSERT INTO adlist_groups ("id","description") VALUES (0,'Standard group');
|
||||||
|
CREATE TRIGGER adlist_groups_standard_group AFTER DELETE ON adlist_groups WHEN OLD.id = 0
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO adlist_groups ("id","description") VALUES (0,'Standard group');
|
||||||
|
END;
|
||||||
|
|
||||||
CREATE TABLE adlists
|
CREATE TABLE adlists
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in a new issue