Files
dax-pay/_config/sql/update-datas.sql
DaxPay Dev 7b52cce087 feat(wx): 微信开放应用主数据与能力绑定
新增平台/商户微信应用主数据、按产品默认能力绑与通道商户能力绑(方案 A),
并补充菜单种子与升级数据脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 10:57:50 +08:00

31 lines
1.2 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.
-- ====================================================================
-- 增量数据脚本PostgreSQL
-- 升级顺序:先 update-tables.sql再本文件
-- ====================================================================
-- 商户端「支付应用(微信)」菜单(支付配置下,与通道商户/应用管理同级)
INSERT INTO "public"."iam_perm_menu" VALUES
(91412, 91400, 'payment:wx:mch-app', 'merchant', 'MchWxAppList', 'menu.payment.wx.mchApp',
'lucide:message-circle', 'f', 'f', '/payment/wx/mch/MchWxAppList', '/mch/wx-app', NULL, 3,
'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
ON CONFLICT ("id") DO NOTHING;
-- 应用配置目录让位(原 sort=3 → 4已是 4 则跳过)
UPDATE "public"."iam_perm_menu"
SET "sort_no" = 4
WHERE "id" = 91403 AND "sort_no" = 3;
-- 挂到所有商户端角色(已授权则跳过)
INSERT INTO "public"."iam_role_menu" ("id", "role_id", "menu_id")
SELECT
920000000000 + row_number() OVER (ORDER BY r."id"),
r."id",
91412
FROM "public"."iam_role" r
WHERE r."client_code" = 'merchant'
AND NOT EXISTS (
SELECT 1
FROM "public"."iam_role_menu" rm
WHERE rm."role_id" = r."id" AND rm."menu_id" = 91412
);