From 0692be9bae12a8a96f582a2dc15968282df2e8f2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 22 Jul 2019 20:59:52 +0200 Subject: [PATCH] Fix small mistake in 2->3 upgrade script. Signed-off-by: DL6ER --- advanced/Scripts/database_migration/gravity/2_to_3.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/database_migration/gravity/2_to_3.sql b/advanced/Scripts/database_migration/gravity/2_to_3.sql index d7997936..e121f28c 100644 --- a/advanced/Scripts/database_migration/gravity/2_to_3.sql +++ b/advanced/Scripts/database_migration/gravity/2_to_3.sql @@ -40,14 +40,14 @@ CREATE TABLE regex_whitelist CREATE TABLE regex_whitelist_by_group ( - regex_id INTEGER NOT NULL REFERENCES regex_whitelist (id), + regex_whitelist_id INTEGER NOT NULL REFERENCES regex_whitelist (id), group_id INTEGER NOT NULL REFERENCES "group" (id), - PRIMARY KEY (regex_id, group_id) + PRIMARY KEY (regex_whitelist_id, group_id) ); CREATE VIEW vw_regex_whitelist AS SELECT DISTINCT domain FROM regex_whitelist - LEFT JOIN regex_whitelist_by_group ON regex_whitelist_by_group.regex_id = regex_whitelist.id + LEFT JOIN regex_whitelist_by_group ON regex_whitelist_by_group.regex_whitelist_id = regex_whitelist.id LEFT JOIN "group" ON "group".id = regex_whitelist_by_group.group_id WHERE regex_whitelist.enabled = 1 AND (regex_whitelist_by_group.group_id IS NULL OR "group".enabled = 1) ORDER BY regex_whitelist.id;