admin/fix_route_id_name.sql

20 lines
545 B
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.

-- 修复数据库中 route_id 和 name 字段的混乱
-- 问题route_id 和 name 字段值不一致,导致路由层级判断错误
USE soybean_admin;
-- 查看当前问题数据
SELECT route_id AS '错误的route_id', name AS '正确的name', path
FROM sys_route
WHERE route_id != name
ORDER BY order_num;
-- 修复:将 route_id 设置为与 name 一致
UPDATE sys_route SET route_id = name WHERE route_id != name;
-- 验证修复结果
SELECT route_id, name, path, component
FROM sys_route
WHERE status = 1
ORDER BY order_num;