summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--create/mysql/schema.sql4
-rw-r--r--create/postgresql/schema.sql7
-rw-r--r--frontends/php/hosts.php4
-rw-r--r--upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql4
-rw-r--r--upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql9
5 files changed, 23 insertions, 5 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;
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index c1a3d4cb..0bb9a9d1 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -297,6 +297,10 @@
}
table_end();
}
+ if($_GET["config"]==2)
+ {
+ insert_template_form($_GET["groupid"]);
+ }
?>
<?php
diff --git a/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql
index 5faca5aa..8ab51cc6 100644
--- a/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql
+++ b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/mysql/patch.sql
@@ -10,6 +10,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,
@@ -17,5 +18,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/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql
index fc18d1f7..e063f0c8 100644
--- a/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql
+++ b/upgrades/dbpatches/1.1alpha4_to_1.1alpha5/postgresql/patch.sql
@@ -6,7 +6,12 @@ CREATE TABLE escalations (
CREATE UNIQUE INDEX escalations_name on escalations (name);
+--
+-- Table structure for table 'hosts_templates'
+--
+
CREATE TABLE hosts_templates (
+ hosttemplateid serial,
hostid int4 DEFAULT '0' NOT NULL,
templateid int4 DEFAULT '0' NOT NULL,
items int2 DEFAULT '0' NOT NULL,
@@ -14,5 +19,7 @@ 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);