mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
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 <mail@backkem.me>
This commit is contained in:
+1
-1
@@ -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"},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user