每日必备
#添加外键 先保证删除了 再添加
ALTER TABLE `student_info` DROP FOREIGN KEY `courseid`;
ALTER TABLE `student_info` ADD CONSTRAINT `courseid` FOREIGN KEY (`course_id`)
REFERENCES `course_info` (`course_id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
LOCK TABLES `student_info` WRITE;
ulock tables;
网友评论