From 45cc7ae5353acc46599d37ca84329c5f1ba7b4e6 Mon Sep 17 00:00:00 2001 From: vgilc Date: Wed, 1 Feb 2012 11:04:41 +0000 Subject: [PATCH] 2012-02-01 Vanessa Gil * pandoradb.sql pandoradb.postgreSQL.sql pandoradb.oracle.sql extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added fields in tevento. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5458 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ .../extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql | 7 +++++++ .../extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql | 9 +++++++++ .../pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql | 7 +++++++ pandora_console/pandoradb.oracle.sql | 3 +++ pandora_console/pandoradb.postgreSQL.sql | 5 ++++- pandora_console/pandoradb.sql | 3 +++ 7 files changed, 43 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9ec624d72f..8b3c3b091f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2012-02-01 Vanessa Gil + + * pandoradb.sql + pandoradb.postgreSQL.sql + pandoradb.oracle.sql + extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql + extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql + extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added + fields in tevento. + 2012-02-01 Juan Manuel Ramon * operation/incidents/incident.php: removed trace. diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql index 3bfd204bf6..d05de1bac1 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql @@ -95,3 +95,10 @@ WHERE id_downtime NOT IN (SELECT id FROM tplanned_downtime); ALTER TABLE tplanned_downtime_agents ADD FOREIGN KEY(`id_downtime`) REFERENCES tplanned_downtime(`id`) ON DELETE CASCADE; + +-- ----------------------------------------------------- +-- Table `tevento` +-- ----------------------------------------------------- + +ALTER TABLE `tevento` ADD COLUMN (`source` tinytext NOT NULL DEFAULT '', +`unique_id` tinytext NOT NULL DEFAULT '', `id_extra` tinytext NOT NULL DEFAULT ''); diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql index 8ff2ad5bf0..c299fb8919 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql @@ -102,3 +102,12 @@ add constraint tplanned_downtimes_foreign_key foreign key (id_downtime) references tplanned_downtime (id); +-- ----------------------------------------------------- +-- Table `tevento` +-- ----------------------------------------------------- + +alter table tevento add (source VARCHAR2(100) default '' NOT NULL); +alter table tevento add (unique_id VARCHAR2(100) default '' NOT NULL); +alter table tevento add (id_extra VARCHAR2(100) default '' NOT NULL); + + diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql index f3f06b1074..261e00051e 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql @@ -87,3 +87,10 @@ ADD CONSTRAINT downtime_foreign FOREIGN KEY("id_downtime") REFERENCES "tplanned_downtime"("id"); +-- ----------------------------------------------------- +-- Table `tevento` +-- ----------------------------------------------------- + +ALTER TABLE "tevento" ADD COLUMN "source" text NULL default ''; +ALTER TABLE "tevento" ADD COLUMN "unique_id" text NULL default ''; +ALTER TABLE "tevento" ADD COLUMN "id_extra" text NULL default ''; diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 2392cae7ad..b17f255d6e 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -503,6 +503,9 @@ CREATE TABLE tevento ( criticity NUMBER(10, 0) default 0 NOT NULL, user_comment CLOB, tags CLOB, + source VARCHAR2(100) default '' NOT NULL, + unique_id VARCHAR2(100) default '' NOT NULL, + id_extra VARCHAR2(100) default '' NOT NULL, CONSTRAINT tevento_event_type_cons CHECK (event_type IN ('unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change')) ); CREATE INDEX tevento_id_1_idx ON tevento(id_agente, id_evento); diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 627be42216..15148f52d9 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -393,7 +393,10 @@ CREATE TABLE "tevento" ( "id_alert_am" INTEGER NOT NULL default 0, "criticity" INTEGER NOT NULL default 0, "user_comment" text NOT NULL, - "tags" text NOT NULL + "tags" text NOT NULL, + "source" text NOT NULL default '', + "unique_id" text NOT NULL default '', + "id_extra" text NOT NULL default '' ); CREATE INDEX "tevento_id_1_idx" ON "tevento"("id_agente", "id_evento"); CREATE INDEX "tevento_id_2_idx" ON "tevento"("utimestamp", "id_evento"); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 0c92b54dd7..81259723bd 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -438,6 +438,9 @@ CREATE TABLE IF NOT EXISTS `tevento` ( `criticity` int(4) unsigned NOT NULL default '0', `user_comment` text NOT NULL, `tags` text NOT NULL, + `source` tinytext NOT NULL default '', + `unique_id` tinytext NOT NULL default '', + `id_extra` tinytext NOT NULL default '', PRIMARY KEY (`id_evento`), KEY `indice_1` (`id_agente`,`id_evento`), KEY `indice_2` (`utimestamp`,`id_evento`),