Files
CompanyProject/moehu/moehu-backend/moehu.sql
2024-09-27 01:32:49 +08:00

278 lines
12 KiB
PL/PgSQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 80026
Source Host : localhost:3306
Source Schema : moehu
Target Server Type : MySQL
Target Server Version : 80026
File Encoding : 65001
Date: 11/03/2022 21:47:39
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for moehu_collection
-- ----------------------------
DROP TABLE IF EXISTS `moehu_collection`;
CREATE TABLE `moehu_collection` (
`collection_id` int NOT NULL AUTO_INCREMENT,
`opus_id` int DEFAULT NULL,
`user_id` int DEFAULT NULL,
PRIMARY KEY (`collection_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_collection
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for moehu_comment
-- ----------------------------
DROP TABLE IF EXISTS `moehu_comment`;
CREATE TABLE `moehu_comment` (
`comment_id` int NOT NULL DEFAULT '1' COMMENT '评论的id',
`opus_id` int DEFAULT NULL COMMENT '作品表的作品id',
`dynamic_id` int DEFAULT NULL COMMENT '动态的id',
`user_id` int DEFAULT NULL COMMENT '用户表的用户id',
`comment_content` longtext COMMENT '评论的内容',
`comment_time` timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '评论的时间',
`comment_reply_id` int DEFAULT NULL COMMENT '回复某个人的comment_id',
`comment_to_username` varchar(255) DEFAULT NULL COMMENT '被回复人的用户名',
`user_nickname` varchar(255) DEFAULT NULL COMMENT '用户名',
`user_head_img` varchar(255) DEFAULT NULL COMMENT '用户头像',
`comment_type` int DEFAULT NULL COMMENT '评论的类型1 作品2 动态',
PRIMARY KEY (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_comment
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for moehu_dynamic
-- ----------------------------
DROP TABLE IF EXISTS `moehu_dynamic`;
CREATE TABLE `moehu_dynamic` (
`dynamic_id` int NOT NULL AUTO_INCREMENT COMMENT '动态id',
`opus_id` int DEFAULT NULL COMMENT '作品id',
`user_id` int DEFAULT NULL COMMENT '用户id',
`dynamic_introduce` longtext COMMENT '动态的内容',
`dynamic_top` int DEFAULT '0' COMMENT '动态是否置顶1置顶0不置顶',
`dynamic_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '动态的发布时间',
`dynamic_share_count` int DEFAULT '0' COMMENT '动态分享的数量',
`dynamic_comment_count` int DEFAULT '0' COMMENT '动态被评论的数量',
`dynamic_satisfied_count` int DEFAULT '0' COMMENT '动态点赞的数量',
`dynamic_text` varchar(255) DEFAULT '投稿了新作' COMMENT '投稿动态:''投稿了新作'',如果是普通动态为'''' ',
`dynamic_type` int DEFAULT '2' COMMENT '动态的类型1 投稿动态2普通动态',
`dynamic_img` varchar(255) DEFAULT NULL COMMENT '动态的封面图',
PRIMARY KEY (`dynamic_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_dynamic
-- ----------------------------
BEGIN;
INSERT INTO `moehu_dynamic` VALUES (1, NULL, 1, '测试发布动态的介绍2', 0, '2022-01-12 04:01:28', 0, 0, 0, '', 0, NULL);
COMMIT;
-- ----------------------------
-- Table structure for moehu_follow
-- ----------------------------
DROP TABLE IF EXISTS `moehu_follow`;
CREATE TABLE `moehu_follow` (
`user_to_id` int DEFAULT NULL COMMENT '被关注的人',
`user_source_id` int DEFAULT NULL COMMENT '来源的人',
`follow_id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`follow_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_follow
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for moehu_img
-- ----------------------------
DROP TABLE IF EXISTS `moehu_img`;
CREATE TABLE `moehu_img` (
`img_id` int NOT NULL AUTO_INCREMENT,
`img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片地址',
`img_width` double DEFAULT NULL COMMENT '图片宽度',
`img_height` double DEFAULT NULL COMMENT '图片高度',
`opus_id` int DEFAULT NULL COMMENT '作品id',
`user_id` int DEFAULT NULL COMMENT '用户id',
`dynamic_id` int DEFAULT NULL COMMENT '动态id',
PRIMARY KEY (`img_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_img
-- ----------------------------
BEGIN;
INSERT INTO `moehu_img` VALUES (4, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/3cbf27abdeaf4a1889b35540c22dd1a7-image_picker8237324953817607310.jpg', 1080, 2340, 2, 1, NULL);
INSERT INTO `moehu_img` VALUES (5, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/ee5f823466f74adab43ed91d456d8f2f-SH5YOE4KAH%29HA%7E%7EV41NJSU1.jpg', 1078, 1912, 2, 1, NULL);
INSERT INTO `moehu_img` VALUES (6, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/125f8ae768af44cb8dc4cde6889e5aa8-image_picker2622047004534626946.jpg', 1080, 2340, 2, 1, NULL);
INSERT INTO `moehu_img` VALUES (7, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/1.jpg', NULL, NULL, NULL, 1, 1);
INSERT INTO `moehu_img` VALUES (8, 'https://moehu.oss-cn-shanghai.aliyuncs.com/310.jpg', NULL, NULL, NULL, 1, 1);
INSERT INTO `moehu_img` VALUES (9, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/1946.jpg', NULL, NULL, NULL, 1, 1);
COMMIT;
-- ----------------------------
-- Table structure for moehu_opus
-- ----------------------------
DROP TABLE IF EXISTS `moehu_opus`;
CREATE TABLE `moehu_opus` (
`opus_id` int NOT NULL AUTO_INCREMENT COMMENT '作品id',
`user_id` int DEFAULT NULL COMMENT '用户id',
`opus_title` varchar(255) DEFAULT NULL COMMENT '作品名称',
`opus_introduce` varchar(255) DEFAULT NULL COMMENT '作品介绍',
`opus_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '作品发布时间',
`opus_satisfied` int DEFAULT '0' COMMENT '作品点赞数',
`opus_see` int DEFAULT '0' COMMENT '作品浏览量',
`opus_follow` int DEFAULT '0' COMMENT '作品的关注数量',
`opus_collection` int DEFAULT '0' COMMENT '作品的收藏数量',
`opus_img` varchar(255) DEFAULT NULL COMMENT '作品的图片',
`opus_status` int DEFAULT '0' COMMENT '作品的审核状态。等待审核0审核驳回-1审核通过1',
`opus_type` int DEFAULT '1' COMMENT '作品的分类推荐1排行2关注3',
`opus_original` int DEFAULT '1' COMMENT '作品是否原创 1原创0 非原创',
`opus_jurisdiction` int DEFAULT '1' COMMENT '作品公开范围1所有人2好友3不公开',
`opus_is_edit` int DEFAULT '0' COMMENT '作品的标签是否可被编辑1 开启编辑0 没有开启编辑',
`opus_satisfied_offset` float(255,0) DEFAULT '1' COMMENT '点赞数的偏移量',
`opus_see_offset` float(255,0) DEFAULT '1' COMMENT '作品浏览量的偏移量',
`opus_follow_offset` float(255,0) DEFAULT '1' COMMENT '作品的关注数量的偏移量',
PRIMARY KEY (`opus_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_opus
-- ----------------------------
BEGIN;
INSERT INTO `moehu_opus` VALUES (2, 1, '测试作品2', '不知道写啥介绍了2', '2022-01-12 04:06:27', 1, 0, 0, 0, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/3cbf27abdeaf4a1889b35540c22dd1a7-image_picker8237324953817607310.jpg', 0, 1, 1, 1, 0, 1, 1, 1);
COMMIT;
-- ----------------------------
-- Table structure for moehu_see
-- ----------------------------
DROP TABLE IF EXISTS `moehu_see`;
CREATE TABLE `moehu_see` (
`see_id` int NOT NULL AUTO_INCREMENT,
`see_address` varchar(255) DEFAULT NULL,
`opus_id` int DEFAULT NULL,
PRIMARY KEY (`see_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_see
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for moehu_tags
-- ----------------------------
DROP TABLE IF EXISTS `moehu_tags`;
CREATE TABLE `moehu_tags` (
`tags_id` int NOT NULL AUTO_INCREMENT COMMENT '标签id',
`opus_id` int DEFAULT NULL COMMENT '作品id',
`tags_title` varchar(255) DEFAULT NULL COMMENT '标签的内容',
`tags_recommend` int DEFAULT '1' COMMENT '该标签是否为推荐标签',
`user_id` int DEFAULT NULL COMMENT '创建标签的用户id',
PRIMARY KEY (`tags_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_tags
-- ----------------------------
BEGIN;
INSERT INTO `moehu_tags` VALUES (3, 2, '游戏', 1, 1);
INSERT INTO `moehu_tags` VALUES (4, 2, '美女', 1, 1);
COMMIT;
-- ----------------------------
-- Table structure for moehu_update
-- ----------------------------
DROP TABLE IF EXISTS `moehu_update`;
CREATE TABLE `moehu_update` (
`update_id` int DEFAULT NULL COMMENT '升级表id',
`update_version` varchar(255) DEFAULT NULL COMMENT 'app版本号',
`update_version_code` int DEFAULT NULL COMMENT '整数类型app版本号',
`update_down_url` varchar(255) DEFAULT NULL COMMENT 'app下载地址',
`update_content` longtext COMMENT 'app更新的内容',
`update_force` int DEFAULT '1' COMMENT '是否需要强制更新 1 需要0不需要',
`update_down_count` int DEFAULT '100' COMMENT 'app下载次数统计',
`update_size` int DEFAULT '0' COMMENT 'app安装包大小单位b',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'app发布版本时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_update
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for moehu_upvote
-- ----------------------------
DROP TABLE IF EXISTS `moehu_upvote`;
CREATE TABLE `moehu_upvote` (
`upvote_id` int NOT NULL AUTO_INCREMENT,
`user_id` int DEFAULT NULL,
`dynamic_id` int DEFAULT NULL,
`opus_id` int DEFAULT NULL,
PRIMARY KEY (`upvote_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_upvote
-- ----------------------------
BEGIN;
INSERT INTO `moehu_upvote` VALUES (1, 1, NULL, 2);
COMMIT;
-- ----------------------------
-- Table structure for moehu_user
-- ----------------------------
DROP TABLE IF EXISTS `moehu_user`;
CREATE TABLE `moehu_user` (
`user_id` int NOT NULL AUTO_INCREMENT COMMENT '用户id',
`user_phone` varchar(255) DEFAULT NULL COMMENT '用户的手机号',
`user_pwd` varchar(255) DEFAULT NULL COMMENT '用户的密码',
`user_real_name` varchar(255) DEFAULT NULL COMMENT '用户真实姓名',
`user_id_card` varchar(255) DEFAULT NULL COMMENT '用户身份证',
`user_email` varchar(255) DEFAULT NULL COMMENT '用户邮箱',
`user_bank_card` varchar(255) DEFAULT NULL COMMENT '用户银行卡',
`user_sex` varchar(255) DEFAULT NULL COMMENT '用户性别',
`user_work` varchar(255) DEFAULT NULL COMMENT '用户的职业',
`user_head_img` varchar(255) DEFAULT NULL COMMENT '用户头像',
`user_nickname` varchar(255) DEFAULT NULL COMMENT '用户默认昵称',
`user_uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户申请账号的固定ID不可修改',
`user_reg_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '用户注册的时间',
`user_ip` varchar(255) DEFAULT NULL COMMENT '用户最后一次登录ip',
`user_birthday` varchar(255) DEFAULT NULL COMMENT '用户出生日期',
`user_constellation` varchar(255) DEFAULT NULL COMMENT '用户的星座',
`user_autograph` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '这个人很懒,什么都没有!' COMMENT '用户签名',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Records of moehu_user
-- ----------------------------
BEGIN;
INSERT INTO `moehu_user` VALUES (1, '15155145354', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '测试账号', '9da78f56a1da4c009735608cd8250464', NULL, NULL, NULL, NULL, '这个人很懒,什么都没有!');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;