Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cneeds-server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangzr
cneeds-server
Commits
dd03c0e1
Commit
dd03c0e1
authored
Mar 03, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加数据库表文档
parent
d6b2d928
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
185 additions
and
0 deletions
+185
-0
cneeds_server.sql
cneeds-common-data/db/cneeds_server.sql
+185
-0
No files found.
cneeds-common-data/db/cneeds_server.sql
0 → 100644
View file @
dd03c0e1
/*
Navicat Premium Data Transfer
Source Server : linux_testmysql
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 192.168.2.244:3306
Source Schema : cneeds_server
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 03/03/2020 14:37:38
*/
SET
NAMES
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
0
;
-- ----------------------------
-- Table structure for device_info
-- 设备信息表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`device_info`
;
CREATE
TABLE
`device_info`
(
`device_id`
bigint
(
20
)
NOT
NULL
COMMENT
'设备id'
,
`dept_id`
bigint
(
20
)
DEFAULT
NULL
,
`imei`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
COMMENT
'imei'
,
`iccid`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'iccid'
,
`status`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'状态0未激活,1已激活'
,
`device_version`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'设备版本'
,
`product_set`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'产品系列'
,
`create_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`active_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'激活时间'
,
`channel_nums`
varchar
(
10000
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'渠道号'
,
`channel_nums_message`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'渠道号提示信息'
,
`channel_rules`
int
(
255
)
DEFAULT
NULL
COMMENT
'0:黑名单,1:白名单'
,
PRIMARY
KEY
(
`device_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'设备信息'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for device_log
-- 设备日志表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`device_log`
;
CREATE
TABLE
`device_log`
(
`log_id`
bigint
(
20
)
NOT
NULL
,
`log_name`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'bug名字'
,
`create_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`device_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'设备id'
,
`status`
int
(
11
)
DEFAULT
NULL
COMMENT
'情况-1不可用 0未处理,1已查看'
,
`cteate_username`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'创建人名字'
,
`user_id`
bigint
(
20
)
DEFAULT
NULL
,
`repetition_steps`
varchar
(
300
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'复现步骤'
,
`logfile_url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'日志文件存放路径'
,
`logfile_size`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'日志文件大小'
,
`logfile_status`
int
(
11
)
DEFAULT
NULL
COMMENT
'日志文件上传状态,-1,失败,0上传中,1完成'
,
PRIMARY
KEY
(
`log_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'测试上传的日志表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for device_logmedia
-- 设备日志音频文件表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`device_logmedia`
;
CREATE
TABLE
`device_logmedia`
(
`logmedia_id`
bigint
(
20
)
NOT
NULL
,
`location_url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
DEFAULT
NULL
COMMENT
'音频路径'
,
`log_id`
bigint
(
20
)
DEFAULT
NULL
,
`type`
varchar
(
20
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'格式'
,
PRIMARY
KEY
(
`logmedia_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'日志音频表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for device_logsetting
-- 暂时用不上,设备日志设置信息表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`device_logsetting`
;
CREATE
TABLE
`device_logsetting`
(
`logsetting_id`
bigint
(
20
)
NOT
NULL
,
`log_size`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'日志容量(MB)'
,
`device_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'设备Id'
,
PRIMARY
KEY
(
`logsetting_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'设备日志设置'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_dept
-- 系统-部门(客户)表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_dept`
;
CREATE
TABLE
`sys_dept`
(
`dept_id`
bigint
(
20
)
NOT
NULL
,
`parent_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'上级部门ID,一级部门为0'
,
`name`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'部门名称'
,
`order_num`
int
(
11
)
DEFAULT
NULL
COMMENT
'排序'
,
`del_flag`
int
(
11
)
DEFAULT
NULL
COMMENT
'是否删除 -1:已删除 0:正常'
,
`distributor_num`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'渠道商号'
,
PRIMARY
KEY
(
`dept_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'部门表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_func
-- 系统 - 功能表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_func`
;
CREATE
TABLE
`sys_func`
(
`func_id`
bigint
(
20
)
NOT
NULL
,
`parent_id`
bigint
(
20
)
NOT
NULL
,
`name`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
,
`url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
,
`perms`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
,
`type`
int
(
11
)
DEFAULT
NULL
,
`order_num`
int
(
11
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`func_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'功能表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_role
-- 系统 - 角色表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_role`
;
CREATE
TABLE
`sys_role`
(
`role_id`
bigint
(
20
)
NOT
NULL
,
`role_name`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'角色名称'
,
`remark`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'备注'
,
`dept_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'部门Id'
,
`create_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`role_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'角色表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_role_dept
-- 系统 - 角色部门关系表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_role_dept`
;
CREATE
TABLE
`sys_role_dept`
(
`id`
bigint
(
20
)
NOT
NULL
,
`role_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'角色id'
,
`dept_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'部门id'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'部门与角色映射表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_role_func
-- 系统 - 角色功能表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_role_func`
;
CREATE
TABLE
`sys_role_func`
(
`id`
bigint
(
20
)
NOT
NULL
,
`role_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'角色Id'
,
`func_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'功能Id'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'功能与角色映射表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_user
-- 系统 - 用户(账户)表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_user`
;
CREATE
TABLE
`sys_user`
(
`user_id`
bigint
(
20
)
NOT
NULL
COMMENT
'用户id'
,
`username`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
COMMENT
'用户名'
,
`password`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
COMMENT
'密码'
,
`salt`
varchar
(
20
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'加密盐'
,
`email`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'邮箱'
,
`mobile`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'手机'
,
`status`
int
(
11
)
DEFAULT
NULL
COMMENT
'账户状态'
,
`create_time`
date
DEFAULT
NULL
COMMENT
'创建时间'
,
`dept_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'部门id'
,
PRIMARY
KEY
(
`user_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'用户信息表'
ROW_FORMAT
=
Dynamic
;
-- ----------------------------
-- Table structure for sys_user_role
-- 系统 - 用户角色关系表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_user_role`
;
CREATE
TABLE
`sys_user_role`
(
`id`
bigint
(
20
)
NOT
NULL
,
`user_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'用户id'
,
`role_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'角色id'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'角色用户映射表'
ROW_FORMAT
=
Dynamic
;
SET
FOREIGN_KEY_CHECKS
=
1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment