on delete cascade默认情况下设置为on mysql中的限制

时间:2013-07-23 07:40:40

标签: mysql

我有两个表(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:

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)。问题是什么。

0 个答案:

没有答案