From fa35e6054c5abad2aee8d3927cf7f0cf3ea712b8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 8 Oct 2021 15:30:17 +0200 Subject: [PATCH] Fixes --- pandora_console/extras/mr/50.sql | 7 ++++--- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 9 +++++---- pandora_console/pandoradb.sql | 10 +++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pandora_console/extras/mr/50.sql b/pandora_console/extras/mr/50.sql index b012cc8b00..08dbcd1903 100644 --- a/pandora_console/extras/mr/50.sql +++ b/pandora_console/extras/mr/50.sql @@ -53,8 +53,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, `config_backup_id` bigint(20) UNSIGNED DEFAULT NULL, - `id_template` bigint(20) unsigned, - `execute` int(2) UNSIGNED NOT NULL default 0, + `id_template` bigint(20) unsigned, + `execute` int(2) UNSIGNED 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, @@ -62,13 +62,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tncm_agent_data` ( + `id` serial, `id_agent` int(10) unsigned NOT NULL, `script_type` int unsigned not null, `data` LONGBLOB, `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, - PRIMARY KEY (`id_agent`, `id_script`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + 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 379ae946e1..89e17ae84b 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 @@ -4098,7 +4098,7 @@ UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de'; -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tncm_template` ( `id` serial, - `name` text, + `name` text, `vendor` varchar(500), `model` varchar(500), PRIMARY KEY (`id`), @@ -4139,8 +4139,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, `config_backup_id` bigint(20) UNSIGNED DEFAULT NULL, - `id_template` bigint(20) unsigned, - `execute` int(2) UNSIGNED NOT NULL default 0, + `id_template` bigint(20) unsigned, + `execute` int(2) UNSIGNED 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, @@ -4151,11 +4151,12 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( -- Table `tncm_agent_data` -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tncm_agent_data` ( + `id` serial, `id_agent` int(10) unsigned NOT NULL, `script_type` int unsigned not null, `data` LONGBLOB, `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, - PRIMARY KEY (`id_agent`, `id_script`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index d19119dbb8..541cdcf29a 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4034,8 +4034,8 @@ CREATE TABLE IF NOT EXISTS `tsync_queue` ( -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tncm_template` ( `id` serial, - `name` text, - `vendor` varchar(500), + `name` text, + `vendor` varchar(500), `model` varchar(500), PRIMARY KEY (`id`), UNIQUE(`vendor`, `model`) @@ -4075,8 +4075,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, `config_backup_id` bigint(20) UNSIGNED DEFAULT NULL, - `id_template` bigint(20) unsigned, - `execute` int(2) UNSIGNED NOT NULL default 0, + `id_template` bigint(20) unsigned, + `execute` int(2) UNSIGNED 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, @@ -4087,11 +4087,11 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( -- Table `tncm_agent_data` -- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tncm_agent_data` ( + `id` serial, `id_agent` int(10) unsigned NOT NULL, `script_type` int unsigned not null, `data` LONGBLOB, `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, - PRIMARY KEY (`id_agent`, `id_script`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;