ErrorCode :1826 Duplicate foreign key constranit name 'college foreign key'
那一段的代码是:
CREATE TABLE IF NOT EXISTS `jyjs161`.`homework` (
`id` INT NOT NULL AUTO_INCREMENT,
`title` VARCHAR(145) NULL,
`description` MEDIUMTEXT NULL,
`start_time` DATE NULL,
`end_time` DATE NULL,
`course_id` INT NULL,
PRIMARY KEY (`id`),
INDEX `course_foreign_key_idx` (`course_id` ASC) VISIBLE,
CONSTRAINT `course_foreign_key2`
FOREIGN KEY (`course_id`)
REFERENCES `jyjs161`.`course` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
相关分类