Files
msh-system/models-integration/sql/v2_community_posts.sql

65 lines
3.2 KiB
SQL
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 : 118.89.113.119-db
Source Server Type : MySQL
Source Server Version : 50744 (5.7.44-log)
Source Host : 118.89.113.119:3306
Source Schema : shop_msh
Target Server Type : MySQL
Target Server Version : 50744 (5.7.44-log)
File Encoding : 65001
Date: 16/01/2026 11:03:26
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for v2_community_posts
-- ----------------------------
DROP TABLE IF EXISTS `v2_community_posts`;
CREATE TABLE `v2_community_posts` (
`post_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '内容ID',
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`check_in_record_id` int(11) DEFAULT NULL COMMENT '关联的打卡记录IDeb_user_sign.id当type=3时',
`title` varchar(100) NOT NULL COMMENT '标题',
`content` text COMMENT '内容',
`cover_image` varchar(255) DEFAULT NULL COMMENT '封面图URL',
`images_json` text COMMENT '图片数组JSON格式',
`nutrition_data_json` text COMMENT '营养数据快照JSON格式',
`tags_json` text COMMENT '标签数组JSON格式',
`like_count` int(11) DEFAULT '0' COMMENT '点赞数',
`comment_count` int(11) DEFAULT '0' COMMENT '评论数',
`collect_count` int(11) DEFAULT '0' COMMENT '收藏数',
`share_count` int(11) DEFAULT '0' COMMENT '分享数',
`view_count` int(11) DEFAULT '0' COMMENT '查看数',
`quick_checkin_count` int(11) DEFAULT '0' COMMENT '被一键打卡次数',
`ai_video_count` int(11) DEFAULT '0' COMMENT '生成AI视频次数关联eb_article表type=2时',
`recommend_score` decimal(10,2) DEFAULT '0.00' COMMENT '推荐分数',
`hot_score` decimal(10,2) DEFAULT '0.00' COMMENT '热门分数',
`status` varchar(20) DEFAULT 'published' COMMENT '状态draft(草稿)/published(已发布)/deleted(已删除)/banned(已封禁)',
`privacy` varchar(20) DEFAULT 'public' COMMENT '隐私设置public(公开)/followers_only(仅关注者)/private(私密)',
`audit_status` varchar(20) DEFAULT 'pending' COMMENT '审核状态pending(待审核)/approved(已通过)/rejected(已拒绝)',
`audit_time` timestamp NULL DEFAULT NULL COMMENT '审核时间',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`video_url` varchar(255) DEFAULT NULL COMMENT '视频地址',
`meal_plan_json` text COMMENT '配餐方案JSON包含早中晚三餐详情',
`ai_analysis_json` text COMMENT 'AI分析结果JSON格式',
`prompt` varchar(255) DEFAULT NULL COMMENT '提示词',
`aspect_ratio` varchar(255) DEFAULT NULL COMMENT '横竖屏',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`type` tinyint(4) DEFAULT NULL COMMENT '类型1=图片2=视频',
PRIMARY KEY (`post_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_status` (`status`),
KEY `idx_created_at` (`created_at`),
KEY `idx_recommend_score` (`recommend_score`),
KEY `idx_hot_score` (`hot_score`)
) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=utf8mb4 COMMENT='社区内容表';
SET FOREIGN_KEY_CHECKS = 1;