From 43e374f454b20dd29c21cf29d70bb65a25e69ac5 Mon Sep 17 00:00:00 2001
From: enriquecd <enrique.camargo@artica.com>
Date: Mon, 19 Mar 2018 19:09:45 +0100
Subject: [PATCH] Fix id_os 100 cluster - #1748

---
 pandora_console/extras/mr/13.sql   | 6 +++++-
 pandora_console/pandoradb_data.sql | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pandora_console/extras/mr/13.sql b/pandora_console/extras/mr/13.sql
index 1135c7d1ef..0438d41b57 100644
--- a/pandora_console/extras/mr/13.sql
+++ b/pandora_console/extras/mr/13.sql
@@ -10,7 +10,11 @@ START TRANSACTION;
 	EXECUTE pr_oum720;
 	DEALLOCATE PREPARE pr_oum720;
 	
-	INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (21, 'Cluster', 'Cluster agent', 'so_cluster.png');
+	INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png');
+	
+	UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster');
+
+	DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster';
 
 	CREATE TABLE IF NOT EXISTS `tprovisioning`(
 	    `id` int unsigned NOT NULL auto_increment,
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 105e4833a1..9552a41aea 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -142,7 +142,7 @@ INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
 (18, 'Switch', 'Generic switch', 'so_switch.png'),
 (19, 'Satellite', 'Satellite agent', 'satellite.png'),
 (20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
-(21, 'Cluster', 'Cluster agent', 'so_cluster.png');
+(100, 'Cluster', 'Cluster agent', 'so_cluster.png');
 UNLOCK TABLES;