From f5d455c73af025f99dc4d348cfb73c481f02895c Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 6 Mar 2014 10:49:31 +0100 Subject: [PATCH] MT#5571 Fix statements 15038.* to prevent duplicates with mysql_values.cfg.services --- db_scripts/diff/15038.down | 4 ++-- db_scripts/diff/15038.up | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/db_scripts/diff/15038.down b/db_scripts/diff/15038.down index 77202673..7ed491e9 100644 --- a/db_scripts/diff/15038.down +++ b/db_scripts/diff/15038.down @@ -1,8 +1,8 @@ USE provisioning; DELETE FROM xmlhostgroups - WHERE group_id = (SELECT id FROM xmlgroups WHERE name = 'pbx') - AND host_id = (SELECT id FROM xmlhosts WHERE description = 'Sems-PBX'); + WHERE group_id IN (SELECT id FROM xmlgroups WHERE name = 'pbx') + AND host_id IN (SELECT id FROM xmlhosts WHERE description = 'Sems-PBX'); DELETE FROM xmlhosts WHERE description = 'Sems-PBX'; DELETE FROM xmlgroups WHERE name = 'pbx'; diff --git a/db_scripts/diff/15038.up b/db_scripts/diff/15038.up index ad2a640f..8bc3468e 100644 --- a/db_scripts/diff/15038.up +++ b/db_scripts/diff/15038.up @@ -1,10 +1,12 @@ -USE provisioning; - - -INSERT INTO xmlgroups VALUES (NULL, 'pbx'); -INSERT INTO xmlhosts VALUES (NULL, '127.0.0.1', '8095', '/', NULL, 'Sems-PBX'); -INSERT INTO xmlhostgroups VALUES ( - NULL, - (SELECT id FROM xmlgroups WHERE name = 'pbx'), - (SELECT id FROM xmlhosts WHERE description = 'Sems-PBX') -); +## MT#5571 The DB statements were commented to prevent errors on duplicate inserts. +## The tables xmlgroups, xmlhosts and xmlhostgroups are being handled by mysql_values.cfg.services +#USE provisioning; +# +# +#INSERT INTO xmlgroups VALUES (NULL, 'pbx'); +#INSERT INTO xmlhosts VALUES (NULL, '127.0.0.1', '8095', '/', NULL, 'Sems-PBX'); +#INSERT INTO xmlhostgroups VALUES ( +# NULL, +# (SELECT id FROM xmlgroups WHERE name = 'pbx'), +# (SELECT id FROM xmlhosts WHERE description = 'Sems-PBX') +#);