From 347769299bd478e34819c16c938c0dfc16c48de1 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 30 Nov 2021 14:23:19 +0100 Subject: [PATCH] outocreate remote user centralized node --- pandora_console/extras/mr/51.sql | 2 ++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pandora_console/extras/mr/51.sql b/pandora_console/extras/mr/51.sql index 0a6e837195..d358c8b349 100644 --- a/pandora_console/extras/mr/51.sql +++ b/pandora_console/extras/mr/51.sql @@ -29,4 +29,6 @@ ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `ta ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`; +UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2; + COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index b31b13875c..b82023a1a3 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -4252,3 +4252,5 @@ UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday'; ALTER TABLE `talert_special_days` DROP COLUMN `same_day`; ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2;