cmvr-wms/ruoyi-testing/sql/006_analysis_calibration.sql

24 lines
1.6 KiB
SQL
Raw Permalink 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.

-- 分析参数归入标定类型。部署前按环境流程备份并核对目标库;本脚本可以重复执行。
-- kind/part_code 本来就是 VARCHAR,新类型和两个区域复用标定 JSON,无须改列、迁移或重建表。
-- 按用户要求删除旧独立页面的叶子菜单及对应角色关联;不删除原资料、原图或轮次快照。
-- 菜单及授权必须在同一事务移除,避免只删一半留下失效引用;只匹配测试管理下的默认旧页面。
-- 若该菜单被人为增加子菜单,本脚本保留整个入口,由升级预检提示处理,不能级联误删未知页面。
-- 升级前备份匹配的 sys_menu / sys_role_menu 行;回滚时从备份恢复授权配置,不通过清理业务数据回退。
-- 已执行的 005 不应修改或倒序重跑;执行 006 后刷新前端菜单,旧页面文件已经移除。
SET NAMES utf8mb4;
START TRANSACTION;
DELETE role_link FROM sys_role_menu role_link
JOIN sys_menu page ON page.menu_id=role_link.menu_id
JOIN sys_menu parent ON parent.menu_id=page.parent_id
LEFT JOIN sys_menu child ON child.parent_id=page.menu_id
WHERE parent.parent_id=0 AND parent.path='testing'
AND page.path='analysis-parameters' AND page.component='testing/analysisParameters/index'
AND child.menu_id IS NULL;
DELETE page FROM sys_menu page
JOIN sys_menu parent ON parent.menu_id=page.parent_id
LEFT JOIN sys_menu child ON child.parent_id=page.menu_id
WHERE parent.parent_id=0 AND parent.path='testing'
AND page.path='analysis-parameters' AND page.component='testing/analysisParameters/index'
AND child.menu_id IS NULL;
COMMIT;