mysql 两张表的数据设置主外健关联删除

image_group 主表

image 副表

alter table image add constraint fk_group_id
foreign key (group_id)
references image_group(group_id)
on delete cascade

posted on 2017-07-08 18:54  Twain.王  阅读(138)  评论(0)    收藏  举报