MT#5571 Fix statements 15038.* to prevent duplicates with mysql_values.cfg.services

mr3.2.1
Alexander Lutay 11 years ago
parent 398a167fa4
commit f5d455c73a

@ -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';

@ -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')
#);

Loading…
Cancel
Save