-- 分流链接：自动回复语句字段（一行一条，关联 link_code）
SET NAMES utf8mb4;

ALTER TABLE `fa_split_link`
ADD COLUMN `auto_reply` text COMMENT '自动回复语句(一行一条)' AFTER `description`;

INSERT INTO `fa_auth_rule` (`type`, `pid`, `name`, `title`, `icon`, `condition`, `remark`, `ismenu`, `createtime`, `updatetime`, `weigh`, `status`)
SELECT 'file', r.id, 'split.link/autoreply', '自动回复', 'fa fa-circle-o', '', '', 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'
FROM `fa_auth_rule` r
WHERE r.name = 'split.link' AND r.ismenu = 0
  AND NOT EXISTS (SELECT 1 FROM `fa_auth_rule` WHERE `name` = 'split.link/autoreply' LIMIT 1)
LIMIT 1;
