Migrate sql meta policies (add id_node)

This commit is contained in:
fermin831 2018-07-18 19:19:57 +02:00
parent 223d13edd5
commit b6347072c5
2 changed files with 7 additions and 1 deletions

View File

@ -14,4 +14,8 @@ ALTER TABLE `tservice` ADD COLUMN `evaluate_sla` int(1) NOT NULL DEFAULT '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `cps` int NOT NULL DEFAULT '0';
DROP INDEX id_policy ON `tpolicy_agents`;
ALTER TABLE `tpolicy_agents` ADD COLUMN `id_node` int(10) NOT NULL DEFAULT '0';
ALTER TABLE `tpolicy_agents` ADD UNIQUE(`id_policy`, `id_agent`, `id_node`);
COMMIT;

View File

@ -2206,8 +2206,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
`policy_applied` tinyint(1) unsigned default '0',
`pending_delete` tinyint(1) unsigned default '0',
`last_apply_utimestamp` int(10) unsigned NOT NULL default 0,
`id_service` int(10) unsigned NOT NULL default 0,
`id_node` int(10) NOT NULL default 0,
PRIMARY KEY (`id`),
UNIQUE (`id_policy`, `id_agent`)
UNIQUE (`id_policy`, `id_agent`, `id_node`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------