summaryrefslogtreecommitdiffstats
path: root/create/postgresql/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'create/postgresql/schema.sql')
-rw-r--r--create/postgresql/schema.sql25
1 files changed, 20 insertions, 5 deletions
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'