mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Reinstall trigger that prevents group zero from being deleted.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
e589e665a7
commit
eda7f40fef
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ CREATE TRIGGER tr_group_update AFTER UPDATE ON "group"
|
||||||
UPDATE "group" SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE id = NEW.id;
|
UPDATE "group" SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE id = NEW.id;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
||||||
|
BEGIN
|
||||||
|
INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
||||||
|
END;
|
||||||
|
|
||||||
INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__";
|
INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__";
|
||||||
|
|
||||||
DROP TABLE "group__";
|
DROP TABLE "group__";
|
||||||
|
|
Loading…
Reference in a new issue