Merge branch '2007-Monitorizacion-de-cluster-fase-2-migrate-mr' into 'develop'

drop agents foreign keys in tcluster tables - #2007

See merge request artica/pandorafms!1460
This commit is contained in:
vgilc 2018-04-30 13:16:48 +02:00
commit b8956ea3af
2 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,9 @@
START TRANSACTION;
ALTER TABLE tcluster DROP FOREIGN KEY tcluster_ibfk_1;
ALTER TABLE tcluster_agent DROP FOREIGN KEY tcluster_agent_ibfk_1;
ALTER TABLE tcluster_agent DROP FOREIGN KEY tcluster_agent_ibfk_1;
COMMIT;

View File

@ -1509,9 +1509,7 @@ create table IF NOT EXISTS `tcluster`(
`description` text not null default '', `description` text not null default '',
`group` int(10) unsigned NOT NULL default '0', `group` int(10) unsigned NOT NULL default '0',
`id_agent` int(10) unsigned NOT NULL, `id_agent` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -1539,8 +1537,6 @@ create table IF NOT EXISTS `tcluster_agent`(
`id_cluster` int unsigned not null, `id_cluster` int unsigned not null,
`id_agent` int(10) unsigned not null, `id_agent` int(10) unsigned not null,
PRIMARY KEY (`id_cluster`,`id_agent`), PRIMARY KEY (`id_cluster`,`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE,
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`) FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
ON UPDATE CASCADE ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;