且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

级联删除导致多个级联路径

更新时间:2023-02-02 23:19:58

我会导致糟糕的设计。虽然大多数DBMS可以管理级联删除,但使用此内置功能是有风险的。您的场景是为什么这些类型的东西经常在应用程序代码中进行管理的完美示例。在那里,您可以确切地确定需要删除的内容和顺序。

I would lead toward bad design. While most DBMSs can manage cascading deletes, it is risky to use this built in functionality. Your scenario is a perfect example of why these types of things are often managed in application code. There you can determine exactly what needs to be deleted and in what order.