/*
 Navicat Premium Data Transfer

 Source Server         : 测试
 Source Server Type    : MariaDB
 Source Server Version : 100318
 Source Host           : test.tall.wiki:3306
 Source Schema         : tall3

 Target Server Type    : MariaDB
 Target Server Version : 100318
 File Encoding         : 65001

 Date: 25/07/2021 11:46:53
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_sys_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_auth`;
CREATE TABLE `t_sys_auth`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `identify_type` tinyint(1) NULL DEFAULT 0 COMMENT '认证的类型 0微信小程序，1电话，2邮箱，3账号，4微信公众号，5微信网页登陆，6微博，7企业微信',
  `identifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户标识()手机号等',
  `credential` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户凭证/密码',
  `salt` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '盐，加密时所需',
  `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,
  `register_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '注册类型 0手动注册，1系统添加',
  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;

-- ----------------------------
-- Table structure for t_sys_project_list
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_project_list`;
CREATE TABLE `t_sys_project_list`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `template_id` bigint(20) NULL DEFAULT 0 COMMENT '模板id',
  `parent_project_id` bigint(20) NULL DEFAULT 0 COMMENT '上级项目id',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '项目名称',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求路径',
  `project_start_time` bigint(20) NULL DEFAULT 0 COMMENT '项目开始时间',
  `project_end_time` bigint(20) NULL DEFAULT 0 COMMENT '项目结束时间',
  `project_status` bigint(20) NULL DEFAULT 0 COMMENT '项目完成状态(0-未开始,1-进行中,2-暂停,3-已完成)',
  `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 `projectindex`(`project_id`) USING BTREE,
  INDEX `template_index`(`template_id`) USING BTREE,
  INDEX `parent_project_index`(`parent_project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目列表信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_template
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_template`;
CREATE TABLE `t_sys_template`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '模板名称',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '访问地址',
  `business_template_id` 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 `business_template_index`(`business_template_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '模板表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user`  (
  `id` bigint(20) NOT NULL,
  `grade_id` bigint(20) NULL DEFAULT 0 COMMENT '会员等级id',
  `avatar_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '昵称',
  `gender` tinyint(1) NULL DEFAULT 0 COMMENT '性别',
  `country` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '国家',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '省份',
  `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城市',
  `language` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '语言',
  `phone` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号',
  `wechat` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '微信号',
  `email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `balance` bigint(20) NULL DEFAULT 0 COMMENT '余额,单位：分',
  `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,
  `source` tinyint(1) NULL DEFAULT 0 COMMENT '注册来源 0：pt , 1跳绳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_user_project
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_project`;
CREATE TABLE `t_sys_user_project`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `user_id` 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 `project_index`(`project_id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户项目表' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
