Files
ecom-dmb/ecom-dmb-backend/sql/migration/V20260911__sys_menu_drop_name.sql
T

11 lines
533 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.
-- 去掉 sys_menu.name:展示用 title,路由标识用 route_name(可空,下发时回退 Menu_{id})
-- 不回填 route_name(不把旧 name 写入 route_name)
UPDATE `sys_menu`
SET `title` = COALESCE(NULLIF(TRIM(`title`), ''), CONCAT('菜单', `id`))
WHERE `title` IS NULL OR TRIM(`title`) = '';
ALTER TABLE `sys_menu`
MODIFY COLUMN `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单标题(侧栏/管理端展示;同父级下唯一、必填)',
DROP COLUMN `name`;