Files
yunzerwebsiteallinone/go/docs/sql/alter_wechat_mini_app_push.sql
2026-10-31 19:17:37 +08:00

22 lines
1.5 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.
-- 微信小程序多应用表补充「消息推送」配置字段
--
-- 对应小程序后台:开发管理 → 开发设置 → 消息推送
-- Token / EncodingAESKey / 消息加解密方式 / 数据格式
-- 平台端「小程序配置 - 编辑小程序 - 消息推送」维护,保存后把「回调地址」填到后台。
--
-- 注意:aes_key 以 AES-256-GCM 加密存储(复用 wechatmp 的密钥),与 AppSecret 同一套加密。
-- 执行:mysql -h <host> -P <port> -u <user> -p <db> < alter_wechat_mini_app_push.sql
-- ============================================================
ALTER TABLE `yz_platform_wechat_mini_app`
ADD COLUMN `token` varchar(128) NOT NULL DEFAULT '' COMMENT '消息推送 Token(小程序后台「消息推送」填写)' AFTER `qrcode_url`,
ADD COLUMN `aes_key` varchar(512) NOT NULL DEFAULT '' COMMENT '消息推送 EncodingAESKey(AES-256-GCM 加密存储)' AFTER `token`,
ADD COLUMN `encrypt_mode` varchar(16) NOT NULL DEFAULT 'plain' COMMENT '消息加解密方式 plain=明文 compatible=兼容 safe=安全' AFTER `aes_key`,
ADD COLUMN `data_format` varchar(16) NOT NULL DEFAULT 'xml' COMMENT '消息数据格式 xml / json' AFTER `encrypt_mode`,
ADD COLUMN `push_reply` varchar(512) NOT NULL DEFAULT '' COMMENT '客服消息自动回复文案(空=不自动回复)' AFTER `data_format`;
-- 结果校验
SELECT id, name, app_id, enabled, token, encrypt_mode, data_format, push_reply
FROM yz_platform_wechat_mini_app
WHERE delete_time IS NULL;