summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-04 10:43:38 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-04 10:43:38 +0000
commitb8edeec169a068a810f812b4d77ab0c64146238d (patch)
tree54a863d61b423b471ad1996d12fc8ecc7c83ed4d /create
parentbd443d5587cb568520c8ca2ea0e98ac0c7e5ac29 (diff)
downloadzabbix-b8edeec169a068a810f812b4d77ab0c64146238d.tar.gz
zabbix-b8edeec169a068a810f812b4d77ab0c64146238d.tar.xz
zabbix-b8edeec169a068a810f812b4d77ab0c64146238d.zip
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1579 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create')
-rw-r--r--create/mysql/schema.sql4
-rw-r--r--create/postgresql/schema.sql7
2 files changed, 8 insertions, 3 deletions
diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql
index 8feeb2b7..db0c7712 100644
--- a/create/mysql/schema.sql
+++ b/create/mysql/schema.sql
@@ -623,6 +623,7 @@ CREATE TABLE escalations (
--
CREATE TABLE hosts_templates (
+ hosttemplateid int(4) NOT NULL auto_increment,
hostid int(4) DEFAULT '0' NOT NULL,
templateid int(4) DEFAULT '0' NOT NULL,
items int(1) DEFAULT '0' NOT NULL,
@@ -630,5 +631,6 @@ CREATE TABLE hosts_templates (
actions int(1) DEFAULT '0' NOT NULL,
graphs int(1) DEFAULT '0' NOT NULL,
screens int(1) DEFAULT '0' NOT NULL,
- PRIMARY KEY (hostid, templateid)
+ PRIMARY KEY (hosttemplateid),
+ UNIQUE (hostid, templateid)
) type=InnoDB;
diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index a406da91..3fb3dcf0 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -617,7 +617,7 @@ CREATE TABLE trends (
--
CREATE TABLE escalations (
- escalationid serial DEFAULT '0' NOT NULL,
+ escalationid serial,
name varchar(64) DEFAULT '0' NOT NULL,
PRIMARY KEY (escalationid)
);
@@ -629,6 +629,7 @@ CREATE UNIQUE INDEX escalations_name on escalations (name);
--
CREATE TABLE hosts_templates (
+ hosttemplateid serial,
hostid int4 DEFAULT '0' NOT NULL,
templateid int4 DEFAULT '0' NOT NULL,
items int2 DEFAULT '0' NOT NULL,
@@ -636,7 +637,9 @@ CREATE TABLE hosts_templates (
actions int2 DEFAULT '0' NOT NULL,
graphs int2 DEFAULT '0' NOT NULL,
screens int2 DEFAULT '0' NOT NULL,
- PRIMARY KEY (hostid, templateid)
+ PRIMARY KEY (hosttemplateid)
);
+CREATE UNIQUE INDEX hosts_templates_hostid_templateid on hosts_templates (hostid, templateid);
+
VACUUM ANALYZE;