From 7a92bd8598c91aa3be9d716fad35a6574b9e06ce Mon Sep 17 00:00:00 2001
From: hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>
Date: Sun, 25 May 2003 16:15:30 +0000
Subject:  - added src/zabbix_sucker/alerter.h (Alexei)  - added
 src/zabbix_sucker/alerter.c (Alexei)  - removed column alerts.type, added
 column alerts.mediatypeid (Alexei)

git-svn-id: svn://svn.zabbix.com/trunk@779 97f52cf1-0a1b-0410-bd0e-c28be96e8082
---
 create/postgresql/schema.sql | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

(limited to 'create/postgresql/schema.sql')

diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index 5ad70042..fa95780d 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -75,9 +75,9 @@ CREATE INDEX items_status on items (status);
 --
 
 CREATE TABLE config (
-  smtp_server		varchar(255)	DEFAULT '' NOT NULL,
-  smtp_helo		varchar(255)	DEFAULT '' NOT NULL,
-  smtp_email		varchar(255)	DEFAULT '' NOT NULL,
+--  smtp_server		varchar(255)	DEFAULT '' NOT NULL,
+--  smtp_helo		varchar(255)	DEFAULT '' NOT NULL,
+--  smtp_email		varchar(255)	DEFAULT '' NOT NULL,
 --  password_required	int4		DEFAULT '0' NOT NULL,
   alert_history		int4		DEFAULT '0' NOT NULL,
   alarm_history		int4		DEFAULT '0' NOT NULL
@@ -176,6 +176,22 @@ CREATE TABLE actions (
   FOREIGN KEY (userid) REFERENCES users
 );
 
+--
+-- Table structure for table 'media_type'
+--
+
+CREATE TABLE media_type (
+  mediatypeid		serial,
+  type			int4		DEFAULT '0' NOT NULL,
+  description		varchar(100)	DEFAULT '' NOT NULL,
+  smtp_server		varchar(255)	DEFAULT '' NOT NULL,
+  smtp_helo		varchar(255)	DEFAULT '' NOT NULL,
+  smtp_email		varchar(255)	DEFAULT '' NOT NULL,
+  exec_path		varchar(255)	DEFAULT '' NOT NULL,
+  PRIMARY KEY(mediatypeid)
+);
+
+
 --
 -- Table structure for table 'alerts'
 --
@@ -186,12 +202,14 @@ CREATE TABLE alerts (
   clock			int4		DEFAULT '0' NOT NULL,
   status		int4		DEFAULT '0' NOT NULL,
   retries		int4		DEFAULT '0' NOT NULL,
-  type			varchar(10)	DEFAULT '' NOT NULL,
+--  type		varchar(10)	DEFAULT '' NOT NULL,
+  mediatypeid		int4		DEFAULT '0' NOT NULL,
   sendto		varchar(100)	DEFAULT '' NOT NULL,
   subject		varchar(255)	DEFAULT '' NOT NULL,
   message		text		DEFAULT '' NOT NULL,
   PRIMARY KEY (alertid),
-  FOREIGN KEY (actionid) REFERENCES actions
+  FOREIGN KEY (actionid) REFERENCES actions,
+  FOREIGN KEY (mediatypeid) REFERENCES media_type
 );
 
 CREATE INDEX alerts_actionid on alerts (actionid);
@@ -293,11 +311,13 @@ CREATE TABLE triggers_template (
 CREATE TABLE media (
   mediaid		serial,
   userid		int4		DEFAULT '0' NOT NULL,
-  type			varchar(10)	DEFAULT '' NOT NULL,
+--  type		varchar(10)	DEFAULT '' NOT NULL,
+  mediatypeid		int4		DEFAULT '0' NOT NULL,
   sendto		varchar(100)	DEFAULT '' NOT NULL,
   active		int4		DEFAULT '0' NOT NULL,
   PRIMARY KEY (mediaid),
-  FOREIGN KEY (userid) REFERENCES users
+  FOREIGN KEY (userid) REFERENCES users,
+  FOREIGN KEY (mediatypeid) REFERENCES media_type,
 );
 
 --
-- 
cgit 

