mirror of
https://github.com/mindskip/xzs-mysql.git
synced 2026-08-28 11:07:50 +08:00
数据库脚本
This commit is contained in:
@@ -0,0 +1,292 @@
|
||||
CREATE DATABASE `xzs` CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
|
||||
USE xzs;
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_exam_paper
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_exam_paper`;
|
||||
CREATE TABLE `t_exam_paper` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`subject_id` int NULL DEFAULT NULL,
|
||||
`paper_type` int NULL DEFAULT NULL,
|
||||
`grade_level` int NULL DEFAULT NULL,
|
||||
`score` int NULL DEFAULT NULL,
|
||||
`question_count` int NULL DEFAULT NULL,
|
||||
`suggest_time` int NULL DEFAULT NULL,
|
||||
`limit_start_time` datetime NULL DEFAULT NULL,
|
||||
`limit_end_time` datetime NULL DEFAULT NULL,
|
||||
`frame_text_content_id` int NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`deleted` bit(1) NULL DEFAULT NULL,
|
||||
`task_exam_id` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_exam_paper
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_exam_paper_answer
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_exam_paper_answer`;
|
||||
CREATE TABLE `t_exam_paper_answer` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_paper_id` int NULL DEFAULT NULL,
|
||||
`paper_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`paper_type` int NULL DEFAULT NULL,
|
||||
`subject_id` int NULL DEFAULT NULL,
|
||||
`system_score` int NULL DEFAULT NULL,
|
||||
`user_score` int NULL DEFAULT NULL,
|
||||
`paper_score` int NULL DEFAULT NULL,
|
||||
`question_correct` int NULL DEFAULT NULL,
|
||||
`question_count` int NULL DEFAULT NULL,
|
||||
`do_time` int NULL DEFAULT NULL,
|
||||
`status` int NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`task_exam_id` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_exam_paper_answer
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_exam_paper_question_customer_answer
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_exam_paper_question_customer_answer`;
|
||||
CREATE TABLE `t_exam_paper_question_customer_answer` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`question_id` int NULL DEFAULT NULL,
|
||||
`exam_paper_id` int NULL DEFAULT NULL,
|
||||
`exam_paper_answer_id` int NULL DEFAULT NULL,
|
||||
`question_type` int NULL DEFAULT NULL,
|
||||
`subject_id` int NULL DEFAULT NULL,
|
||||
`customer_score` int NULL DEFAULT NULL,
|
||||
`question_score` int NULL DEFAULT NULL,
|
||||
`question_text_content_id` int NULL DEFAULT NULL,
|
||||
`answer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`text_content_id` int NULL DEFAULT NULL,
|
||||
`do_right` bit(1) NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`item_order` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_exam_paper_question_customer_answer
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_message
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_message`;
|
||||
CREATE TABLE `t_message` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`send_user_id` int NULL DEFAULT NULL,
|
||||
`send_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`send_real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`receive_user_count` int NULL DEFAULT NULL,
|
||||
`read_count` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_message
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_message_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_message_user`;
|
||||
CREATE TABLE `t_message_user` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`message_id` int NULL DEFAULT NULL,
|
||||
`receive_user_id` int NULL DEFAULT NULL,
|
||||
`receive_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`receive_real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`readed` bit(1) NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`read_time` datetime NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_message_user
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_question
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_question`;
|
||||
CREATE TABLE `t_question` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`question_type` int NULL DEFAULT NULL,
|
||||
`subject_id` int NULL DEFAULT NULL,
|
||||
`score` int NULL DEFAULT NULL,
|
||||
`grade_level` int NULL DEFAULT NULL,
|
||||
`difficult` int NULL DEFAULT NULL,
|
||||
`correct` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`info_text_content_id` int NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`status` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`deleted` bit(1) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_question
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_subject
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_subject`;
|
||||
CREATE TABLE `t_subject` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`level` int NULL DEFAULT NULL,
|
||||
`level_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`item_order` int NULL DEFAULT NULL,
|
||||
`deleted` bit(1) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_subject
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_task_exam
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_task_exam`;
|
||||
CREATE TABLE `t_task_exam` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`grade_level` int NULL DEFAULT NULL,
|
||||
`frame_text_content_id` int NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`deleted` bit(1) NULL DEFAULT NULL,
|
||||
`create_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_task_exam
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_task_exam_customer_answer
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_task_exam_customer_answer`;
|
||||
CREATE TABLE `t_task_exam_customer_answer` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`task_exam_id` int NULL DEFAULT NULL,
|
||||
`create_user` int NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`text_content_id` int NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_task_exam_customer_answer
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_text_content
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_text_content`;
|
||||
CREATE TABLE `t_text_content` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_text_content
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_user`;
|
||||
CREATE TABLE `t_user` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_uuid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`age` int NULL DEFAULT NULL,
|
||||
`sex` int NULL DEFAULT NULL,
|
||||
`birth_day` datetime NULL DEFAULT NULL,
|
||||
`user_level` int NULL DEFAULT NULL,
|
||||
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`role` int NULL DEFAULT NULL,
|
||||
`status` int NULL DEFAULT NULL,
|
||||
`image_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`modify_time` datetime NULL DEFAULT NULL,
|
||||
`last_active_time` datetime NULL DEFAULT NULL,
|
||||
`deleted` bit(1) NULL DEFAULT NULL,
|
||||
`wx_open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_user
|
||||
-- ----------------------------
|
||||
INSERT INTO `t_user` VALUES (1, 'd2d29da2-dcb3-4013-b874-727626236f47', 'student', 'D1AGFL+Gx37t0NPG4d6biYP5Z31cNbwhK5w1lUeiHB2zagqbk8efYfSjYoh1Z/j1dkiRjHU+b0EpwzCh8IGsksJjzD65ci5LsnodQVf4Uj6D3pwoscXGqmkjjpzvSJbx42swwNTA+QoDU8YLo7JhtbUK2X0qCjFGpd+8eJ5BGvk=', '学生', 18, 1, '2019-09-01 16:00:00', 1, '19171171610', 1, 1, 'https://www.mindskip.net:9008/image/ba607a75-83ba-4530-8e23-660b72dc4953/头像.jpg', '2019-09-07 18:55:02', '2020-02-04 08:26:54', NULL, b'0', NULL);
|
||||
INSERT INTO `t_user` VALUES (2, '52045f5f-a13f-4ccc-93dd-f7ee8270ad4c', 'admin', 'D1AGFL+Gx37t0NPG4d6biYP5Z31cNbwhK5w1lUeiHB2zagqbk8efYfSjYoh1Z/j1dkiRjHU+b0EpwzCh8IGsksJjzD65ci5LsnodQVf4Uj6D3pwoscXGqmkjjpzvSJbx42swwNTA+QoDU8YLo7JhtbUK2X0qCjFGpd+8eJ5BGvk=', '管理员', 30, 1, '2019-09-07 18:56:07', NULL, NULL, 3, 1, NULL, '2019-09-07 18:56:21', NULL, NULL, b'0', NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_user_event_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_user_event_log`;
|
||||
CREATE TABLE `t_user_event_log` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NULL DEFAULT NULL,
|
||||
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_user_event_log
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_user_token
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_user_token`;
|
||||
CREATE TABLE `t_user_token` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`token` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`user_id` int NULL DEFAULT NULL,
|
||||
`wx_open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`end_time` datetime NULL DEFAULT NULL,
|
||||
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_user_token
|
||||
-- ----------------------------
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user