hyapp-server/server/admin/migrations/091_h5_config_strict_app_scope.sql
2026-07-13 15:23:59 +08:00

19 lines
660 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.

SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
-- 086 曾把迁移前的 H5 行保留为 app_code='' 全局基线,导致所有未配置 App 都继承同一批链接。
-- 历史后台默认 App 是 lalu若 lalu 已有同名 override保留 override 并删除旧基线;其余基线归属 lalu。
DELETE legacy
FROM admin_app_configs legacy
JOIN admin_app_configs scoped
ON scoped.app_code = 'lalu'
AND scoped.`group` = legacy.`group`
AND scoped.`key` = legacy.`key`
WHERE legacy.app_code = ''
AND legacy.`group` = 'h5-links';
UPDATE admin_app_configs
SET app_code = 'lalu',
is_deleted = FALSE
WHERE app_code = ''
AND `group` = 'h5-links';