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;
但還是WHN刪除級聯我一個從tbl_business含有包括從tbl_businessalbum的外鍵關係,即數據的行刪除記錄不會被刪除外鍵
7個問題沒有單一接受。哇。 – k102
您可能也注意到外鍵也未被強制執行。 –