加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bgxq.sql 31.41 KB
一键复制 编辑 原始数据 按行查看 历史
lizijian83 提交于 2023-06-12 09:29 . CHG: update sql file and deploy.txt
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
/*
Navicat Premium Data Transfer
Source Server : huawei
Source Server Type : MySQL
Source Server Version : 80032 (8.0.32)
Source Host : 123.60.167.162:3306
Source Schema : bgxq
Target Server Type : MySQL
Target Server Version : 80032 (8.0.32)
File Encoding : 65001
Date: 12/06/2023 09:25:00
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for activity
-- ----------------------------
DROP TABLE IF EXISTS `activity`;
CREATE TABLE `activity` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`text` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`pic` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`hot` int NOT NULL DEFAULT 0,
`like_sum` int NOT NULL DEFAULT 0,
`visibility` tinyint UNSIGNED NOT NULL DEFAULT 0,
`comment_sum` int NOT NULL DEFAULT 0,
`is_anonymity` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_audited` tinyint UNSIGNED NOT NULL DEFAULT 0,
`view_sum` int NOT NULL DEFAULT 0,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`video` tinyint UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid_isdeleted`(`user_id` ASC, `is_deleted` ASC) USING BTREE,
INDEX `pk_hot`(`hot` ASC) USING BTREE,
FULLTEXT INDEX `ft_text`(`text`) WITH PARSER `ngram`
) ENGINE = InnoDB AUTO_INCREMENT = 676 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for activity_comment
-- ----------------------------
DROP TABLE IF EXISTS `activity_comment`;
CREATE TABLE `activity_comment` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`activity_id` int NOT NULL,
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`like_sum` int NOT NULL DEFAULT 0,
`response_sum` int NOT NULL DEFAULT 0,
`type` tinyint NOT NULL,
`is_deleted` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 675 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for activity_label
-- ----------------------------
DROP TABLE IF EXISTS `activity_label`;
CREATE TABLE `activity_label` (
`id` int NOT NULL AUTO_INCREMENT,
`activity_id` int NOT NULL,
`label_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_activityid_labelid`(`activity_id` ASC, `label_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 159 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for activity_like
-- ----------------------------
DROP TABLE IF EXISTS `activity_like`;
CREATE TABLE `activity_like` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`activity_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk`(`user_id` ASC, `activity_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3341 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for activity_view
-- ----------------------------
DROP TABLE IF EXISTS `activity_view`;
CREATE TABLE `activity_view` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`activity_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_activiityid`(`user_id` ASC, `activity_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29573 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer
-- ----------------------------
DROP TABLE IF EXISTS `answer`;
CREATE TABLE `answer` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`question_id` int NOT NULL,
`user_id` int NOT NULL,
`text` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`pic` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`hot` int NOT NULL DEFAULT 0,
`view_sum` int NOT NULL DEFAULT 0,
`agree_sum` int NOT NULL DEFAULT 0,
`oppose_sum` int NOT NULL DEFAULT 0,
`comment_sum` int NOT NULL DEFAULT 0,
`is_audited` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_anonymity` tinyint NOT NULL DEFAULT 0,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_video` tinyint UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid_isdeleted`(`user_id` ASC, `is_deleted` ASC) USING BTREE,
FULLTEXT INDEX `ft_text`(`text`) WITH PARSER `ngram`
) ENGINE = InnoDB AUTO_INCREMENT = 682 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_agree
-- ----------------------------
DROP TABLE IF EXISTS `answer_agree`;
CREATE TABLE `answer_agree` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`answer_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk`(`user_id` ASC, `answer_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3374 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_comment
-- ----------------------------
DROP TABLE IF EXISTS `answer_comment`;
CREATE TABLE `answer_comment` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`answer_id` int NOT NULL,
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`like_sum` int NOT NULL DEFAULT 0,
`response_sum` int NOT NULL DEFAULT 0,
`type` tinyint NOT NULL,
`is_deleted` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_activityid`(`answer_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 725 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_comment_like
-- ----------------------------
DROP TABLE IF EXISTS `answer_comment_like`;
CREATE TABLE `answer_comment_like` (
`id` int NOT NULL AUTO_INCREMENT,
`comment_id` int NOT NULL,
`user_id` int NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_commentid_userid`(`comment_id` ASC, `user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 499 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_comment_response
-- ----------------------------
DROP TABLE IF EXISTS `answer_comment_response`;
CREATE TABLE `answer_comment_response` (
`id` int NOT NULL AUTO_INCREMENT,
`answer_comment_id` int NOT NULL,
`from_user_id` int NOT NULL,
`to_user_id` int NOT NULL,
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`type` tinyint NOT NULL,
`is_deleted` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_activity_comment_id`(`answer_comment_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 383 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_oppose
-- ----------------------------
DROP TABLE IF EXISTS `answer_oppose`;
CREATE TABLE `answer_oppose` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`answer_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk`(`user_id` ASC, `answer_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3361 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for answer_view
-- ----------------------------
DROP TABLE IF EXISTS `answer_view`;
CREATE TABLE `answer_view` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`answer_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_activiityid`(`user_id` ASC, `answer_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 30377 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for audit_avatar
-- ----------------------------
DROP TABLE IF EXISTS `audit_avatar`;
CREATE TABLE `audit_avatar` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NULL DEFAULT NULL,
`avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 259 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for banner
-- ----------------------------
DROP TABLE IF EXISTS `banner`;
CREATE TABLE `banner` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`pic` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for blind_box
-- ----------------------------
DROP TABLE IF EXISTS `blind_box`;
CREATE TABLE `blind_box` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`sex` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '0-女 1-男',
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_collected` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 246 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for blind_box_collect_log
-- ----------------------------
DROP TABLE IF EXISTS `blind_box_collect_log`;
CREATE TABLE `blind_box_collect_log` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`blind_box_id` int UNSIGNED NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 161 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for blind_box_ticket
-- ----------------------------
DROP TABLE IF EXISTS `blind_box_ticket`;
CREATE TABLE `blind_box_ticket` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`is_used` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 222 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for comment_like
-- ----------------------------
DROP TABLE IF EXISTS `comment_like`;
CREATE TABLE `comment_like` (
`id` int NOT NULL AUTO_INCREMENT,
`comment_id` int NOT NULL,
`user_id` int NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_commentid_userid`(`comment_id` ASC, `user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 486 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for comment_response
-- ----------------------------
DROP TABLE IF EXISTS `comment_response`;
CREATE TABLE `comment_response` (
`id` int NOT NULL AUTO_INCREMENT,
`activity_comment_id` int NOT NULL,
`from_user_id` int NOT NULL,
`to_user_id` int NOT NULL,
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`type` tinyint NOT NULL,
`is_deleted` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 318 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for emoticon
-- ----------------------------
DROP TABLE IF EXISTS `emoticon`;
CREATE TABLE `emoticon` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`filename` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`user_id` int NOT NULL,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid_isdelete`(`user_id` ASC, `is_deleted` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for interactive_message
-- ----------------------------
DROP TABLE IF EXISTS `interactive_message`;
CREATE TABLE `interactive_message` (
`id` int NOT NULL AUTO_INCREMENT,
`from_user_id` int NOT NULL,
`to_user_id` int NOT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`content_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`group` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_touserid`(`to_user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1770 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for label
-- ----------------------------
DROP TABLE IF EXISTS `label`;
CREATE TABLE `label` (
`id` int NOT NULL AUTO_INCREMENT,
`content` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`icon` varchar(511) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`is_audit` tinyint UNSIGNED NOT NULL DEFAULT 0,
`hot` int NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_recommended` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `content`(`content` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for label_q
-- ----------------------------
DROP TABLE IF EXISTS `label_q`;
CREATE TABLE `label_q` (
`id` int NOT NULL AUTO_INCREMENT,
`content` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`is_audit` tinyint UNSIGNED NOT NULL DEFAULT 0,
`hot` int NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `content`(`content` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for manager_directory
-- ----------------------------
DROP TABLE IF EXISTS `manager_directory`;
CREATE TABLE `manager_directory` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`father` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for max_online_user
-- ----------------------------
DROP TABLE IF EXISTS `max_online_user`;
CREATE TABLE `max_online_user` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`num` int UNSIGNED NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_num`(`num` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for message
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`from_user_id` int NOT NULL,
`to_user_id` int NOT NULL,
`time` tinyint UNSIGNED NULL DEFAULT NULL,
`type` tinyint UNSIGNED NOT NULL,
`is_from_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_to_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `from_user_id`(`from_user_id` ASC, `to_user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3122 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for official_message
-- ----------------------------
DROP TABLE IF EXISTS `official_message`;
CREATE TABLE `official_message` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`text` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`pic` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for official_message_object
-- ----------------------------
DROP TABLE IF EXISTS `official_message_object`;
CREATE TABLE `official_message_object` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`official_message_id` int UNSIGNED NOT NULL,
`user_id` int UNSIGNED NOT NULL,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_read` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for question
-- ----------------------------
DROP TABLE IF EXISTS `question`;
CREATE TABLE `question` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`title` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`text` varchar(2048) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`pics` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`video` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`hot` int NOT NULL DEFAULT 0,
`is_anonymity` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_audited` tinyint UNSIGNED NOT NULL DEFAULT 0,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`view_sum` int NOT NULL DEFAULT 0,
`answer_sum` int NOT NULL DEFAULT 0,
`like_sum` int NOT NULL DEFAULT 0,
`collect_sum` int UNSIGNED NOT NULL DEFAULT 0,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid_isdeleted`(`user_id` ASC, `is_deleted` ASC) USING BTREE,
INDEX `pk_hot`(`hot` ASC) USING BTREE,
FULLTEXT INDEX `ft_text`(`text`, `title`) WITH PARSER `ngram`
) ENGINE = InnoDB AUTO_INCREMENT = 686 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for question_collect
-- ----------------------------
DROP TABLE IF EXISTS `question_collect`;
CREATE TABLE `question_collect` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`question_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_activiityid`(`user_id` ASC, `question_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 30293 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for question_label
-- ----------------------------
DROP TABLE IF EXISTS `question_label`;
CREATE TABLE `question_label` (
`id` int NOT NULL AUTO_INCREMENT,
`question_id` int NOT NULL,
`label_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_activityid_labelid`(`question_id` ASC, `label_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 179 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for question_like
-- ----------------------------
DROP TABLE IF EXISTS `question_like`;
CREATE TABLE `question_like` (
`id` int NOT NULL AUTO_INCREMENT,
`question_id` int NOT NULL,
`user_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 82 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for question_view
-- ----------------------------
DROP TABLE IF EXISTS `question_view`;
CREATE TABLE `question_view` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`question_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_activiityid`(`user_id` ASC, `question_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31274 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for unread_message
-- ----------------------------
DROP TABLE IF EXISTS `unread_message`;
CREATE TABLE `unread_message` (
`id` int NOT NULL AUTO_INCREMENT,
`message_id` int NOT NULL,
`is_withdraw` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`, `message_id`) USING BTREE,
UNIQUE INDEX `message_id`(`message_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1548 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`openid` char(28) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`password` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`username` varchar(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`be_attention_sum` int NOT NULL DEFAULT 0,
`visitor_sum` int NOT NULL DEFAULT 0,
`attention_sum` int NOT NULL DEFAULT 0,
`background` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`sex` tinyint UNSIGNED NULL DEFAULT NULL,
`avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_username`(`username` ASC) USING BTREE,
UNIQUE INDEX `uk_openid`(`openid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 576 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_activity_sum_gift_log
-- ----------------------------
DROP TABLE IF EXISTS `user_activity_sum_gift_log`;
CREATE TABLE `user_activity_sum_gift_log` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_attention
-- ----------------------------
DROP TABLE IF EXISTS `user_attention`;
CREATE TABLE `user_attention` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`attention_user_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_attentionuserid`(`user_id` ASC, `attention_user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1139 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_complaint
-- ----------------------------
DROP TABLE IF EXISTS `user_complaint`;
CREATE TABLE `user_complaint` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`informer_id` int UNSIGNED NOT NULL,
`object_type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`object_id` int UNSIGNED NOT NULL,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`reason` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_invite_code
-- ----------------------------
DROP TABLE IF EXISTS `user_invite_code`;
CREATE TABLE `user_invite_code` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE,
UNIQUE INDEX `uk_code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 547 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_punish
-- ----------------------------
DROP TABLE IF EXISTS `user_punish`;
CREATE TABLE `user_punish` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0,
`end_time` datetime NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk`(`user_id` ASC, `is_deleted` ASC, `end_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_signin
-- ----------------------------
DROP TABLE IF EXISTS `user_signin`;
CREATE TABLE `user_signin` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`is_deleted` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_createtime_isdeleted`(`user_id` ASC, `create_time` ASC, `is_deleted` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 528 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_signin_gift_log
-- ----------------------------
DROP TABLE IF EXISTS `user_signin_gift_log`;
CREATE TABLE `user_signin_gift_log` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid_createtime`(`user_id` ASC, `create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_verify
-- ----------------------------
DROP TABLE IF EXISTS `user_verify`;
CREATE TABLE `user_verify` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`sex` tinyint NULL DEFAULT NULL,
`stuId` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`pic` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`is_passed` tinyint UNSIGNED NOT NULL DEFAULT 0,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE,
UNIQUE INDEX `uk_stuid`(`stuId` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_vip
-- ----------------------------
DROP TABLE IF EXISTS `user_vip`;
CREATE TABLE `user_vip` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`deadline` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE COMMENT '每个用户只能有一个vip信息'
) ENGINE = InnoDB AUTO_INCREMENT = 109 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for user_visitor
-- ----------------------------
DROP TABLE IF EXISTS `user_visitor`;
CREATE TABLE `user_visitor` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`visitor_id` int NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `pk_userid`(`user_id` ASC) USING BTREE,
INDEX `pk_visitorid`(`visitor_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7145 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for vip_get_log
-- ----------------------------
DROP TABLE IF EXISTS `vip_get_log`;
CREATE TABLE `vip_get_log` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int UNSIGNED NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_userid`(`user_id` ASC) USING BTREE COMMENT '限制每个用户只能免费获取一次vip'
) ENGINE = InnoDB AUTO_INCREMENT = 81 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化