mysql_ibd icon indicating copy to clipboard operation
mysql_ibd copied to clipboard

唯一索引好像生成不了

Open xiaohuazi123 opened this issue 1 year ago • 0 comments

唯一索引
CREATE TABLE `student` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'xx',
  `teacher_id` int DEFAULT NULL COMMENT 'xx',
  `name` varchar(20) NOT NULL COMMENT 'xx',
  `sex` varchar(10) DEFAULT 'male' COMMENT '覆盖',
  PRIMARY KEY (`id`),
  UNIQUE KEY `teacher_id` (`teacher_id`),
  KEY `IDXNAME` (`name`)
) ENGINE=InnoDB  COMMENT='问问';
 

生成出来teacher_id (teacher_id),这个索引不是唯一的

xiaohuazi123 avatar Jun 02 '23 14:06 xiaohuazi123