Browse Source

tall3数据库设计20210716

master
zy_Java 4 years ago
parent
commit
2bb68ca768
  1. 231
      内部项目/tall3.0.sql
  2. 13
      外部项目/绿谷及创时代/greenvalley.sql

231
内部项目/tall3.0.sql

@ -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;

13
外部项目/绿谷及创时代/greenvalley.sql

@ -881,3 +881,16 @@ CREATE TABLE `t_enterprise_information` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `t_place_apply`(`place_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业统计信息填报表' ROW_FORMAT = Dynamic;
-- 20210706 服务申请表添加三大平台属性
ALTER TABLE t_service_apply
ADD `platform` tinyint(1) DEFAULT 1 COMMENT '所属平台(1-创新平台,2-孵化平台,3-产业平台)';

Loading…
Cancel
Save