From 12fb9a31a75ce2ba7a3c14fcc90eaf4344a7b437 Mon Sep 17 00:00:00 2001
From: hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>
Date: Fri, 8 Nov 2002 15:08:37 +0000
Subject: Fixes for PostgreSQL (Alexei)

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

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

diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index 1822fa9f..38aa4e97 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -66,11 +66,26 @@ CREATE TABLE config (
 -- Table structure for table 'groups'
 --
 
---CREATE TABLE groups (
---  groupid		serial,
---  name			varchar(64)	DEFAULT '' NOT NULL,
---  PRIMARY KEY (groupid)
---);
+CREATE TABLE groups (
+  groupid		serial,
+  name			varchar(64)     DEFAULT '' NOT NULL,
+  PRIMARY KEY (groupid),
+  UNIQUE (name)
+);
+
+CREATE UNIQUE INDEX groups_name on groups (name);
+
+--
+-- Table structure for table 'hosts_groups'
+--
+
+CREATE TABLE hosts_groups (
+  hostid		int4		DEFAULT '0' NOT NULL,
+  groupid		int4		DEFAULT '0' NOT NULL,
+  PRIMARY KEY (hostid,groupid)
+);
+
+--CREATE UNIQUE INDEX hosts_groups_name on hosts_groups (hostid,groupid);
 
 --
 -- Table structure for table 'triggers'
-- 
cgit 

