"Fossies" - the Fresh Open Source Software Archive

Member "pandora_console/extras/mr/14.sql" (15 Sep 2021, 2273 Bytes) of package /linux/misc/pandorafms_console-7.0NG.757.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 START TRANSACTION;
    2 
    3 UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster');
    4 
    5 DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster';
    6 
    7 -- ---------------------------------------------------------------------
    8 -- Table `tagent_secondary_group`
    9 -- ---------------------------------------------------------------------
   10 
   11 create table IF NOT EXISTS `tagent_secondary_group`(
   12     `id` int unsigned not null auto_increment,
   13     `id_agent` int(10) unsigned NOT NULL,
   14     `id_group` mediumint(4) unsigned NOT NULL,
   15     PRIMARY KEY(`id`),
   16     FOREIGN KEY(`id_agent`) REFERENCES tagente(`id_agente`)
   17         ON DELETE CASCADE,
   18     FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
   19         ON DELETE CASCADE
   20 ) engine=InnoDB DEFAULT CHARSET=utf8;
   21 
   22 -- ---------------------------------------------------------------------
   23 -- Table `tmetaconsole_agent_secondary_group`
   24 -- ---------------------------------------------------------------------
   25 create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`(
   26     `id` int unsigned not null auto_increment,
   27     `id_agent` int(10) unsigned NOT NULL,
   28     `id_tagente` int(10) unsigned NOT NULL,
   29     `id_tmetaconsole_setup` int(10) NOT NULL,
   30     `id_group` mediumint(4) unsigned NOT NULL,
   31     PRIMARY KEY(`id`),
   32     FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`)
   33         ON DELETE CASCADE,
   34     FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`)
   35         ON DELETE CASCADE,
   36     FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`)
   37         ON DELETE CASCADE
   38 ) engine=InnoDB DEFAULT CHARSET=utf8;
   39 
   40 ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
   41 ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
   42 ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0';
   43 
   44 SET @st_oum721 = (SELECT IF(
   45     (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0, 
   46     "ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0)", 
   47     "0"
   48 ));
   49 
   50 PREPARE pr_oum721 FROM @st_oum721;
   51 EXECUTE pr_oum721;
   52 DEALLOCATE PREPARE pr_oum721;
   53 
   54 COMMIT;