From 22439225175a8d0a188d091a0bacec25b3755665 Mon Sep 17 00:00:00 2001 From: tom27052006 <83423411+tom27052006@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:27:39 +0200 Subject: [PATCH] Quote reserved `groups` identifier in MySQL collection-permissions migration `groups` is a reserved keyword in MySQL 8, so the unquoted `INNER JOIN groups` in the second UPDATE of the MySQL variant of 2026-07-16-120000_add_custom_collection_permissions/up.sql fails with ERROR 1064 (syntax error), aborting the migration and preventing the server from starting on MySQL/MariaDB. Backtick the table references, matching the existing 2022-07-27-110000_add_group_support migration. PostgreSQL and SQLite do not reserve the word and are unchanged. --- .../up.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migrations/mysql/2026-07-16-120000_add_custom_collection_permissions/up.sql b/migrations/mysql/2026-07-16-120000_add_custom_collection_permissions/up.sql index da66070a..d247d1e9 100644 --- a/migrations/mysql/2026-07-16-120000_add_custom_collection_permissions/up.sql +++ b/migrations/mysql/2026-07-16-120000_add_custom_collection_permissions/up.sql @@ -20,8 +20,10 @@ WHERE atype = 4 AND EXISTS ( SELECT 1 FROM groups_users - INNER JOIN groups ON groups.uuid = groups_users.groups_uuid + -- `groups` is a reserved word in MySQL 8 and must be quoted, matching the existing + -- `2022-07-27-110000_add_group_support` migration. (PostgreSQL/SQLite do not reserve it.) + INNER JOIN `groups` ON `groups`.uuid = groups_users.groups_uuid WHERE groups_users.users_organizations_uuid = users_organizations.uuid - AND groups.organizations_uuid = users_organizations.org_uuid - AND groups.access_all = TRUE + AND `groups`.organizations_uuid = users_organizations.org_uuid + AND `groups`.access_all = TRUE );