通过下面的类给我生成建表语句@TableName("answer") public class Answer { @TableId(value = "id", type = IdType.AUTO) private Integer id; private Integer uid; private String uname; private String avatar; private String content; private Date time; //回复的评论id private Integer commentId; private Integer status; private Date createTime; private Date updateTime; //删除标志(0代表未删除,1代表已删除) private Integer delFlag; }
时间: 2023-05-21 19:05:53 浏览: 72
MybatisPlus中@TableField注解的使用详解
3星 · 编辑精心推荐
生成建表语句如下:
CREATE TABLE `answer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) DEFAULT NULL,
`uname` varchar(255) DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`time` timestamp NULL DEFAULT NULL,
`commentId` int(11) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NULL DEFAULT NULL,
`delFlag` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_commentId` (`commentId`),
KEY `idx_delFlag` (`delFlag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
阅读全文