summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-23 07:58:39 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-23 07:58:39 +0000
commitc9ab150760446741460d7ef65de9f5ca643beb82 (patch)
tree9142e7c94e7d26e65a45de4c956628d26fa58b6c /upgrades/dbpatches
parent67caec0a308312b19cc85f6c09e482d717c0f252 (diff)
downloadzabbix-c9ab150760446741460d7ef65de9f5ca643beb82.tar.gz
zabbix-c9ab150760446741460d7ef65de9f5ca643beb82.tar.xz
zabbix-c9ab150760446741460d7ef65de9f5ca643beb82.zip
- support of multiple actions per set of conidtions (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@3910 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'upgrades/dbpatches')
-rw-r--r--upgrades/dbpatches/1.3/mysql/patch/actions.sql38
-rw-r--r--upgrades/dbpatches/1.3/mysql/patch/operations.sql1
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/actions.sql38
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/operations.sql1
4 files changed, 52 insertions, 26 deletions
diff --git a/upgrades/dbpatches/1.3/mysql/patch/actions.sql b/upgrades/dbpatches/1.3/mysql/patch/actions.sql
index c31e23ca..c5b41393 100644
--- a/upgrades/dbpatches/1.3/mysql/patch/actions.sql
+++ b/upgrades/dbpatches/1.3/mysql/patch/actions.sql
@@ -1,17 +1,29 @@
CREATE TABLE actions_tmp (
- actionid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- subject varchar(255) DEFAULT '' NOT NULL,
- message blob DEFAULT '' NOT NULL,
- recipient integer DEFAULT '0' NOT NULL,
- source integer DEFAULT '0' NOT NULL,
- actiontype integer DEFAULT '0' NOT NULL,
- evaltype integer DEFAULT '0' NOT NULL,
- status integer DEFAULT '0' NOT NULL,
- scripts blob DEFAULT '' NOT NULL,
- PRIMARY KEY (actionid)
-) ENGINE=InnoDB ;
+ actionid bigint unsigned DEFAULT '0' NOT NULL,
+ eventsource integer DEFAULT '0' NOT NULL,
+ evaltype integer DEFAULT '0' NOT NULL,
+ status integer DEFAULT '0' NOT NULL,
+ PRIMARY KEY (actionid)
+) ENGINE=InnoDB;
+
+CREATE TABLE operations (
+ operationid bigint unsigned DEFAULT '0' NOT NULL,
+ actionid bigint unsigned DEFAULT '0' NOT NULL,
+ operationtype integer DEFAULT '0' NOT NULL,
+ object integer DEFAULT '0' NOT NULL,
+ objectid bigint unsigned DEFAULT '0' NOT NULL,
+ shortdata varchar(255) DEFAULT '' NOT NULL,
+ longdata blob DEFAULT '' NOT NULL,
+ scripts_tmp blob DEFAULT '' NOT NULL,
+ PRIMARY KEY (operationid)
+) ENGINE=InnoDB;
+CREATE INDEX operations_1 on operations (actionid);
+
+insert into actions_tmp select actionid,source,0,status from actions;
+
+insert into operations select actionid,actionid,actiontype,recipient,userid,subject,message,scripts from actions;
+update operations set longdata=scripts_tmp where operationtype=1;
+alter table operations drop scripts_tmp;
-insert into actions_tmp select actionid,userid,subject,message,recipient,source,actiontype,0,status,scripts from actions;
drop table actions;
alter table actions_tmp rename actions;
diff --git a/upgrades/dbpatches/1.3/mysql/patch/operations.sql b/upgrades/dbpatches/1.3/mysql/patch/operations.sql
new file mode 100644
index 00000000..85631027
--- /dev/null
+++ b/upgrades/dbpatches/1.3/mysql/patch/operations.sql
@@ -0,0 +1 @@
+-- See actions.sql
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/actions.sql b/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
index ecec38df..daefedc4 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
@@ -1,17 +1,29 @@
CREATE TABLE actions_tmp (
- actionid bigint DEFAULT '0' NOT NULL,
- userid bigint DEFAULT '0' NOT NULL,
- subject varchar(255) DEFAULT '' NOT NULL,
- message text DEFAULT '' NOT NULL,
- recipient integer DEFAULT '0' NOT NULL,
- source integer DEFAULT '0' NOT NULL,
- actiontype integer DEFAULT '0' NOT NULL,
- evaltype integer DEFAULT '0' NOT NULL,
- status integer DEFAULT '0' NOT NULL,
- scripts text DEFAULT '' NOT NULL,
- PRIMARY KEY (actionid)
+ actionid bigintd DEFAULT '0' NOT NULL,
+ eventsource integer DEFAULT '0' NOT NULL,
+ evaltype integer DEFAULT '0' NOT NULL,
+ status integer DEFAULT '0' NOT NULL,
+ PRIMARY KEY (actionid)
);
-insert into actions_tmp select actionid,userid,subject,message,recipient,source,actiontype,0,status,scripts from actions;
+CREATE TABLE operations (
+ operationid bigint DEFAULT '0' NOT NULL,
+ actionid bigint DEFAULT '0' NOT NULL,
+ operationtype integer DEFAULT '0' NOT NULL,
+ object integer DEFAULT '0' NOT NULL,
+ objectid bigint DEFAULT '0' NOT NULL,
+ shortdata varchar(255) DEFAULT '' NOT NULL,
+ longdata text DEFAULT '' NOT NULL,
+ scripts_tmp text DEFAULT '' NOT NULL,
+ PRIMARY KEY (operationid)
+);
+CREATE INDEX operations_1 on operations (actionid);
+
+insert into actions_tmp select actionid,source,0,status from actions;
+
+insert into operations select actionid,actionid,actiontype,recipient,userid,subject,message,scripts from actions;
+update operations set longdata=scripts_tmp where operationtype=1;
+alter table operations drop scripts_tmp;
+
drop table actions;
-alter table actions_tmp rename to actions;
+alter table actions_tmp rename actions;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/operations.sql b/upgrades/dbpatches/1.3/postgresql/patch/operations.sql
new file mode 100644
index 00000000..85631027
--- /dev/null
+++ b/upgrades/dbpatches/1.3/postgresql/patch/operations.sql
@@ -0,0 +1 @@
+-- See actions.sql