Files
shanxia2.0/docs/sql/migrations/2026-09-03-pl-plan-cert-menu-flatten.sql
T
2026-09-06 20:44:56 +08:00

45 lines
1.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 危化品证上传:扁平化菜单(去掉多余目录层 PL_GROUP_CERT)
-- 目标结构(角色管理):
-- 危化品证上传 (C, pl:plan-cert:list)
-- ├─ 上传证书 (F, pl:plan-cert:upload)
-- └─ 证书齐备 (F, pl:plan-cert:ready)
--
-- 说明:按钮 F 仍挂在页面 C (PL_PLAN_CERT) 下,符合 permission-conventions。
-- 侧栏路由需同步修改 web-admin/src/router/modules/pl.ts(另 PR/部署)。
SET NAMES utf8mb4;
-- 1. 页面直接挂运输管理根目录(沿用原目录 order_num=3)
UPDATE `sys_menu`
SET `parent_id` = 'PL_MENU_ROOT',
`order_num` = 3,
`menu_type` = 'C',
`path` = 'plan-cert',
`component` = 'pl/plan-cert/index',
`update_by` = 'system',
`update_time` = NOW()
WHERE `id` = 'PL_PLAN_CERT'
AND `del_flag` = 0;
-- 2. 软删除已无子节点的目录菜单
UPDATE `sys_menu`
SET `del_flag` = 1,
`update_by` = 'system',
`update_time` = NOW()
WHERE `id` = 'PL_GROUP_CERT'
AND `del_flag` = 0;
-- 3. 清理目录上的角色授权(若存在)
UPDATE `sys_role_menu`
SET `del_flag` = 1,
`update_time` = NOW()
WHERE `menu_id` = 'PL_GROUP_CERT'
AND `del_flag` = 0;
-- 4. 用户收藏路径(与扁平化路由 /pl/plan-cert 对齐)
UPDATE `sys_user_menu_favorite`
SET `menu_path` = '/pl/plan-cert',
`update_time` = NOW()
WHERE `menu_path` = '/pl/cert-upload/plan-cert'
AND `del_flag` = 0;