在 InnoDB 中定义关系时使用 CASCADE
我想知道在 InnoDB 中定义关系时 CASCADE 代表什么?
我发现它与操作相关:ON DELETE &关于更新。
我是否必须在表中的每个关系上将其设置为 CASCADE?
I'm wondering what does represent CASCADE when defining relations in InnoDB?
I see it's something related to actions: ON DELETE & ON UPDATE.
Do I have to set it to CASCADE on every relation in my tables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果删除一行并且其成员之一是其他地方的外键,则所有表中将其引用为外键的所有行也将被删除。
阅读:http://en.wikipedia.org/wiki/Foreign_key
If a row is deleted and one of its member is foriegn key elsewhere then then all rows in all tables which reference it as foreign key are also deleted.
Read: http://en.wikipedia.org/wiki/Foreign_key