From b8edeec169a068a810f812b4d77ab0c64146238d Mon Sep 17 00:00:00 2001 From: hugetoad Date: Tue, 4 Jan 2005 10:43:38 +0000 Subject: Minor changes. git-svn-id: svn://svn.zabbix.com/trunk@1579 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- create/mysql/schema.sql | 4 +++- create/postgresql/schema.sql | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'create') 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; -- cgit