From e11d8f37665286d66d82b7118302e6f0efc47eb8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 4 Oct 2021 19:43:57 +0200 Subject: [PATCH] minor schema update --- pandora_console/extras/mr/50.sql | 6 ++++-- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 6 ++++-- pandora_console/include/lib/View.php | 6 ++++-- pandora_console/pandoradb.sql | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pandora_console/extras/mr/50.sql b/pandora_console/extras/mr/50.sql index 295cd9ef18..a425bc64af 100644 --- a/pandora_console/extras/mr/50.sql +++ b/pandora_console/extras/mr/50.sql @@ -41,6 +41,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `model` text, `protocol` int unsigned not null default 0, `cred_key` varchar(100), + `status` int(4) NOT NULL default 5, + `last_status_change` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL @@ -49,8 +51,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( CREATE TABLE IF NOT EXISTS `tncm_agent_templates` ( `id_agent` int(10) unsigned NOT NULL, `id_template` bigint(20) unsigned NOT NULL, - `status` int(4) NOT NULL default '0', - `last_update` bigint(20) NOT NULL default '0', + `status` int(4) NOT NULL default 5, + `last_status_change` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`, `id_template`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE 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 eb85892cc3..066cb47b45 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 @@ -4131,6 +4131,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `model` text, `protocol` int unsigned not null default 0, `cred_key` varchar(100), + `status` int(4) NOT NULL default 5, + `last_status_change` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL @@ -4142,8 +4144,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( CREATE TABLE IF NOT EXISTS `tncm_agent_templates` ( `id_agent` int(10) unsigned NOT NULL, `id_template` bigint(20) unsigned NOT NULL, - `status` int(4) NOT NULL default '0', - `last_update` bigint(20) NOT NULL default '0', + `status` int(4) NOT NULL default 5, + `last_update` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`, `id_template`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE diff --git a/pandora_console/include/lib/View.php b/pandora_console/include/lib/View.php index 7182b43e6a..a571a575e7 100644 --- a/pandora_console/include/lib/View.php +++ b/pandora_console/include/lib/View.php @@ -29,14 +29,16 @@ // Begin. namespace PandoraFMS; +use HTML; + global $config; require_once $config['homedir'].'/include/class/HTML.class.php'; /** - * View class. + * View class. Extends HTML to allow print forms and inputs. */ -class View +class View extends HTML { diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 3d514fa486..036d3cc8a9 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4067,6 +4067,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `model` text, `protocol` int unsigned not null default 0, `cred_key` varchar(100), + `status` int(4) NOT NULL default 5, + `last_status_change` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL @@ -4078,8 +4080,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( CREATE TABLE IF NOT EXISTS `tncm_agent_templates` ( `id_agent` int(10) unsigned NOT NULL, `id_template` bigint(20) unsigned NOT NULL, - `status` int(4) NOT NULL default '0', - `last_update` bigint(20) NOT NULL default '0', + `status` int(4) NOT NULL default 5, + `last_status_change` bigint(20) NOT NULL default 0, PRIMARY KEY (`id_agent`, `id_template`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE