Files
YwxAppThink/docs/migrations/2026_07_23_links_softdelete_perms.sql
T

18 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.
-- 友情链接管理完善:软删除字段 + 后台权限种子
-- 适用:已安装(数据来自 abc.sql / 线上库)需要手动执行以下语句
-- 1) 给 wxapp_links 增加软删除时间字段(启用回收站功能)
ALTER TABLE `wxapp_links`
ADD COLUMN `delete_at` int DEFAULT NULL COMMENT '软删除时间' AFTER `update_at`;
-- 2) 补充 links 子权限(父级为 links:indexid=61
-- 注意:若你们的 user_rule 已存在同名 name,请先确认 id 不冲突再执行
INSERT INTO `wxapp_user_rule`
(`id`, `pid`, `title`, `name`, `type`, `module`, `route`, `icon`, `sort`, `status`, `create_at`, `update_at`, `delete_at`)
VALUES
(621, 61, '添加友链', 'links:add', 3, 'links/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
(622, 61, '编辑友链', 'links:edit', 3, 'links/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
(623, 61, '删除友链', 'links:delete', 3, 'links/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
(624, 61, '友链回收站', 'links:recyclebin', 3, 'links/recyclebin', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
(625, 61, '恢复友链', 'links:restore', 3, 'links/restore', 'layui-icon ', 0, NULL, 1, 0, 0, 0);