• 评论表、回复表设计


      CREATE TABLE `comment` (
       `id` varchar(50) NOT NULL,
       `issue_id` varchar(50) NOT NULL COMMENT '笔记Id',
       `user_id` varchar(50) NOT NULL COMMENT '回复人',
       `reply_msg` varchar(500) DEFAULT NULL COMMENT '回复内容',
       `create_date` datetime NOT NULL COMMENT '创建时间',
       `zan_count` int COMMENT '赞数',
       PRIMARY KEY (`id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='评论表'
     
     CREATE TABLE `reply` (
       `id` varchar(50) NOT NULL,
       `comment_id` varchar(50) NOT NULL COMMENT '评论Id',
       `from_user_id` varchar(50) NOT NULL COMMENT '回复人',
       `to_user_id` varchar(50) NOT NULL COMMENT '回复对象',
       `reply_msg` varchar(500) DEFAULT NULL COMMENT '回复内容',
       `create_date` datetime NOT NULL COMMENT '创建时间',
       PRIMARY KEY (`id`),
       KEY `reply_fk1` (`comment_id`),
       CONSTRAINT `reply_fk1` FOREIGN KEY (`comment_id`) REFERENCES `comment` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='回复表'
  • 相关阅读:
    TCP/IP
    logging模块
    HttpClient当HTTP连接的时候出现大量CLOSE_WAIT连接(转)
    三 os模块
    一 time与datetime模块
    (转)HTTPS到底是个啥玩意儿?
    Python
    Codeforces Round #374 (Div. 2)
    Codeforces Round #373 (Div. 2)
    bzoj3527: [Zjoi2014]力
  • 原文地址:https://www.cnblogs.com/zjj1990/p/8350337.html
Copyright © 2020-2023  润新知