diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 50f94d866f..fdb506990d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-01-27 Vanessa Gil + + * pandoradb.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 delete cascade + in tplanned_dowtime_agents. + 2012-01-27 Juan Manuel Ramon * include/graphs/functions_fsgraph.php: Improved units in flash 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 a829d9afc1..396b860acf 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 @@ -84,3 +84,11 @@ CREATE TABLE IF NOT EXISTS `talert_special_days` ( -- ----------------------------------------------------- ALTER TABLE `talert_templates` ADD COLUMN `special_day` tinyint(1) DEFAULT '0'; + +-- ----------------------------------------------------- +-- Table `tplanned_downtime_agents` +-- ----------------------------------------------------- + +ALTER TABLE tplanned_downtime_agents +ADD FOREIGN KEY(`id_downtime`) REFERENCES tplanned_downtime(`id`) +ON DELETE CASCADE; 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 cca821e0cc..9a6cae8564 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 @@ -88,3 +88,13 @@ CREATE OR REPLACE TRIGGER talert_special_days_inc BEFORE INSERT ON talert_specia -- ----------------------------------------------------- alter table talert_templates add (special_day NUMBER(5,0) default 0); + +-- ----------------------------------------------------- +-- Table `tplanned_downtime_agents` +-- ----------------------------------------------------- + +alter table tplanned_downtime_agents +add constraint tplanned_downtimes_foreign_key +foreign key (id_downtime) +references tplanned_downtime (id); + 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 f0bf525322..5e9a7830a9 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 @@ -74,3 +74,13 @@ CREATE TABLE "talert_special_days" ( -- ----------------------------------------------------- ALTER TABLE "talert_templates" ADD COLUMN "special_day" SMALLINT default 0; + +-- ----------------------------------------------------- +-- Table `tplanned_downtime_agents` +-- ----------------------------------------------------- + +ALTER TABLE "tplanned_downtime_agents" +ADD CONSTRAINT downtime_foreign +FOREIGN KEY("id_downtime") +REFERENCES "tplanned_downtime"("id"); + diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 4726da6dc0..c6aee04421 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -997,7 +997,7 @@ CREATE TABLE IF NOT EXISTS `tplanned_downtime` ( 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', + `id_downtime` mediumint(8) NOT NULL default '0', PRIMARY KEY (`id`), FOREIGN KEY (`id_downtime`) REFERENCES tplanned_downtime(`id`) ON DELETE CASCADE