2013-03-07 Miguel de Dios <miguel.dedios@artica.es>

* pandoradb.oracle.sql,
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
	extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
	godmode/agentes/planned_downtime.editor.php, pandoradb.sql,
	pandoradb.postgreSQL.sql: added id_user to planned_downtime table
	for to know who create or updte any downtime.
	
	Fixes: #3607172




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7810 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-03-07 17:20:41 +00:00
parent 7a6614912b
commit 2bd6623e09
8 changed files with 30 additions and 4 deletions

View File

@ -1,3 +1,15 @@
2013-03-07 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.editor.php, pandoradb.sql,
pandoradb.postgreSQL.sql: added id_user to planned_downtime table
for to know who create or updte any downtime.
Fixes: #3607172
2013-03-07 Sergio Martin <sergio.martin@artica.es>
* include/functions_events.php

View File

@ -100,6 +100,7 @@ ALTER TABLE `tplanned_downtime` ADD COLUMN `periodically_day_to` int(100) unsign
ALTER TABLE `tplanned_downtime` ADD COLUMN `type_downtime` varchar(100) NOT NULL default 'disabled_agents_alerts';
ALTER TABLE `tplanned_downtime` ADD COLUMN `type_execution` varchar(100) NOT NULL default 'once';
ALTER TABLE `tplanned_downtime` ADD COLUMN `type_periodicity` varchar(100) NOT NULL default 'weekly';
ALTER TABLE `tplanned_downtime` ADD COLUMN `id_user` varchar(100) NOT NULL default '0';
-- ----------------------------------------------------------------------
-- Table `tplanned_downtime_agents`

View File

@ -125,6 +125,7 @@ ALTER TABLE tplanned_downtime ADD (periodically_day_to NUMBER(19, 0) default NUL
ALTER TABLE tplanned_downtime ADD (type_downtime VARCHAR2(100) NOT NULL default 'disabled_agents_alerts');
ALTER TABLE tplanned_downtime ADD (type_execution VARCHAR2(100) NOT NULL default 'once');
ALTER TABLE tplanned_downtime ADD (type_periodicity VARCHAR2(100) NOT NULL default 'weekly');
ALTER TABLE tplanned_downtime ADD (id_user VARCHAR2(100) default '0' NOT NULL);
-- -----------------------------------------------------
-- Table tplanned_downtime_agents

View File

@ -118,6 +118,7 @@ ALTER TABLE "tplanned_downtime" ADD COLUMN "periodically_day_to" SMALLINT defaul
ALTER TABLE "tplanned_downtime" ADD COLUMN "type_downtime" VARCHAR( 100 ) NOT NULL default 'disabled_agents_alerts';
ALTER TABLE "tplanned_downtime" ADD COLUMN "type_execution" VARCHAR( 100 ) NOT NULL default 'once';
ALTER TABLE "tplanned_downtime" ADD COLUMN "type_periodicity" VARCHAR( 100 ) NOT NULL default 'weekly';
ALTER TABLE "tplanned_downtime" ADD COLUMN "id_user" varchar(100) NOT NULL default '0';
-- -----------------------------------------------------
-- Table "tplanned_downtime_agents"

View File

@ -115,6 +115,12 @@ if ($insert_downtime_agent == 1) {
'id_agent' => $id_agente_dt,
'id_agent_module' => $module["id_agente_modulo"]);
$result = db_process_sql_insert('tplanned_downtime_modules', $values);
if ($result) {
$values = array('id_user' => $config['id_user']);
$result = db_process_sql_update('tplanned_downtime',
$values, array('id' => $id_downtime));
}
}
}
}
@ -177,7 +183,8 @@ if ($create_downtime || $update_downtime) {
'periodically_day_to' => $periodically_day_to,
'type_downtime' => $type_downtime,
'type_execution' => $type_execution,
'type_periodicity' => $type_periodicity
'type_periodicity' => $type_periodicity,
'id_user' => $config['id_user']
);
$result = db_process_sql_insert(
'tplanned_downtime', $values);
@ -215,7 +222,8 @@ if ($create_downtime || $update_downtime) {
'periodically_day_to' => $periodically_day_to,
'type_downtime' => $type_downtime,
'type_execution' => $type_execution,
'type_periodicity' => $type_periodicity
'type_periodicity' => $type_periodicity,
'id_user' => $config['id_user']
);
$result = db_process_sql_update('tplanned_downtime', $values, array('id' => $id_downtime));
}

View File

@ -1255,7 +1255,8 @@ CREATE TABLE tplanned_downtime (
periodically_day_to NUMBER(19, 0) default NULL,
type_downtime VARCHAR2(100) NOT NULL default 'disabled_agents_alerts',
type_execution VARCHAR2(100) NOT NULL default 'once',
type_periodicity VARCHAR2(100) NOT NULL default 'weekly'
type_periodicity VARCHAR2(100) NOT NULL default 'weekly',
id_user VARCHAR2(100) default '0' NOT NULL
);
CREATE SEQUENCE tplanned_downtime_s INCREMENT BY 1 START WITH 1;
CREATE OR REPLACE TRIGGER tplanned_downtime_inc BEFORE INSERT ON tplanned_downtime REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplanned_downtime_s.nextval INTO :NEW.ID FROM dual; END tplanned_downtime_inc;;

View File

@ -1104,7 +1104,8 @@ CREATE TABLE "tplanned_downtime" (
"periodically_day_to" SMALLINT default NULL,
"type_downtime" VARCHAR( 100 ) NOT NULL default 'disabled_agents_alerts',
"type_execution" VARCHAR( 100 ) NOT NULL default 'once',
"type_periodicity" VARCHAR( 100 ) NOT NULL default 'weekly'
"type_periodicity" VARCHAR( 100 ) NOT NULL default 'weekly',
"id_user" varchar(100) NOT NULL default '0'
);
-- ---------------------------------------------------------------------

View File

@ -1195,6 +1195,7 @@ CREATE TABLE IF NOT EXISTS `tplanned_downtime` (
`type_downtime` varchar(100) NOT NULL default 'disabled_agents_alerts',
`type_execution` varchar(100) NOT NULL default 'once',
`type_periodicity` varchar(100) NOT NULL default 'weekly',
`id_user` varchar(100) NOT NULL default '0',
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET=utf8;