mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-23 07:18:07 +00:00
Don't create trigger with duplicate name until after old table is deleted
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
37217ece73
commit
aa4c0ff329
@ -21,15 +21,15 @@ 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;
|
||||||
|
|
||||||
|
INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__";
|
||||||
|
|
||||||
|
DROP TABLE "group__";
|
||||||
|
|
||||||
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
||||||
END;
|
END;
|
||||||
|
|
||||||
INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__";
|
|
||||||
|
|
||||||
DROP TABLE "group__";
|
|
||||||
|
|
||||||
UPDATE info SET value = 8 WHERE property = 'version';
|
UPDATE info SET value = 8 WHERE property = 'version';
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
Loading…
Reference in New Issue
Block a user