From ee265a858cd9f77438e5984c2de06ba6dd7bfd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Wed, 14 Oct 2026 17:06:18 +0200 Subject: [PATCH] made network migration repeatable --- .../main/resources/migrations/loginLog/002_add_network.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/resources/migrations/loginLog/002_add_network.sql b/common/src/main/resources/migrations/loginLog/002_add_network.sql index fa8c100..64f61c6 100644 --- a/common/src/main/resources/migrations/loginLog/002_add_network.sql +++ b/common/src/main/resources/migrations/loginLog/002_add_network.sql @@ -1,6 +1,6 @@ -- Connection key per attempt: the IPv4 address or the IPv6 /64 prefix. Groups accounts by internet connection. ALTER TABLE login_attempts - ADD COLUMN network VARCHAR(45) NULL COMMENT 'IPv4 address or IPv6 /64 prefix, NULL if unknown' AFTER ip, - ADD KEY idx_network_at (network, at); + ADD COLUMN IF NOT EXISTS network VARCHAR(45) NULL COMMENT 'IPv4 address or IPv6 /64 prefix, NULL if unknown' AFTER ip, + ADD KEY IF NOT EXISTS idx_network_at (network, at); UPDATE login_attempts SET network = ip WHERE ip REGEXP '^[0-9]{1,3}([.][0-9]{1,3}){3}$';