CREATE TABLE t_user
(
id
int(11) NOT NULL AUTO_INCREMENT,
account
varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
password
varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
realname
varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
评论表
CREATE TABLE t_comment
(
id
int(11) NOT NULL AUTO_INCREMENT,
user_id
int(11) NOT NULL COMMENT ‘评论人id,对应用户表的id’,
pl_content
varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ‘评论的内容’,
pl_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
回复表
CREATE TABLE t_revert
(
id
int(11) NOT NULL AUTO_INCREMENT,
pl_id
int(11) NOT NULL COMMENT ‘评论人id,对应t_comment.id’,
user_id
int(11) DEFAULT NULL COMMENT ‘回复人id,对应当前登录的账号.id’,
hf_content
varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ‘回复的内容’,
hf_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘回复的时间’,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb