summaryrefslogtreecommitdiffstats
path: root/create/postgresql/schema.sql
diff options
context:
space:
mode:
authorjames_wells <james_wells@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-05 03:28:01 +0000
committerjames_wells <james_wells@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-05 03:28:01 +0000
commitb08a351860b379d09344887a4aa572be736be9b5 (patch)
tree9f45bfe67fc1f6c4845b10e5094c2ceb0703962f /create/postgresql/schema.sql
parentd98930885119abd5b9b21c1254d479857681acbb (diff)
downloadzabbix-b08a351860b379d09344887a4aa572be736be9b5.tar.gz
zabbix-b08a351860b379d09344887a4aa572be736be9b5.tar.xz
zabbix-b08a351860b379d09344887a4aa572be736be9b5.zip
Applied MySQL reconnect patch.
zabbix_tmp/src/libs/zbxdbhigh/db.c Applied Multiple Server Patch. zabbix/create/mysql/schema.sql zabbix/create/postgresql/schema.sql zabbix/frontends/php/include/config.inc.php zabbix/frontends/php/include/forms.inc.php zabbix/frontends/php/include/items.inc.php zabbix/frontends/php/include/locales/de_de.inc.php zabbix/frontends/php/include/locales/en_gb.inc.php zabbix/frontends/php/include/locales/fr_fr.inc.php zabbix/frontends/php/include/locales/it_it.inc.php zabbix/frontends/php/include/locales/lv_lv.inc.php zabbix/frontends/php/include/locales/ru_ru.inc.php zabbix/frontends/php/include/locales/sp_sp.inc.php zabbix/frontends/php/items.php zabbix/frontends/php/servers.php zabbix/include/common.h zabbix/misc/conf/zabbix_server.conf zabbix/src/zabbix_server/housekeeper/housekeeper.c zabbix/src/zabbix_server/housekeeper/housekeeper.h zabbix/src/zabbix_server/pinger/pinger.c zabbix/src/zabbix_server/pinger/pinger.h zabbix/src/zabbix_server/poller/poller.c zabbix/src/zabbix_server/poller/poller.h zabbix/src/zabbix_server/server.c zabbix/src/zabbix_server/timer/timer.c zabbix/src/zabbix_server/timer/timer.h zabbix/upgrades/dbpatches/1.1beta2_to_1.1beta3/mysql/patch.sql zabbix/upgrades/dbpatches/1.1beta2_to_1.1beta3/postgresql/patch.sql git-svn-id: svn://svn.zabbix.com/trunk@2277 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create/postgresql/schema.sql')
-rw-r--r--create/postgresql/schema.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index 1d6aafbe..4d4d915b 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -25,6 +25,7 @@
CREATE TABLE hosts (
hostid serial,
+ serverid int4 DEFAULT '1' NOT NULL,
host varchar(64) DEFAULT '' NOT NULL,
useip int4 DEFAULT '0' NOT NULL,
ip varchar(15) DEFAULT '127.0.0.1' NOT NULL,
@@ -35,10 +36,12 @@ CREATE TABLE hosts (
error varchar(128) DEFAULT '' NOT NULL,
available int4 DEFAULT '0' NOT NULL,
PRIMARY KEY (hostid)
+ FOREIGN KEY (serverid) REFERENCES servers
);
CREATE INDEX hosts_status on hosts (status);
CREATE UNIQUE INDEX hosts_host on hosts (host);
+CREATE INDEX hosts_server on hosts (serverid);
--
-- Table structure for table 'items'
@@ -51,6 +54,7 @@ CREATE TABLE items (
snmp_oid varchar(255) DEFAULT '' NOT NULL,
snmp_port int4 DEFAULT '161' NOT NULL,
hostid int4 NOT NULL,
+ serverid int4 DEFAULT '1' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
key_ varchar(64) DEFAULT '' NOT NULL,
delay int4 DEFAULT '0' NOT NULL,
@@ -79,12 +83,14 @@ CREATE TABLE items (
logtimefmt varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (itemid),
FOREIGN KEY (hostid) REFERENCES hosts
+ FOREIGN KEY (serverid) REFERENCES servers
);
CREATE UNIQUE INDEX items_hostid_key on items (hostid,key_);
--CREATE INDEX items_hostid on items (hostid);
CREATE INDEX items_nextcheck on items (nextcheck);
CREATE INDEX items_status on items (status);
+CREATE INDEX items_server on items (serverid);
--
-- Table structure for table 'config'
@@ -727,4 +733,17 @@ CREATE TABLE autoreg (
PRIMARY KEY (id)
);
+--
+-- Table structure for table 'servers'
+--
+
+CREATE TABLE servers (
+ serverid serial
+ host varchar(64) DEFAULT '' NOT NULL,
+ ip varchar(15) DEFAULT '127.0.0.1' NOT NULL,
+ port int4 DEFAULT '0' NOT NULL,
+ PRIMARY KEY (serverid),
+ PRIMARY KEY (serverid)
+);
+
VACUUM ANALYZE;