From 254ad097764cafde8edcd385c688b99ae3d62f47 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Wed, 3 Apr 2013 10:47:38 +0000 Subject: [PATCH] Migrate existing peering rules to full URI. --- db_scripts/diff/13449.down | 9 +++++++++ db_scripts/diff/13449.up | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 db_scripts/diff/13449.down create mode 100644 db_scripts/diff/13449.up diff --git a/db_scripts/diff/13449.down b/db_scripts/diff/13449.down new file mode 100644 index 00000000..5e08855b --- /dev/null +++ b/db_scripts/diff/13449.down @@ -0,0 +1,9 @@ +USE provisioning; +SET AUTOCOMMIT=0; + +UPDATE voip_peer_rules SET callee_pattern = REPLACE(callee_pattern, '^sip:', '^') + WHERE callee_pattern LIKE '^sip:%'; +UPDATE voip_peer_rules SET caller_pattern = REPLACE(caller_pattern, '^sip:', '^') + WHERE caller_pattern LIKE '^sip:%'; + +COMMIT; diff --git a/db_scripts/diff/13449.up b/db_scripts/diff/13449.up new file mode 100644 index 00000000..0b737283 --- /dev/null +++ b/db_scripts/diff/13449.up @@ -0,0 +1,9 @@ +USE provisioning; +SET AUTOCOMMIT=0; + +UPDATE voip_peer_rules SET callee_pattern = REPLACE(callee_pattern, '^', '^sip:') + WHERE callee_pattern LIKE '^%' AND callee_pattern NOT LIKE '^sip:'; +UPDATE voip_peer_rules SET caller_pattern = REPLACE(caller_pattern, '^', '^sip:') + WHERE caller_pattern LIKE '^%' AND caller_pattern NOT LIKE '^sip:'; + +COMMIT;