日期:2014-05-16 浏览次数:20762 次
以下方法来自网络:
?
CREATE TABLE person_fileinfo (
person_id int not null,
fileinfo_id int NOT NULL ,
primary key(person_id,fileinfo_id),
FOREIGN KEY(fileinfo_id) REFERENCES fileinfo(id) ON DELETE CASCADE,
FOREIGN KEY(person_id) REFERENCES person(id) ON DELETE CASCADE
)
注意加入ON DELETE CASCADE
?
?
?
?