MySQL建表SQL语句
数据库结构:建站-商品评论表:https://open.yesapi.cn/tablelist/yesapi_jpress_product_comment.html
-- 数据库大全:建站-商品评论表
-- 来源:YesApi.cn
CREATE TABLE `yesapi_jpress_product_comment` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(11) NULL COMMENT '回复的评论ID',
`product_id` int(11) NULL COMMENT '评论的产品ID',
`user_id` int(11) NULL COMMENT '评论的用户ID',
`author` varchar(128) NULL COMMENT '评论的作者',
`content` text NULL COMMENT '评论的内容',
`reply_count` int(11) NULL DEFAULT '0' COMMENT '评论的回复数量',
`order_number` int(11) NULL DEFAULT '0' COMMENT '排序编号,常用语置顶等',
`vote_up` int(11) NULL DEFAULT '0' COMMENT '“顶”的数量',
`vote_down` int(11) NULL DEFAULT '0' COMMENT '“踩”的数量',
`yesapi_jpress_product_comment_status` tinyint(2) NULL COMMENT '评论的状态',
`created` datetime NULL COMMENT '评论的时间',
KEY `pid` (`pid`),
KEY `product_id` (`product_id`),
KEY `user_id` (`user_id`),
KEY `yesapi_jpress_product_comment_status` (`yesapi_jpress_product_comment_status`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT '建站-商品评论表';
复制后,到数据库执行,即可创建此数据库表。
MySQL数据库表结构设计
第 1-11 条, 共 11 条.
字段名称 | 字段类型 | 字段默认值 | 是否允许为空 | 字段描述 | 索引 | 字段数据示例 |
---|---|---|---|---|---|---|
pid | int(11) | 是 | 回复的评论ID | 普通索引 | ||
product_id | int(11) | 是 | 评论的产品ID | 普通索引 | ||
user_id | int(11) | 是 | 评论的用户ID | 普通索引 | ||
author | varchar(128) | 是 | 评论的作者 | 无索引 | ||
content | text | 是 | 评论的内容 | 无索引 | ||
reply_count | int(11) | 0 | 是 | 评论的回复数量 | 无索引 | 0 |
order_number | int(11) | 0 | 是 | 排序编号,常用语置顶等 | 无索引 | 0 |
vote_up | int(11) | 0 | 是 | “顶”的数量 | 无索引 | 0 |
vote_down | int(11) | 0 | 是 | “踩”的数量 | 无索引 | 0 |
yesapi_jpress_product_comment_status | tinyint(2) | 是 | 评论的状态 | 普通索引 | ||
created | datetime | 是 | 评论的时间 | 无索引 |