diff options
author | DL6ER <dl6er@dl6er.de> | 2019-12-13 01:49:21 +0300 |
---|---|---|
committer | DL6ER <dl6er@dl6er.de> | 2019-12-13 01:49:21 +0300 |
commit | a720fe17893ffbf48714eb11132089a7e858971e (patch) | |
tree | f5518184f01c51c403940d1e92a0b35a312b7735 /advanced | |
parent | f0439c8d12be26744097d78ae3cf3d51de93c46a (diff) |
Add client trigger.
Signed-off-by: DL6ER <dl6er@dl6er.de>
Diffstat (limited to 'advanced')
-rw-r--r-- | advanced/Scripts/database_migration/gravity/6_to_7.sql | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/advanced/Scripts/database_migration/gravity/6_to_7.sql b/advanced/Scripts/database_migration/gravity/6_to_7.sql index 095429b6..22d9dfaf 100644 --- a/advanced/Scripts/database_migration/gravity/6_to_7.sql +++ b/advanced/Scripts/database_migration/gravity/6_to_7.sql @@ -6,14 +6,20 @@ BEGIN TRANSACTION; INSERT OR REPLACE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated'); -INSERT INTO adlist_by_group (adlist_id, group_id) SELECT id, 0 FROM adlist; INSERT INTO domainlist_by_group (domainlist_id, group_id) SELECT id, 0 FROM domainlist; +INSERT INTO client_by_group (client_id, group_id) SELECT id, 0 FROM client; +INSERT INTO adlist_by_group (adlist_id, group_id) SELECT id, 0 FROM adlist; CREATE TRIGGER tr_domainlist_add AFTER INSERT ON domainlist BEGIN INSERT INTO domainlist_by_group (domainlist_id, group_id) VALUES (NEW.id, 0); END; +CREATE TRIGGER tr_client_add AFTER INSERT ON client + BEGIN + INSERT INTO client_by_group (client_id, group_id) VALUES (NEW.id, 0); + END; + CREATE TRIGGER tr_adlist_add AFTER INSERT ON adlist BEGIN INSERT INTO adlist_by_group (adlist_id, group_id) VALUES (NEW.id, 0); |