【8.3.3】【role】修改sql,角色分类增加公司id

master^2
stylefeng 2025-01-24 11:35:41 +08:00
parent 39d436ec14
commit a155ee4b4e
1 changed files with 2 additions and 3 deletions

View File

@ -4,6 +4,7 @@ CREATE TABLE `sys_role_category` (
`category_pids` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '父级角色分类id集合',
`role_category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色分类名称',
`category_type` tinyint NOT NULL DEFAULT '1' COMMENT '角色分类类型15-业务角色20-公司角色',
`company_id` bigint DEFAULT NULL COMMENT '所属公司id当类型为20-公司角色时使用',
`fld_sort` decimal(10,2) DEFAULT NULL COMMENT '角色分类排序',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'N' COMMENT '删除标记Y-已删除N-未删除',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
@ -16,10 +17,8 @@ CREATE TABLE `sys_role_category` (
-- 创建默认的类型
INSERT INTO `sys_role_category`(`id`, `category_parent_id`, `category_pids`, `role_category_name`, `category_type`, `fld_sort`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`, `tenant_id`) VALUES (1881997026537611265, -1, '[-1],', '默认业务分类', 15, 100.00, 'N', '2025-01-22 17:26:26', 1339550467939639299, NULL, NULL, NULL);
INSERT INTO `sys_role_category`(`id`, `category_parent_id`, `category_pids`, `role_category_name`, `category_type`, `fld_sort`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`, `tenant_id`) VALUES (1881997160612732930, -1, '[-1],', '默认公司分类', 20, 100.00, 'N', '2025-01-22 17:27:01', 1339550467939639299, NULL, NULL, NULL);
-- 角色增加分类id
ALTER TABLE `sys_role`
ADD COLUMN `role_category_id` bigint NULL COMMENT '所属的角色分类id如果是业务角色和公司角色可以加上所属分类' AFTER `role_type`;
UPDATE `sys_role` SET `role_category_id` = 1881997026537611265 WHERE `role_type` = 15;
UPDATE `sys_role` SET `role_category_id` = 1881997160612732930 WHERE `role_type` = 20;
UPDATE `sys_role` SET `role_category_id` = 1881997026537611265 WHERE `role_type` = 15;