diff options
author | DL6ER <dl6er@dl6er.de> | 2019-12-20 03:42:59 +0300 |
---|---|---|
committer | DL6ER <dl6er@dl6er.de> | 2019-12-20 03:42:59 +0300 |
commit | eda7f40fefc4717e5cebc40f13a03cbb18ab492c (patch) | |
tree | 9102ce0921fcd602d46eb5edcb7356446b5a6ee3 /advanced | |
parent | e589e665a785142e9c22383a6089f8810d36027b (diff) |
Reinstall trigger that prevents group zero from being deleted.
Signed-off-by: DL6ER <dl6er@dl6er.de>
Diffstat (limited to 'advanced')
-rw-r--r-- | advanced/Scripts/database_migration/gravity/7_to_8.sql | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/advanced/Scripts/database_migration/gravity/7_to_8.sql b/advanced/Scripts/database_migration/gravity/7_to_8.sql index 0e58408e..412475da 100644 --- a/advanced/Scripts/database_migration/gravity/7_to_8.sql +++ b/advanced/Scripts/database_migration/gravity/7_to_8.sql @@ -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; 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__"; DROP TABLE "group__"; |