From 749bc200189bded2d7ac3edceab1ca687a458359 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 16 Jan 2018 16:02:20 +0100 Subject: [PATCH] Add db changes to pandora_migrate - #1748 --- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 41 +++++++++++++++++++ pandora_console/pandoradb.sql | 12 ++++++ 2 files changed, 53 insertions(+) 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 3d2be89369..a99bb9397c 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 @@ -1482,3 +1482,44 @@ ALTER TABLE `tdashboard` ADD COLUMN `cells_slideshow` TINYINT(1) NOT NULL defaul -- --------------------------------------------------------------------- SELECT max(unified_filters_id) INTO @max FROM tsnmp_filter; UPDATE tsnmp_filter tsf,(SELECT @max:= @max) m SET tsf.unified_filters_id = @max:= @max + 1 where tsf.unified_filters_id=0; + +-- --------------------------------------------------------------------- +-- Table `tcluster` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tcluster`( + `id` int unsigned not null auto_increment, + `name` tinytext unsigned not null, + `cluster_type` enum('AA','AP') default 'AA' unsigned not null, + `description` text unsigned not null, + `group` integer unsigned not null, + PRIMARY KEY (`id`), + FOREIGN KEY (`group`) REFERENCES tgrupo(`id_grupo`) + ON DELETE SET NULL ON UPDATE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tcluster_item` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tcluster_item`( + `id_cluster` int unsigned not null auto_increment, + `name` tinytext unsigned not null, + `item_type` enum('AA','AP') default 'AA' unsigned not null, + `critical_limit` INTEGER unsigned NOT NULL default '0', + `warning_limit` INTEGER unsigned NOT NULL default '0', + `is_critical` tinyint(2) unsigned NOT NULL default '0', + PRIMARY KEY (`id_cluster`) +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tcluster_agent` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tcluster_agent`( + `id_cluster` int unsigned not null auto_increment, + `id_agent` int unsigned not null, + PRIMARY KEY (`id_cluster`), + FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`) + ON DELETE SET NULL ON UPDATE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index bfd3ed2d30..3abf2f45c1 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3029,6 +3029,10 @@ CREATE TABLE IF NOT EXISTS `treset_pass` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tcluster` +-- --------------------------------------------------------------------- + create table IF NOT EXISTS `tcluster`( `id` int unsigned not null auto_increment, `name` tinytext unsigned not null, @@ -3040,6 +3044,10 @@ create table IF NOT EXISTS `tcluster`( ON DELETE SET NULL ON UPDATE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tcluster_item` +-- --------------------------------------------------------------------- + create table IF NOT EXISTS `tcluster_item`( `id_cluster` int unsigned not null auto_increment, `name` tinytext unsigned not null, @@ -3050,6 +3058,10 @@ create table IF NOT EXISTS `tcluster_item`( PRIMARY KEY (`id_cluster`) ) engine=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tcluster_agent` +-- --------------------------------------------------------------------- + create table IF NOT EXISTS `tcluster_agent`( `id_cluster` int unsigned not null auto_increment, `id_agent` int unsigned not null,