简体   繁体   中英

Delete cascade for foreign keys

CREATE TABLE IF NOT EXISTS `tbl_businessalbum` 
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`image` varchar(50) NOT NULL,
`businessId` bigint(20) unsigned NOT NULL,
`addedBy_userId` bigint(20) unsigned DEFAULT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
CONSTRAINT fk_businessId FOREIGN KEY(businessId) REFERENCES tbl_business(id) 
ON DELETE CASCADE
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

But still whn I a delete a record from tbl_business the rows containing data involved in the foreign key relationship ie from tbl_businessalbum are not deleted

如果我已经过时,可以有人纠正我,但是MySQL MyISAM引擎不处理外键吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM