ALTER TABLE house_type ADD CONSTRAINT fk_type
FOREIGN KEY(pid
) REFERENCES house_list(id
) ON DELETE CASCADE ON UPDATE CASCADE;
记录MySQL创建外键 级联更新和删除
最新推荐文章于 2024-09-04 20:48:11 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
ALTER TABLE house_type ADD CONSTRAINT fk_type
FOREIGN KEY(pid
) REFERENCES house_list(id
) ON DELETE CASCADE ON UPDATE CASCADE;