1

我有两个表(music,music_details)。表的描述已在下面提到

音乐:

music | CREATE TABLE `music` (
`music_id` int(11) NOT NULL AUTO_INCREMENT,
`movie_name` varchar(100) DEFAULT NULL,
`movie_image` varchar(100) DEFAULT NULL,
`music_director` varchar(150) DEFAULT NULL,
`cast` varchar(150) DEFAULT NULL,
PRIMARY KEY (`music_id`)
ENGINE=InnoDB DEFAULT CHARSET=latin1 |

音乐详情:

music_details | CREATE TABLE `music_details` (
`music_id` int(11) DEFAULT NULL,
`songtitle` varchar(150) DEFAULT NULL,
`duration` time DEFAULT NULL,
`artist` varchar(100) DEFAULT NULL,
`lyricist` varchar(100) DEFAULT NULL,
`status` varchar(50) DEFAULT NULL,
KEY `music_id` (`music_id`),
CONSTRAINT `music_details_ibfk_1` FOREIGN KEY (`music_id`) REFERENCES `music` (`music_id`) on delete cascade on update cascade
ENGINE=InnoDB DEFAULT CHARSET=latin1 |

现在我的问题是'on delete cascade'只在那个实例上工作正常,一段时间后它设置为默认值(on delete restrict)。有什么问题。

4

0 回答 0