From 11d0a0f0b27191ac77df7917e1237570667c02bc Mon Sep 17 00:00:00 2001 From: javilanz Date: Wed, 23 Mar 2011 12:57:26 +0000 Subject: [PATCH] 2011-03-23 Javier Lanz * pandoradb.sql: Added creation of treport_content_item and updated treport_content table * pandoradb.postgreSQL.sql: Added creation of treport_content_item and updated treport_content table * pandoradb.oracle.sql: Added creation of treport_content_item and updated treport_content table * extras/pandoradb_migrate_v3.2_to_v4.0.sql: Added creation of treport_content_item and updated treport_content table git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4124 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++++++++++ .../extras/pandoradb_migrate_v3.2_to_v4.0.sql | 10 +++++++++ pandora_console/pandoradb.oracle.sql | 21 ++++++++++++++++++- pandora_console/pandoradb.postgreSQL.sql | 16 +++++++++++++- pandora_console/pandoradb.sql | 7 +++++++ 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f7b667f548..56ffde3e8c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2011-03-23 Javier Lanz + + * pandoradb.sql: Added creation of treport_content_item and updated + treport_content table + * pandoradb.postgreSQL.sql: Added creation of treport_content_item and + updated treport_content table + * pandoradb.oracle.sql: Added creation of treport_content_item and + updated treport_content table + * extras/pandoradb_migrate_v3.2_to_v4.0.sql: Added creation of + treport_content_item and updated treport_content table + 2011-03-23 Miguel de Dios * extensions/insert_data.php, extensions/system_info.php, diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index a0eb1f688b..b78b2f02a6 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -41,6 +41,16 @@ ALTER TABLE `treport_content` ADD COLUMN `order_uptodown` INT NOT NULL DEFAULT 0 ALTER TABLE `treport_content` ADD COLUMN `show_graph` INT NOT NULL DEFAULT 0; ALTER TABLE `treport_content` ADD COLUMN `group_by_agent` INT NOT NULL DEFAULT 0; +-- ----------------------------------------------------- +-- Table `treport_content_item` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `treport_content_item` ( + `id` INTEGER UNSIGNED NOT NULL auto_increment, + `id_report_content` INTEGER UNSIGNED NOT NULL, + `id_agent_module` int(10) unsigned NOT NULL, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + -- ----------------------------------------------------- -- Table `tusuario` -- ----------------------------------------------------- diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 69d9393dd2..f89fcedceb 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -929,7 +929,15 @@ CREATE TABLE treport_content ( friday NUMBER(5, 0) default 1 NOT NULL, saturday NUMBER(5, 0) default 1 NOT NULL, sunday NUMBER(5, 0) default 1 NOT NULL, - only_display_wrong NUMBER(5, 0) default 0 NOT NULL + only_display_wrong NUMBER(5, 0) default 0 NOT NULL, + top_n NUMBER(10, 0) default 0 NOT NULL, + top_n_value NUMBER(10, 0) default 10 NOT NULL , + exception_condition NUMBER(10, 0) default 0 NOT NULL, + exception_condition_value DOUBLE (18,6) default 0 NOT NULL, + show_resume NUMBER(10, 0) default 0 NOT NULL, + order_uptodown NUMBER(10, 0) default 0 NOT NULL, + show_graph NUMBER(10, 0) default 0 NOT NULL, + group_by_agent NUMBER(10, 0) default 0 NOT NULL, ); CREATE SEQUENCE treport_content_s INCREMENT BY 1 START WITH 1; @@ -963,6 +971,17 @@ CREATE OR REPLACE TRIGGER treport_cont_sla_comb_update AFTER UPDATE OF ID_RC ON CREATE OR REPLACE TRIGGER treport_cont_sla_comb_update1 AFTER UPDATE OF ID_AGENTE_MODULO ON tagente_modulo FOR EACH ROW BEGIN UPDATE treport_content_sla_combined SET ID_AGENT_MODULE = :NEW.ID_AGENTE_MODULO WHERE ID_AGENT_MODULE = :OLD.ID_AGENTE_MODULO; END; / +CREATE TABLE treport_content_item ( + id NUMBER(10, 0) NOT NULL PRIMARY KEY, + id_report_content NUMBER(10, 0) NOT NULL, + id_agent_module NUMBER(10, 0) NOT NULL +); + +CREATE SEQUENCE treport_cont_i_s INCREMENT BY 1 START WITH 1; + +CREATE OR REPLACE TRIGGER treport_content_i_inc BEFORE INSERT ON treport_content_item REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT treport_cont_i_s.nextval INTO :NEW.ID FROM dual; END treport_content_i_inc; +/ + CREATE TABLE treport_custom_sql ( id NUMBER(10, 0) NOT NULL PRIMARY KEY, name VARCHAR2(150) default '' NOT NULL, diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index acad3057b8..d893f1b398 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -742,7 +742,15 @@ CREATE TABLE "treport_content" ( "friday" SMALLINT NOT NULL default 1, "saturday" SMALLINT NOT NULL default 1, "sunday" SMALLINT NOT NULL default 1, - "only_display_wrong" SMALLINT NOT NULL default 0 + "only_display_wrong" SMALLINT NOT NULL default 0, + "top_n" INTEGER NOT NULL default 0, + "top_n_value" INTEGER NOT NULL default 10, + "exception_condition" INTEGER NOT NULL default 0, + "exception_condition_value" DOUBLE PRECISION NOT NULL default 0, + "show_resume" INTEGER NOT NULL default 0, + "order_uptodown" INTEGER NOT NULL default 0, + "show_graph" INTEGER NOT NULL default 0, + "group_by_agent" INTEGER NOT NULL default 0 ); CREATE TABLE "treport_content_sla_combined" ( @@ -754,6 +762,12 @@ CREATE TABLE "treport_content_sla_combined" ( "sla_limit" DOUBLE PRECISION NOT NULL default 0 ); +CREATE TABLE "treport_content_item" ( + "id" SERIAL NOT NULL PRIMARY KEY, + "id_report_content" INTEGER NOT NULL, + "id_agent_module" INTEGER NOT NULL +); + CREATE TABLE "treport_custom_sql" ( "id" SERIAL NOT NULL PRIMARY KEY, "name" varchar(150) NOT NULL default '', diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 49ae3fa82f..f738e92a70 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -842,6 +842,13 @@ CREATE TABLE IF NOT EXISTS `treport_content_sla_combined` ( ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `treport_content_item` ( + `id` INTEGER UNSIGNED NOT NULL auto_increment, + `id_report_content` INTEGER UNSIGNED NOT NULL, + `id_agent_module` int(10) unsigned NOT NULL, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `treport_custom_sql` ( `id` INTEGER UNSIGNED NOT NULL auto_increment, `name` varchar(150) NOT NULL default '',