Reinstall trigger that prevents group zero from being deleted.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-12-20 00:42:59 +00:00
parent e589e665a7
commit eda7f40fef
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -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__";