TODB should cascade delete interfaces and IP addresses when deleting a server via SQL #5364
Labels
bug
something isn't working as intended
database
relating to setup/installation/structure of the Traffic Ops database
low impact
affects only a small portion of a CDN, and cannot itself break one
Traffic Ops
related to Traffic Ops
I'm submitting a ...
Traffic Control components affected ...
Current behavior:
When trying to delete a server via
DELETE FROM server WHERE ...
, you are restricted due to theON DELETE RESTRICT
FK clauses on theinterface
andip_address
tables. Additionally, deleting server interfaces is restricted via theON DELETE RESTRICT
FK clause on theip_address
table.Expected behavior:
If you delete a server via
DELETE FROM server WHERE ...
, it should cascade delete all the server's associated interfaces and IP addresses. If you delete an interface, it should cascade delete all the interface's associated IP addresses.Basically these FK clauses should be
ON DELETE CASCADE
instead ofON DELETE RESTRICT
.Minimal reproduction of the problem with instructions:
For a server that has at least one interface, attempt to delete it via the SQL query:
DELETE FROM server WHERE id = ...
. For an interface with at least one IP address, attempt to delete it via the SQL query:DELETE FROM interface WHERE server = ... AND name = ...
.The text was updated successfully, but these errors were encountered: