From cba566d500fd4b9598759306cb3c94d2188184de Mon Sep 17 00:00:00 2001 From: Kuba <78603704+jakub-tldr@users.noreply.github.com> Date: Mon, 11 May 2026 11:02:48 +0200 Subject: [PATCH] add migration --- ....0]_migrate_location_with_empty_allowed_groups.up.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 migrations/20260511085206_[2.0.0]_migrate_location_with_empty_allowed_groups.up.sql diff --git a/migrations/20260511085206_[2.0.0]_migrate_location_with_empty_allowed_groups.up.sql b/migrations/20260511085206_[2.0.0]_migrate_location_with_empty_allowed_groups.up.sql new file mode 100644 index 000000000..761c58737 --- /dev/null +++ b/migrations/20260511085206_[2.0.0]_migrate_location_with_empty_allowed_groups.up.sql @@ -0,0 +1,9 @@ +-- In 1.6.x an empty allowed groups list meant all groups have access to location. +-- Restore that meaning for locations that were migrated without any explicit group assigned. +UPDATE wireguard_network AS location +SET allow_all_groups = true +WHERE NOT EXISTS ( + SELECT 1 + FROM wireguard_network_allowed_group AS allowed_group + WHERE allowed_group.network_id = location.id +);