2 changed files with 244 additions and 0 deletions
@ -0,0 +1,231 @@ |
|||
-- 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; |
Loading…
Reference in new issue