Merge branch '1748-Sistema-de-gestion-de-Clusters-fixMR' into 'develop'

Fix MR - #1748

See merge request artica/pandorafms!1296
This commit is contained in:
vgilc 2018-02-13 16:18:43 +01:00
commit 128be1f9d1

View File

@ -6,39 +6,51 @@ ALTER TABLE tlayout_data ADD COLUMN `clock_animation` varchar(60) NOT NULL defau
ALTER TABLE tlayout_data ADD COLUMN `time_format` varchar(60) NOT NULL default "time"; ALTER TABLE tlayout_data ADD COLUMN `time_format` varchar(60) NOT NULL default "time";
ALTER TABLE tlayout_data ADD COLUMN `timezone` varchar(60) NOT NULL default "Europe/Madrid"; ALTER TABLE tlayout_data ADD COLUMN `timezone` varchar(60) NOT NULL default "Europe/Madrid";
create table IF NOT EXISTS tcluster( -- ---------------------------------------------------------------------
id int unsigned not null auto_increment, -- Table `tcluster`
name tinytext not null default '', -- ---------------------------------------------------------------------
cluster_type enum('AA','AP') not null default 'AA',
description text not null default '', create table IF NOT EXISTS `tcluster`(
group int(10) unsigned NOT NULL default '0', `id` int unsigned not null auto_increment,
id_agent int(10) unsigned NOT NULL, `name` tinytext not null default '',
PRIMARY KEY (id), `cluster_type` enum('AA','AP') not null default 'AA',
FOREIGN KEY (id_agent) REFERENCES tagente(id_agente) `description` text not null default '',
ON UPDATE CASCADE `group` int(10) unsigned NOT NULL default '0',
`id_agent` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;
create table IF NOT EXISTS tcluster_item( -- ---------------------------------------------------------------------
id int unsigned not null auto_increment, -- Table `tcluster_item`
name tinytext not null default '', -- ---------------------------------------------------------------------
item_type enum('AA','AP') not null default 'AA',
critical_limit int unsigned NOT NULL default '0', create table IF NOT EXISTS `tcluster_item`(
warning_limit int unsigned NOT NULL default '0', `id` int unsigned not null auto_increment,
is_critical tinyint(2) unsigned NOT NULL default '0', `name` tinytext not null default '',
id_cluster int unsigned, `item_type` enum('AA','AP') not null default 'AA',
PRIMARY KEY (id), `critical_limit` int unsigned NOT NULL default '0',
FOREIGN KEY (id_cluster) REFERENCES tcluster(id) `warning_limit` int unsigned NOT NULL default '0',
ON DELETE SET NULL ON UPDATE CASCADE `is_critical` tinyint(2) unsigned NOT NULL default '0',
`id_cluster` int unsigned,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
ON DELETE SET NULL ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;
create table IF NOT EXISTS tcluster_agent( -- ---------------------------------------------------------------------
id_cluster int unsigned not null, -- Table `tcluster_agent`
id_agent int(10) unsigned not null, -- ---------------------------------------------------------------------
PRIMARY KEY (id_cluster,id_agent),
FOREIGN KEY (id_agent) REFERENCES tagente(id_agente) create table IF NOT EXISTS `tcluster_agent`(
ON UPDATE CASCADE, `id_cluster` int unsigned not null,
FOREIGN KEY (id_cluster) REFERENCES tcluster(id) `id_agent` int(10) unsigned not null,
ON UPDATE CASCADE PRIMARY KEY (`id_cluster`,`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE,
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;