From 17c3ed0f8875ba3b66abec1e66238e2a2a08cecb Mon Sep 17 00:00:00 2001 From: stylefeng Date: Wed, 22 Jan 2025 17:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.3.3=E3=80=91=E3=80=90role=E3=80=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=92=E8=89=B2=E5=88=86=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...8.3.3_20250122_1713__add_role_category.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 kernel-s-system/system-spring-boot-starter/src/main/resources/db/migration/mysql/V8.3.3_20250122_1713__add_role_category.sql diff --git a/kernel-s-system/system-spring-boot-starter/src/main/resources/db/migration/mysql/V8.3.3_20250122_1713__add_role_category.sql b/kernel-s-system/system-spring-boot-starter/src/main/resources/db/migration/mysql/V8.3.3_20250122_1713__add_role_category.sql new file mode 100644 index 000000000..f65bfbbc4 --- /dev/null +++ b/kernel-s-system/system-spring-boot-starter/src/main/resources/db/migration/mysql/V8.3.3_20250122_1713__add_role_category.sql @@ -0,0 +1,22 @@ +CREATE TABLE `sys_role_category` ( + `id` bigint NOT NULL COMMENT '主键id', + `category_parent_id` bigint NOT NULL COMMENT '父级角色分类id', + `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-公司角色', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'N' COMMENT '删除标记:Y-已删除,N-未删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `create_user` bigint DEFAULT NULL COMMENT '创建人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `update_user` bigint DEFAULT NULL COMMENT '更新人', + `tenant_id` bigint DEFAULT NULL COMMENT '租户号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色分类'; + +-- 创建默认的类型 +INSERT INTO `sys_role_category`(`id`, `category_parent_id`, `category_pids`, `role_category_name`, `category_type`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`, `tenant_id`) VALUES (1881997026537611265, -1, '[-1],', '默认业务分类', 15, '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`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`, `tenant_id`) VALUES (1881997160612732930, -1, '[-1],', '默认公司分类', 20, '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`; \ No newline at end of file