From 62ece2f28952a14d314cfbf522afb9df4902d228 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Thu, 5 Mar 2026 18:36:55 +0800 Subject: [PATCH] Fix menu SQL in mysql SQL scripts (#1096) --- backend/plugin/config/sql/mysql/init.sql | 4 +++- backend/plugin/dict/sql/mysql/init.sql | 4 +++- backend/plugin/notice/sql/mysql/init.sql | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/plugin/config/sql/mysql/init.sql b/backend/plugin/config/sql/mysql/init.sql index 524034c1..1b08336b 100644 --- a/backend/plugin/config/sql/mysql/init.sql +++ b/backend/plugin/config/sql/mysql/init.sql @@ -1,5 +1,7 @@ +set @system_menu_id = (select id from sys_menu where name = 'System'); + insert into sys_menu (title, name, path, sort, icon, type, component, perms, status, display, cache, link, remark, parent_id, created_time, updated_time) -values ('config.menu', 'PluginConfig', '/plugins/config', 7, 'codicon:symbol-parameter', 1, '/plugins/config/views/index', null, 1, 1, 1, '', null, (select id from sys_menu where name = 'System'), now(), null); +values ('config.menu', 'PluginConfig', '/plugins/config', 7, 'codicon:symbol-parameter', 1, '/plugins/config/views/index', null, 1, 1, 1, '', null, @system_menu_id, now(), null); set @config_menu_id = LAST_INSERT_ID(); diff --git a/backend/plugin/dict/sql/mysql/init.sql b/backend/plugin/dict/sql/mysql/init.sql index 22a0c671..e3de756e 100644 --- a/backend/plugin/dict/sql/mysql/init.sql +++ b/backend/plugin/dict/sql/mysql/init.sql @@ -1,5 +1,7 @@ +set @system_menu_id = (select id from sys_menu where name = 'System'); + insert into sys_menu (title, name, path, sort, icon, type, component, perms, status, display, cache, link, remark, parent_id, created_time, updated_time) -values ('dict.menu', 'PluginDict', '/plugins/dict', 8, 'fluent-mdl2:dictionary', 1, '/plugins/dict/views/index', null, 1, 1, 1, '', null, (select id from sys_menu where name = 'System'), now(), null); +values ('dict.menu', 'PluginDict', '/plugins/dict', 8, 'fluent-mdl2:dictionary', 1, '/plugins/dict/views/index', null, 1, 1, 1, '', null, @system_menu_id, now(), null); set @dict_menu_id = LAST_INSERT_ID(); diff --git a/backend/plugin/notice/sql/mysql/init.sql b/backend/plugin/notice/sql/mysql/init.sql index fa57d059..663b3431 100644 --- a/backend/plugin/notice/sql/mysql/init.sql +++ b/backend/plugin/notice/sql/mysql/init.sql @@ -1,5 +1,7 @@ +set @system_menu_id = (select id from sys_menu where name = 'System'); + insert into sys_menu (title, name, path, sort, icon, type, component, perms, status, display, cache, link, remark, parent_id, created_time, updated_time) -values ('notice.menu', 'PluginNotice', '/plugins/notice', 9, 'fe:notice-push', 1, '/plugins/notice/views/index', null, 1, 1, 1, '', null, (select id from sys_menu where name = 'System'), now(), null); +values ('notice.menu', 'PluginNotice', '/plugins/notice', 9, 'fe:notice-push', 1, '/plugins/notice/views/index', null, 1, 1, 1, '', null, @system_menu_id, now(), null); set @notice_menu_id = LAST_INSERT_ID();