From a6962a8ba4868f74558fe031b1ae8b7c9feb6a5e Mon Sep 17 00:00:00 2001 From: Michiel De Backker Date: Tue, 24 Feb 2026 13:56:32 +0100 Subject: [PATCH] fix(mysql): quote `groups` reserved word in query replacer (#4580) `groups` is a reserved word in MySQL >= 8.0.2, causing migration 13 to fail with a syntax error on `ALTER TABLE password ADD COLUMN groups`. Fixes #4579 Signed-off-by: Michiel De Backker --- storage/sql/sql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/sql/sql.go b/storage/sql/sql.go index d671021f..1965f5ff 100644 --- a/storage/sql/sql.go +++ b/storage/sql/sql.go @@ -95,7 +95,7 @@ var ( // For compound indexes (with two keys) even less. {matchLiteral("text"), "varchar(384)"}, // Quote keywords and reserved words used as identifiers. - {regexp.MustCompile(`\b(keys)\b`), "`$1`"}, + {regexp.MustCompile(`\b(keys|groups)\b`), "`$1`"}, // Change default timestamp to fit datetime. {regexp.MustCompile(`0001-01-01 00:00:00 UTC`), "1000-01-01 00:00:00"}, },