v2.sql 3.84 KB
Newer Older
刘基明's avatar
刘基明 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use  tamp_community;

ALTER TABLE tamp_community.file_record ADD `check_status` int(3) NOT NULL DEFAULT '0' COMMENT '审核状态 0:初试化 1:通过 2:不通过 3:需要人工再审';
ALTER TABLE tamp_community.file_record ADD `check_result_log` varchar(500) NOT NULL DEFAULT '' COMMENT '审核结果记录';

CREATE TABLE `notification` (
  `id` bigint(32) NOT NULL COMMENT 'id',
  `notification_id` varchar(64) NOT NULL DEFAULT '' COMMENT '通知主键Id',
  `notified_user_id` varchar(64) NOT NULL DEFAULT '' COMMENT '被通知的用户id',
  `message_type` varchar(64) NOT NULL DEFAULT '' COMMENT '1:转发 2:点赞 3:评论 4:关注',
  `target_id` varchar(64) NOT NULL DEFAULT '' COMMENT '目标id,类型是转发、点赞、评论时为themeId,关注则为user_id',
  `content` varchar(600) NOT NULL DEFAULT '' COMMENT '评论:评论内容  转发:topicId+内容  点赞:人数+最近3个用户',
  `operator_id` varchar(64) NOT NULL DEFAULT '' COMMENT '操作者id',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `delete_tag` int(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_user_type_time` (`notified_user_id`,`update_time`,`message_type`) USING BTREE
刘基明's avatar
刘基明 committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知记录';

CREATE TABLE `user_poster_attachement` (
                                           `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT 'id',
                                           `user_id` varchar(64) NOT NULL DEFAULT '' COMMENT '用户Id',
                                           `type` varchar(16) NOT NULL DEFAULT '' COMMENT '附件类型',
                                           `target_id` varchar(64) NOT NULL DEFAULT '' COMMENT '附件Id',
                                           `sub_type` varchar(64) NOT NULL DEFAULT '' COMMENT '子类型,article-source,fund-type',
                                           `course_packageId` varchar(64) NOT NULL DEFAULT '' COMMENT '课程包',
                                           `product_is_recommend` int(4) NOT NULL DEFAULT '0' COMMENT '是否推荐',
                                           `product_recommend` varchar(1000) NOT NULL DEFAULT '' COMMENT '推荐语',
                                           `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                           `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                           `delete_tag` int(3) NOT NULL DEFAULT '0',
                                           PRIMARY KEY (`id`) USING BTREE,
                                           KEY `idx_type_id` (`tpye`,`target_id`,`delete_tag`) USING BTREE,
                                           KEY `idx_user_type_id` (`user_id`,`type`,`target_id`,`delete_tag`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作室海报附件表';

刘基明's avatar
刘基明 committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
-- tamp_community.theme_check_duplicate definition
use tamp_community;
CREATE TABLE `theme_check_duplicate` (
    `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT 'id',
    `theme_id` varchar(64) NOT NULL DEFAULT '' COMMENT '主题Id',
    `theme_type` int(3) DEFAULT '0',
    `partition_text` varchar(64) NOT NULL DEFAULT '' COMMENT '分块',
    `partition_hash` varchar(64) NOT NULL DEFAULT '' COMMENT '分块hash',
    `partition_num` int(11) NOT NULL DEFAULT '0' COMMENT '分块号',
    `total_parts` int(11) NOT NULL DEFAULT '0' COMMENT '分块总数',
    `user_id` varchar(64) NOT NULL DEFAULT '' COMMENT '作者id',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `delete_tag` int(3) NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`),
    KEY `idx_hash_theme_num` (`partition_hash`,`theme_id`,`partition_num`) USING BTREE
刘基明's avatar
刘基明 committed
54
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='主题文字查重表';