From 8c3a5cedb749c2eccdf5600efca47ca6990a4319 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 10 Dec 2014 13:36:42 +0100 Subject: [PATCH] Working in the tags out the policies. Ticket: #1577 --- .../extras/pandoradb_migrate_5.1_to_6.0.mysql.sql | 10 ++++++++++ .../pandoradb_migrate_5.1_to_6.0.oracle.sql | 8 +++++++- .../pandoradb_migrate_5.1_to_6.0.postgreSQL.sql | 8 +++++++- pandora_console/pandoradb.oracle.sql | 15 ++++++++------- pandora_console/pandoradb.postgreSQL.sql | 7 ++++--- pandora_console/pandoradb.sql | 7 ++++--- 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index cbf910a51b..1528f6df0b 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -20,3 +20,13 @@ ALTER TABLE tlayout_data ADD COLUMN `fill_color` varchar(200) DEFAULT ""; INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('Mainframe', 'Mainframe agent', 'so_mainframe.png'); +-- --------------------------------------------------------------------- +-- Table `ttag_module` +-- --------------------------------------------------------------------- +ALTER TABLE ttag_module ADD COLUMN `id_policy_module` int(10) NOT NULL DEFAULT 0; + +UPDATE ttag_module AS t1 +SET t1.id_policy_module = ( + SELECT t2.id_policy_module + FROM tagente_modulo AS t2 + WHERE t1.id_agente_modulo = t2.id_agente_modulo); diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index 182394c445..078ad51c72 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -12,4 +12,10 @@ ALTER TABLE tlayout_data DROP COLUMN no_link_color; ALTER TABLE tlayout_data DROP COLUMN label_color; ALTER TABLE tlayout_data ADD COLUMN border_width INTEGER NOT NULL default 0; ALTER TABLE tlayout_data ADD COLUMN border_color varchar(200) DEFAULT ""; -ALTER TABLE tlayout_data ADD COLUMN fill_color varchar(200) DEFAULT ""; \ No newline at end of file +ALTER TABLE tlayout_data ADD COLUMN fill_color varchar(200) DEFAULT ""; + +-- --------------------------------------------------------------------- +-- Table `ttag_module` +-- --------------------------------------------------------------------- + +ALTER TABLE tlayout_data ADD COLUMN id_policy_module NUMBER(10, 0) DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 81ae7e6c05..d72ddf4e85 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -12,4 +12,10 @@ ALTER TABLE "tlayout_data" DROP COLUMN "no_link_color"; ALTER TABLE "tlayout_data" DROP COLUMN "label_color"; ALTER TABLE "tlayout_data" ADD COLUMN "border_width" INTEGER NOT NULL default 0; ALTER TABLE "tlayout_data" ADD COLUMN "border_color" varchar(200) DEFAULT ""; -ALTER TABLE "tlayout_data" ADD COLUMN "fill_color" varchar(200) DEFAULT ""; \ No newline at end of file +ALTER TABLE "tlayout_data" ADD COLUMN "fill_color" varchar(200) DEFAULT ""; + +-- --------------------------------------------------------------------- +-- Table `ttag_module` +-- --------------------------------------------------------------------- + +ALTER TABLE tlayout_data ADD COLUMN "id_policy_module" INTEGER NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index a97ba1e163..21d395fa01 100755 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -1700,10 +1700,11 @@ CREATE OR REPLACE TRIGGER ttag_inc BEFORE INSERT ON ttag REFERENCING NEW AS NEW -- Table "ttag_module" -- --------------------------------------------------------------------- -CREATE TABLE ttag_module ( - id_tag NUMBER(10, 0) NOT NULL, - id_agente_modulo NUMBER(10, 0) DEFAULT 0 NOT NULL, - PRIMARY KEY (id_tag, id_agente_modulo) +CREATE TABLE ttag_module ( + id_tag NUMBER(10, 0) NOT NULL, + id_agente_modulo NUMBER(10, 0) DEFAULT 0 NOT NULL, + id_policy_module NUMBER(10, 0) DEFAULT 0 NOT NULL, + PRIMARY KEY (id_tag, id_agente_modulo) ); CREATE INDEX ttag_module_id_ag_modulo_idx ON ttag_module(id_agente_modulo); @@ -1713,9 +1714,9 @@ CREATE INDEX ttag_module_id_ag_modulo_idx ON ttag_module(id_agente_modulo); -- --------------------------------------------------------------------- CREATE TABLE ttag_policy_module ( - id_tag NUMBER(10, 0) NOT NULL, - id_policy_module NUMBER(10, 0) DEFAULT 0 NOT NULL, - PRIMARY KEY (id_tag, id_policy_module) + id_tag NUMBER(10, 0) NOT NULL, + id_policy_module NUMBER(10, 0) DEFAULT 0 NOT NULL, + PRIMARY KEY (id_tag, id_policy_module) ); CREATE INDEX ttag_poli_mod_id_pol_mo_idx ON ttag_policy_module(id_policy_module); diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 20fd07b0ae..384577eb55 100755 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -1497,9 +1497,10 @@ CREATE TABLE "ttag" ( -- Table "ttag_module" -- --------------------------------------------------------------------- -CREATE TABLE "ttag_module" ( - "id_tag" INTEGER NOT NULL, - "id_agente_modulo" INTEGER NOT NULL DEFAULT 0, +CREATE TABLE "ttag_module" ( + "id_tag" INTEGER NOT NULL, + "id_agente_modulo" INTEGER NOT NULL DEFAULT 0, + "id_policy_module" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id_tag, id_agente_modulo) ); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 376ae670aa..df55a2711a 100755 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1583,9 +1583,10 @@ CREATE TABLE IF NOT EXISTS `ttag` ( -- ----------------------------------------------------- -- Table `ttag_module` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `ttag_module` ( - `id_tag` int(10) NOT NULL, - `id_agente_modulo` int(10) NOT NULL DEFAULT 0, +CREATE TABLE IF NOT EXISTS `ttag_module` ( + `id_tag` int(10) NOT NULL, + `id_agente_modulo` int(10) NOT NULL DEFAULT 0, + `id_policy_module` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (id_tag, id_agente_modulo), KEY `idx_id_agente_modulo` (`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;