-- Table: public.items

-- DROP TABLE public.items;

CREATE TABLE public.items
(
    itemid bigint NOT NULL,
    type integer NOT NULL DEFAULT 0,
    snmp_community character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    snmp_oid character varying(512) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    hostid bigint NOT NULL,
    name character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    key_ character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    delay character varying(1024) COLLATE pg_catalog."default" NOT NULL DEFAULT '0'::character varying,
    history character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT '90d'::character varying,
    trends character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT '365d'::character varying,
    status integer NOT NULL DEFAULT 0,
    value_type integer NOT NULL DEFAULT 0,
    trapper_hosts character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    units character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    snmpv3_securityname character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    snmpv3_securitylevel integer NOT NULL DEFAULT 0,
    snmpv3_authpassphrase character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    snmpv3_privpassphrase character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    formula character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    error character varying(2048) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    lastlogsize numeric(20,0) NOT NULL DEFAULT '0'::numeric,
    logtimefmt character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    templateid bigint,
    valuemapid bigint,
    params text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text,
    ipmi_sensor character varying(128) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    authtype integer NOT NULL DEFAULT 0,
    username character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    password character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    publickey character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    privatekey character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    mtime integer NOT NULL DEFAULT 0,
    flags integer NOT NULL DEFAULT 0,
    interfaceid bigint,
    port character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    description text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text,
    inventory_link integer NOT NULL DEFAULT 0,
    lifetime character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT '30d'::character varying,
    snmpv3_authprotocol integer NOT NULL DEFAULT 0,
    snmpv3_privprotocol integer NOT NULL DEFAULT 0,
    state integer NOT NULL DEFAULT 0,
    snmpv3_contextname character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    evaltype integer NOT NULL DEFAULT 0,
    jmx_endpoint character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    master_itemid bigint,
    timeout character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT '3s'::character varying,
    url character varying(2048) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    query_fields character varying(2048) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    posts text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text,
    status_codes character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT '200'::character varying,
    follow_redirects integer NOT NULL DEFAULT 1,
    post_type integer NOT NULL DEFAULT 0,
    http_proxy character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    headers text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text,
    retrieve_mode integer NOT NULL DEFAULT 0,
    request_method integer NOT NULL DEFAULT 0,
    output_format integer NOT NULL DEFAULT 0,
    ssl_cert_file character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    ssl_key_file character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    ssl_key_password character varying(64) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    verify_peer integer NOT NULL DEFAULT 0,
    verify_host integer NOT NULL DEFAULT 0,
    allow_traps integer NOT NULL DEFAULT 0
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.items
    OWNER to zabbix;

-- Index: items_3

-- DROP INDEX public.items_3;

CREATE INDEX items_3
    ON public.items USING btree
    (status)
    TABLESPACE pg_default;

-- Index: items_4

-- DROP INDEX public.items_4;

CREATE INDEX items_4
    ON public.items USING btree
    (templateid)
    TABLESPACE pg_default;

-- Index: items_5

-- DROP INDEX public.items_5;

CREATE INDEX items_5
    ON public.items USING btree
    (valuemapid)
    TABLESPACE pg_default;

-- Index: items_6

-- DROP INDEX public.items_6;

CREATE INDEX items_6
    ON public.items USING btree
    (interfaceid)
    TABLESPACE pg_default;

-- Index: items_7

-- DROP INDEX public.items_7;

CREATE INDEX items_7
    ON public.items USING btree
    (master_itemid)
    TABLESPACE pg_default;