--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = zabbix, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = true;

--
-- Name: items; Type: TABLE; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE TABLE items (
    itemid bigint NOT NULL,
    type integer DEFAULT 0 NOT NULL,
    snmp_community character varying(64) DEFAULT ''::character varying NOT NULL,
    snmp_oid character varying(255) DEFAULT ''::character varying NOT NULL,
    hostid bigint NOT NULL,
    name character varying(255) DEFAULT ''::character varying NOT NULL,
    key_ character varying(255) DEFAULT ''::character varying NOT NULL,
    delay integer DEFAULT 0 NOT NULL,
    history integer DEFAULT 90 NOT NULL,
    trends integer DEFAULT 365 NOT NULL,
    lastvalue character varying(255),
    lastclock integer,
    prevvalue character varying(255),
    status integer DEFAULT 0 NOT NULL,
    value_type integer DEFAULT 0 NOT NULL,
    trapper_hosts character varying(255) DEFAULT ''::character varying NOT NULL,
    units character varying(255) DEFAULT ''::character varying NOT NULL,
    multiplier integer DEFAULT 0 NOT NULL,
    delta integer DEFAULT 0 NOT NULL,
    prevorgvalue character varying(255),
    snmpv3_securityname character varying(64) DEFAULT ''::character varying NOT NULL,
    snmpv3_securitylevel integer DEFAULT 0 NOT NULL,
    snmpv3_authpassphrase character varying(64) DEFAULT ''::character varying NOT NULL,
    snmpv3_privpassphrase character varying(64) DEFAULT ''::character varying NOT NULL,
    formula character varying(255) DEFAULT '1'::character varying NOT NULL,
    error character varying(128) DEFAULT ''::character varying NOT NULL,
    lastlogsize numeric(20,0) DEFAULT 0 NOT NULL,
    logtimefmt character varying(64) DEFAULT ''::character varying NOT NULL,
    templateid bigint,
    valuemapid bigint,
    delay_flex character varying(255) DEFAULT ''::character varying NOT NULL,
    params text DEFAULT ''::text NOT NULL,
    ipmi_sensor character varying(128) DEFAULT ''::character varying NOT NULL,
    data_type integer DEFAULT 0 NOT NULL,
    authtype integer DEFAULT 0 NOT NULL,
    username character varying(64) DEFAULT ''::character varying NOT NULL,
    password character varying(64) DEFAULT ''::character varying NOT NULL,
    publickey character varying(64) DEFAULT ''::character varying NOT NULL,
    privatekey character varying(64) DEFAULT ''::character varying NOT NULL,
    mtime integer DEFAULT 0 NOT NULL,
    lastns integer,
    flags integer DEFAULT 0 NOT NULL,
    filter character varying(255) DEFAULT ''::character varying NOT NULL,
    interfaceid bigint,
    port character varying(64) DEFAULT ''::character varying NOT NULL,
    description text DEFAULT ''::text NOT NULL,
    inventory_link integer DEFAULT 0 NOT NULL,
    lifetime character varying(64) DEFAULT '30'::character varying NOT NULL
)
WITH (fillfactor=50);


ALTER TABLE zabbix.items OWNER TO zabbix;

--
-- Name: items_pkey; Type: CONSTRAINT; Schema: zabbix; Owner: zabbix; Tablespace: 
--

ALTER TABLE ONLY items
    ADD CONSTRAINT items_pkey PRIMARY KEY (itemid);

ALTER TABLE items CLUSTER ON items_pkey;


--
-- Name: items_1; Type: INDEX; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE UNIQUE INDEX items_1 ON items USING btree (hostid, key_);


--
-- Name: items_3; Type: INDEX; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE INDEX items_3 ON items USING btree (status);


--
-- Name: items_4; Type: INDEX; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE INDEX items_4 ON items USING btree (templateid);


--
-- Name: items_5; Type: INDEX; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE INDEX items_5 ON items USING btree (valuemapid);


--
-- Name: items_key_; Type: INDEX; Schema: zabbix; Owner: zabbix; Tablespace: 
--

CREATE INDEX items_key_ ON items USING btree (key_);


--
-- Name: c_items_1; Type: FK CONSTRAINT; Schema: zabbix; Owner: zabbix
--

ALTER TABLE ONLY items
    ADD CONSTRAINT c_items_1 FOREIGN KEY (hostid) REFERENCES hosts(hostid) ON DELETE CASCADE;


--
-- Name: c_items_2; Type: FK CONSTRAINT; Schema: zabbix; Owner: zabbix
--

ALTER TABLE ONLY items
    ADD CONSTRAINT c_items_2 FOREIGN KEY (templateid) REFERENCES items(itemid) ON DELETE CASCADE;


--
-- Name: c_items_3; Type: FK CONSTRAINT; Schema: zabbix; Owner: zabbix
--

ALTER TABLE ONLY items
    ADD CONSTRAINT c_items_3 FOREIGN KEY (valuemapid) REFERENCES valuemaps(valuemapid);


--
-- Name: c_items_4; Type: FK CONSTRAINT; Schema: zabbix; Owner: zabbix
--

ALTER TABLE ONLY items
    ADD CONSTRAINT c_items_4 FOREIGN KEY (interfaceid) REFERENCES interface(interfaceid);


--
-- PostgreSQL database dump complete
--

