mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
[Secondary groups] Added SQL changes to migrate scripts
This commit is contained in:
parent
60f7a0ab79
commit
1f79326e97
@ -4,6 +4,43 @@ UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `
|
|||||||
|
|
||||||
DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster';
|
DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster';
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
-- Table `tagent_secondary_group`
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
create table IF NOT EXISTS `tagent_secondary_group`(
|
||||||
|
`id` int unsigned not null auto_increment,
|
||||||
|
`id_agent` int(10) unsigned NOT NULL,
|
||||||
|
`id_group` mediumint(4) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
FOREIGN KEY(`id_agent`) REFERENCES tagente(`id_agente`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
-- Table `tmetaconsole_agent_secondary_group`
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`(
|
||||||
|
`id` int unsigned not null auto_increment,
|
||||||
|
`id_agent` int(10) unsigned NOT NULL,
|
||||||
|
`id_tagente` int(10) unsigned NOT NULL,
|
||||||
|
`id_tmetaconsole_setup` int(10) NOT NULL,
|
||||||
|
`id_group` mediumint(4) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||||
|
ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||||
|
ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0';
|
||||||
|
|
||||||
SET @st_oum721 = (SELECT IF(
|
SET @st_oum721 = (SELECT IF(
|
||||||
(SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0,
|
(SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0,
|
||||||
"ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0)",
|
"ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0)",
|
||||||
|
@ -1604,3 +1604,40 @@ create table IF NOT EXISTS `tmigration_module_queue`(
|
|||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
-- Table `tagent_secondary_group`
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
create table IF NOT EXISTS `tagent_secondary_group`(
|
||||||
|
`id` int unsigned not null auto_increment,
|
||||||
|
`id_agent` int(10) unsigned NOT NULL,
|
||||||
|
`id_group` mediumint(4) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
FOREIGN KEY(`id_agent`) REFERENCES tagente(`id_agente`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
-- Table `tmetaconsole_agent_secondary_group`
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`(
|
||||||
|
`id` int unsigned not null auto_increment,
|
||||||
|
`id_agent` int(10) unsigned NOT NULL,
|
||||||
|
`id_tagente` int(10) unsigned NOT NULL,
|
||||||
|
`id_tmetaconsole_setup` int(10) NOT NULL,
|
||||||
|
`id_group` mediumint(4) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
|
||||||
|
ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||||
|
ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||||
|
ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user