Enforce topology rules and fix device deletion flow
This commit is contained in:
@@ -97,10 +97,10 @@ $devices = $sql->get(
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM connections c
|
||||
WHERE (c.port_a_type = 'device' AND c.port_a_id IN (
|
||||
WHERE ((c.port_a_type = 'device' OR c.port_a_type = 'device_ports') AND c.port_a_id IN (
|
||||
SELECT dp3.id FROM device_ports dp3 WHERE dp3.device_id = d.id
|
||||
))
|
||||
OR (c.port_b_type = 'device' AND c.port_b_id IN (
|
||||
OR ((c.port_b_type = 'device' OR c.port_b_type = 'device_ports') AND c.port_b_id IN (
|
||||
SELECT dp4.id FROM device_ports dp4 WHERE dp4.device_id = d.id
|
||||
))
|
||||
) AS connection_count
|
||||
|
||||
Reference in New Issue
Block a user