From 92947f218f20784e44f5449a36225116e1138ee3 Mon Sep 17 00:00:00 2001 From: vgilc Date: Fri, 27 Jan 2012 12:30:30 +0000 Subject: [PATCH] 2012-01-27 Vanessa Gil * pandoradb.sql pandoradb.oracle.sql pandoradb.postgreSQL.sql: Added delete cascade in tplanned_dowtime_agents. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5440 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/pandoradb.oracle.sql | 2 +- pandora_console/pandoradb.postgreSQL.sql | 2 +- pandora_console/pandoradb.sql | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 05730987f4..17e4da5ece 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-01-27 Vanessa Gil + + * pandoradb.sql + pandoradb.oracle.sql + pandoradb.postgreSQL.sql: Added delete cascade in tplanned_dowtime_agents. + 2012-01-27 Ramon Novoa * include/help/es/help_alert_special_days.php: Added to repository. diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index bdd7e9440d..30798c6824 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -1142,7 +1142,7 @@ CREATE OR REPLACE TRIGGER tplanned_downtime_inc BEFORE INSERT ON tplanned_downti CREATE TABLE tplanned_downtime_agents ( id NUMBER(19, 0) NOT NULL PRIMARY KEY, id_agent NUMBER(19, 0) default 0 NOT NULL, - id_downtime NUMBER(19, 0) default 0 NOT NULL + id_downtime NUMBER(19, 0) default 0 NOT NULL REFERENCES tplanned_downtime(id) ON DELETE CASCADE ); CREATE SEQUENCE tplanned_downtime_agents_s INCREMENT BY 1 START WITH 1; diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index d9792fd182..9f7b91e818 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -898,7 +898,7 @@ CREATE TABLE "tplanned_downtime" ( CREATE TABLE "tplanned_downtime_agents" ( "id" BIGSERIAL NOT NULL PRIMARY KEY, "id_agent" BIGINT NOT NULL default 0, - "id_downtime" BIGINT NOT NULL default 0 + "id_downtime" BIGINT NOT NULL REFERENCES tplanned_downtime("id") ON DELETE CASCADE ); -- GIS extension Tables diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 094955741f..4726da6dc0 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -998,7 +998,9 @@ CREATE TABLE IF NOT EXISTS `tplanned_downtime_agents` ( `id` int(20) unsigned NOT NULL auto_increment, `id_agent` mediumint(8) unsigned NOT NULL default '0', `id_downtime` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + FOREIGN KEY (`id_downtime`) REFERENCES tplanned_downtime(`id`) + ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- GIS extension Tables