gxb_study.sql
5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
Navicat Premium Data Transfer
Source Server : 154
Source Server Type : MySQL
Source Server Version : 50628
Source Host : 192.168.30.154
Source Database : gxb_study
Target Server Type : MySQL
Target Server Version : 50628
File Encoding : utf-8
Date: 08/24/2017 10:44:13 AM
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `learn_log`
-- ----------------------------
DROP TABLE IF EXISTS `learn_log`;
CREATE TABLE `learn_log` (
`learn_log_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL COMMENT '用户id',
`tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
`course_wrapper_id` int(11) DEFAULT NULL COMMENT '课程id',
`class_id` int(11) DEFAULT NULL COMMENT '班次id',
`unit_id` int(11) DEFAULT NULL COMMENT '章节id',
`context_id` int(11) DEFAULT NULL COMMENT 'chapter_id',
`context_type` varchar(255) DEFAULT NULL COMMENT 'chapter',
`redirect_uri` varchar(1000) DEFAULT NULL COMMENT '最后学习的url',
`school_id` int(11) DEFAULT NULL COMMENT '学校id',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`learn_log_id`),
KEY `index_user_id` (`user_id`),
KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=195238 DEFAULT CHARSET=utf8 COMMENT='学生最后学习记录表';
-- ----------------------------
-- Table structure for `learn_log_history`
-- ----------------------------
DROP TABLE IF EXISTS `learn_log_history`;
CREATE TABLE `learn_log_history` (
`learn_log_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`tenant_id` int(11) DEFAULT NULL,
`course_wrapper_id` int(11) DEFAULT NULL,
`class_id` int(11) DEFAULT NULL,
`unit_id` int(11) DEFAULT NULL,
`context_id` int(11) DEFAULT NULL,
`context_type` varchar(255) DEFAULT NULL,
`redirect_uri` varchar(1000) DEFAULT NULL,
`school_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`learn_log_id`),
KEY `index_user_id` (`user_id`),
KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=194702 DEFAULT CHARSET=utf8 COMMENT='学生最后学习记录表(历史汇总表)';
-- ----------------------------
-- Table structure for `learn_record`
-- ----------------------------
DROP TABLE IF EXISTS `learn_record`;
CREATE TABLE `learn_record` (
`learn_record_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL COMMENT '用户id',
`class_id` int(11) DEFAULT NULL COMMENT '班次id',
`chapter_id` int(11) DEFAULT NULL,
`video_id` int(11) DEFAULT NULL COMMENT '视频id',
`video_length` int(11) DEFAULT NULL COMMENT '视频时长',
`cur_view_time` int(11) DEFAULT NULL COMMENT '当前观看时长',
`max_view_time` int(11) DEFAULT NULL COMMENT '最大观看时长',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`learn_status` int(11) DEFAULT NULL COMMENT '是否观看完成 1未完成 2完成',
PRIMARY KEY (`learn_record_id`),
UNIQUE KEY `class_chapter_user_unque_index` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
KEY `class_index` (`class_id`),
KEY `chapter_index` (`chapter_id`),
KEY `user_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13152064 DEFAULT CHARSET=utf8 COMMENT='观看视频时长表';
-- ----------------------------
-- Table structure for `learn_record_history`
-- ----------------------------
DROP TABLE IF EXISTS `learn_record_history`;
CREATE TABLE `learn_record_history` (
`learn_record_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`class_id` int(11) DEFAULT NULL,
`chapter_id` int(11) DEFAULT NULL,
`video_id` int(11) DEFAULT NULL,
`video_length` int(11) DEFAULT NULL,
`cur_view_time` int(11) DEFAULT NULL,
`max_view_time` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`learn_status` int(11) DEFAULT NULL,
PRIMARY KEY (`learn_record_id`),
UNIQUE KEY `class_chapter_user_unque_index` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
KEY `class_index` (`class_id`),
KEY `chapter_index` (`chapter_id`),
KEY `user_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15125530 DEFAULT CHARSET=utf8 COMMENT='学生观看视频时长(历史汇总表)';
-- ----------------------------
-- Table structure for `programming_record`
-- ----------------------------
DROP TABLE IF EXISTS `programming_record`;
CREATE TABLE `programming_record` (
`programming_record_id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`class_id` int(11) NOT NULL DEFAULT '0',
`chapter_id` int(11) DEFAULT NULL,
`programming_id` int(11) DEFAULT NULL,
`programming_length` int(11) DEFAULT NULL,
`cur_view_time` int(11) DEFAULT NULL,
`max_view_time` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`learn_status` int(11) DEFAULT NULL,
PRIMARY KEY (`programming_record_id`,`class_id`),
UNIQUE KEY `class_chapter_user_unque_index` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
KEY `class_index` (`class_id`),
KEY `chapter_index` (`chapter_id`),
KEY `user_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='废弃表'
/*!50100 PARTITION BY HASH (class_id)
PARTITIONS 100 */;
SET FOREIGN_KEY_CHECKS = 1;