You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

330 lines
16 KiB

-- TALL3
-- 常量表
DROP TABLE IF EXISTS `t_constant`;
CREATE TABLE `t_constant` (
`id` bigint(20) NOT NULL,
`business_id` bigint(20) DEFAULT 0 COMMENT '业务id',
`business_type` tinyint(2) unsigned DEFAULT 0 COMMENT '业务id的类型 0任务 1插件 2其他',
`t_key` varchar(128) DEFAULT '',
`t_value` varchar(256) DEFAULT '',
`description` varchar(255) DEFAULT '' COMMENT '描述',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact COMMENT = '常量表';
-- 日志表
DROP TABLE IF EXISTS `t_sys_log`;
CREATE TABLE `t_sys_log` (
`id` bigint(20) NOT NULL,
`url` varchar(64) DEFAULT '' COMMENT '接口路径',
`method_desc` varchar(255) DEFAULT '' COMMENT '接口描述',
`params` varchar(1024) DEFAULT '' COMMENT '接口参数',
`result` varchar(1024) DEFAULT '' COMMENT '接口返回值(或异常)',
`facility` varchar(32) DEFAULT '' COMMENT '设备信息',
`user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NULL DEFAULT current_timestamp,
`updated_at` timestamp NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '日志表' ROW_FORMAT = Compact;
-- 用户表
-- 删除了等级和注册来源
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user` (
`id` bigint(20) NOT NULL,
`avatar_url` varchar(512) DEFAULT '' COMMENT '头像',
`nickname` varchar(64) DEFAULT '' COMMENT '昵称',
`gender` tinyint(1) DEFAULT unsigned 0 COMMENT '性别',
`country` varchar(64) DEFAULT '' COMMENT '国家',
`province` varchar(32) DEFAULT '' COMMENT '省份',
`city` varchar(32) DEFAULT '' COMMENT '城市',
`language` varchar(16) DEFAULT '' COMMENT '语言',
`phone` varchar(12) DEFAULT '' COMMENT '手机号',
`wechat` varchar(64) DEFAULT '' COMMENT '微信号',
`email` varchar(64) DEFAULT '' COMMENT '邮箱',
`balance` bigint(20) DEFAULT 0 COMMENT '余额,单位:分',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Compact;
-- 认证表
DROP TABLE IF EXISTS `t_sys_auth`;
CREATE TABLE `t_sys_auth` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) DEFAULT 0 COMMENT '用户id',
`identify_type` tinyint(1) DEFAULT 0 COMMENT '认证的类型 0微信小程序,1电话,2邮箱,3账号,4微信公众号,5微信网页登陆,6微博,7企业微信',
`identifier` varchar(32) DEFAULT '' COMMENT '用户标识()手机号等',
`credential` varchar(256) DEFAULT '' COMMENT '用户凭证/密码',
`salt` varchar(256) DEFAULT '' COMMENT '盐,加密时所需',
`register_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '注册类型 0手动注册,1系统添加',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `auth_user_index`(`user_id`) USING BTREE,
INDEX `auth_identify_index`(`identify_type`, `identifier`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证信息表' ROW_FORMAT = Compact;
-- 成员表
DROP TABLE IF EXISTS `t_pro_member`;
CREATE TABLE `t_pro_member` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) DEFAULT 0 COMMENT '用户id',
`project_id` bigint(20) DEFAULT 0 COMMENT '项目id',
`phone` varchar(12) DEFAULT '' COMMENT '手机号',
`name` varchar(32) DEFAULT '' COMMENT '成员名',
`avatar_url` varchar(512) DEFAULT '' COMMENT '头像',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `member_user_index`(`user_id`) USING BTREE,
INDEX `member_project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员表' ROW_FORMAT = Compact;
-- 角色表
DROP TABLE IF EXISTS `t_pro_role`;
CREATE TABLE `t_pro_role` (
`id` bigint(20) NOT NULL,
`name` varchar(32) DEFAULT '' COMMENT '角色名',
`label_id` bigint(20) DEFAULT 0 COMMENT '一级角色标签id',
`project_id` bigint(20) DEFAULT 0 COMMENT '项目id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_label_index`(`label_id`) USING BTREE,
INDEX `role_project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Compact;
-- 角色成员关联表
DROP TABLE IF EXISTS `t_pro_role_member`;
CREATE TABLE `t_pro_role_member` (
`id` bigint(20) NOT NULL,
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`member_id` bigint(20) DEFAULT 0 COMMENT '成员id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_member_role_index`(`role_id`) USING BTREE,
INDEX `role_member_member_index`(`member_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色成员关联表' ROW_FORMAT = Compact;
-- 角色互斥表
DROP TABLE IF EXISTS `t_pro_role_repulsion`;
CREATE TABLE `t_pro_role_repulsion` (
`id` bigint(20) NOT NULL,
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`repulsion_role_id` bigint(20) DEFAULT 0 COMMENT '被排斥的角色id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `repulsion_index`(`role_id`) USING BTREE,
INDEX `repulsion_role_index`(`repulsion_role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色互斥表' ROW_FORMAT = Compact;
-- 角色栏展示表
DROP TABLE IF EXISTS `t_pro_role_show`;
CREATE TABLE `t_pro_role_show` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) DEFAULT 0 COMMENT '用户id',
`project_id` bigint(20) DEFAULT 0 COMMENT '项目id',
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_show_user_index`(`user_id`) USING BTREE,
INDEX `role_show_project_index`(`project_id`) USING BTREE,
INDEX `role_show_role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色互斥表' ROW_FORMAT = Compact;
-- 角色栏展示表
DROP TABLE IF EXISTS `t_pro_role_show`;
CREATE TABLE `t_pro_role_show` (
`id` bigint(20) NOT NULL,
`user_id` bigint(20) DEFAULT 0 COMMENT '用户id',
`project_id` bigint(20) DEFAULT 0 COMMENT '项目id',
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_show_user_index`(`user_id`) USING BTREE,
INDEX `role_show_project_index`(`project_id`) USING BTREE,
INDEX `role_show_role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色栏展示表' ROW_FORMAT = Compact;
-- 角色任务关联表
DROP TABLE IF EXISTS `t_pro_role_task`;
CREATE TABLE `t_pro_role_task` (
`id` bigint(20) NOT NULL,
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`task_id` bigint(20) DEFAULT 0 COMMENT '任务id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_task_role_index`(`role_id`) USING BTREE,
INDEX `role_task_task_index`(`task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色任务关联表' ROW_FORMAT = Compact;
-- 角色任务关联表
DROP TABLE IF EXISTS `t_pro_role_task`;
CREATE TABLE `t_pro_role_task` (
`id` bigint(20) NOT NULL,
`role_id` bigint(20) DEFAULT 0 COMMENT '角色id',
`task_id` bigint(20) DEFAULT 0 COMMENT '任务id',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `role_task_role_index`(`role_id`) USING BTREE,
INDEX `role_task_task_index`(`task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色任务关联表' ROW_FORMAT = Compact;
-- ----------------------------
-- 插件表
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin`;
CREATE TABLE `t_pro_plugin` (
`id` bigint(20) NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '插件名称',
`plugin_author` bigint(20) NULL DEFAULT 0 COMMENT '插件作者',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '简介(介绍插件功能和传参)',
`version` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '版本号',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp '创建时间',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
PRIMARY KEY (`id`) USING BTREE,
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件表' ROW_FORMAT = Compact;
-- ----------------------------
-- 插件样式表
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_style`;
CREATE TABLE `t_pro_plugin_style` (
`id` bigint(20) NOT NULL,
`plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
`style_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '页面样式内容(html css)',
`js_function` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'js功能',
`style_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '样式类型0:一行1:两行2:半屏',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp '创建时间',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `plugin_style_plugin_index`(`plugin_id`) USING BTREE,
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件样式表' ROW_FORMAT = Compact;
-- ----------------------------
-- 标签表
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_label`;
CREATE TABLE `t_pro_label` (
`id` bigint(20) NOT NULL,
`label_type_id` bigint(20) NULL DEFAULT 0 COMMENT '标签类型id',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
`level` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '等级',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp '创建时间',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `label_type_index`(`label_type_id`) USING BTREE,
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;
-- ----------------------------
-- 标签类型表
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_label_type`;
CREATE TABLE `t_pro_label_type` (
`id` bigint(20) NOT NULL,
`label_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '标签类型',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
`default_level` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '默认等级',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp '创建时间',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
PRIMARY KEY (`id`) USING BTREE,
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签类型表' ROW_FORMAT = Compact;
-- ----------------------------
-- 标签与业务关联表
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_label_business`;
CREATE TABLE `t_pro_label_business` (
`id` bigint(20) NOT NULL,
`label_id` bigint(20) NULL DEFAULT 0 COMMENT '标签id',
`user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
`business_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '业务类型',
`business_id` bigint(20) NULL DEFAULT 0 COMMENT '业务id(任务id、插件id、角色id等)',
`operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
`created_at` timestamp NOT NULL DEFAULT current_timestamp '创建时间',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `label_business_label_index`(`label_id`) USING BTREE,
INDEX `label_business_user_index`(`user_id`) USING BTREE,
INDEX `label_business_business_index`(`business_id`) USING BTREE,
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签与业务关联表' ROW_FORMAT = Compact;