From 0a60e0954283d56dd151d696065f9d4aa3d329a1 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 8 Apr 2014 14:15:39 +0200 Subject: [PATCH] MT#6359 Properly idenfity lcr_gw by id. Since allowing duplicate ips in peering servers, we need to identify the peers using the kamailio.lcr_gw.flags column, which is actually provisioning.voip_peer_hosts.id, instead of trying to match on the ip address. --- db_scripts/diff/15053.up | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db_scripts/diff/15053.up diff --git a/db_scripts/diff/15053.up b/db_scripts/diff/15053.up new file mode 100644 index 00000000..3d7727af --- /dev/null +++ b/db_scripts/diff/15053.up @@ -0,0 +1,17 @@ +USE provisioning; + +DROP TRIGGER voip_phost_drepl_trig; +DELIMITER ;; + +CREATE TRIGGER voip_phost_drepl_trig AFTER DELETE ON voip_peer_hosts + FOR EACH ROW BEGIN + + DELETE FROM kamailio.lcr_gw + WHERE flags <=> OLD.id; + + DELETE FROM kamailio.peer_preferences + WHERE uuid = OLD.id; + +END ;; + +DELIMITER ;