创建表的时候添加注释
CREATE TABLE `bugjilu` (
`bid` INT(11) AUTO_INCREMENT NOT NULL COMMENT '主键',
`biaoti` VARCHAR(30) DEFAULT NULL COMMENT '标题',
`huanjing` VARCHAR(30) DEFAULT NULL COMMENT '环境',
`zhaungtai` VARCHAR(30) DEFAULT NULL COMMENT '状态',
`zycd` VARCHAR(30) DEFAULT NULL COMMENT '',
`qxlx` VARCHAR(30) DEFAULT NULL COMMENT '',
`youxianji` VARCHAR(30) DEFAULT NULL COMMENT '优先级',
`zhipai` VARCHAR(30) DEFAULT NULL COMMENT '指派',
`mokuai` VARCHAR(30) DEFAULT NULL COMMENT '模块',
`buzhou` VARCHAR(300) DEFAULT NULL COMMENT '步骤',
`yuqi` VARCHAR(300) DEFAULT NULL COMMENT '预期结果',
`shiji` VARCHAR(300) DEFAULT NULL COMMENT '实际结果',
`jietu` VARCHAR(200) DEFAULT NULL COMMENT '截图',
`jzrq` VARCHAR(30) DEFAULT NULL COMMENT '',
`jid` INT(11) DEFAULT NULL COMMENT '外键id',
PRIMARY KEY (`bid`),
KEY `jid` (`jid`),
CONSTRAINT `bugjilu_ibfk_1` FOREIGN KEY (`jid`) REFERENCES `mokuai` (`kid`)
)
给已有的表数据添加注释
ALTER TABLE bugjilu MODIFY COLUMN `bid` INT(11) COMMENT '主键',
ALTER TABLE bugjilu MODIFY COLUMN `biaoti` VARCHAR(30) COMMENT '标题';
ALTER TABLE bugjilu MODIFY COLUMN `huanjing` VARCHAR(30) COMMENT '环境';
ALTER TABLE bugjilu MODIFY COLUMN `zhaungtai` VARCHAR(30) COMMENT '状态';
ALTER TABLE bugjilu MODIFY COLUMN `zycd` VARCHAR(30) COMMENT '';
ALTER TABLE bugjilu MODIFY COLUMN `qxlx` VARCHAR(30) COMMENT '';
ALTER TABLE bugjilu MODIFY COLUMN `youxianji` VARCHAR(30) COMMENT '优先级';
ALTER TABLE bugjilu MODIFY COLUMN `zhipai` VARCHAR(30) COMMENT '指派';
ALTER TABLE bugjilu MODIFY COLUMN `mokuai` VARCHAR(30) COMMENT '模块';
ALTER TABLE bugjilu MODIFY COLUMN `buzhou` VARCHAR(300) COMMENT '步骤';
ALTER TABLE bugjilu MODIFY COLUMN `yuqi` VARCHAR(300) COMMENT '预期结果';
ALTER TABLE bugjilu MODIFY COLUMN `shiji` VARCHAR(300) COMMENT '实际结果';
ALTER TABLE bugjilu MODIFY COLUMN `jietu` VARCHAR(200) COMMENT '截图';
ALTER TABLE bugjilu MODIFY COLUMN `jzrq` VARCHAR(30) COMMENT '';
ALTER TABLE bugjilu MODIFY COLUMN `jid` INT(11) COMMENT '外键id';