Cloned from launchpad blueprint https://blueprints.launchpad.net/keystone/+spec/ondelete-cascade.
ForeignKey is used widely in the SQL backend, when ForeignKey is normally coupled with ondelete parameter, typical values include CASCADE, DELETE and RESTRICT.
If no value is given for this parameter, "RESTRICT" is default value which means the parent entry can not be deleted before the child entry is removed, or else the error "ERROR 1451" will be thrown when trying to remove the parent entry first. In order to make the deletion on the parent entry successfully, we have done something in the driver layer, typically, remove the child at first and then remove the parent. It shows "RESTRICT" is useless in this case, so we can migrate the FK definition from "RESTRICT" to "CASCADE", this will help to reducing database round trips.
For those entities which not allow to remove the parent when it has children, it make sense to define the FK with "RESTRICT" parameters, so the behavior will be consistent between Keystone manager and DB itself.
As to those enties which remove the parent without removing the children at first, this will prone to exceptions if no "CASCADE" is used.
Specification URL (additional information):