-- Name: TABLE pkghead; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE pkghead IS 'Information about non-core Packages added to the database';


--
-- TOC entry 10053 (class 0 OID 0)
-- Dependencies: 713
-- Name: COLUMN pkghead.pkghead_indev; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN pkghead.pkghead_indev IS 'Flag indicating whether the contents of this package may be modified in-place - this package is /in dev/elopment.';


--
-- TOC entry 714 (class 1259 OID 146569590)
-- Dependencies: 713 8
-- Name: pkghead_pkghead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE pkghead_pkghead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pkghead_pkghead_id_seq OWNER TO admin;

--
-- TOC entry 10055 (class 0 OID 0)
-- Dependencies: 714
-- Name: pkghead_pkghead_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE pkghead_pkghead_id_seq OWNED BY pkghead.pkghead_id;


--
-- TOC entry 715 (class 1259 OID 146569592)
-- Dependencies: 6606 8
-- Name: pkgitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE pkgitem (
    pkgitem_id integer NOT NULL,
    pkgitem_pkghead_id integer,
    pkgitem_type text,
    pkgitem_item_id integer NOT NULL,
    pkgitem_name text NOT NULL,
    pkgitem_descrip text,
    CONSTRAINT pkgitem_pkgitem_type_check CHECK (((((((((((((pkgitem_type = 'C'::text) OR (pkgitem_type = 'D'::text)) OR (pkgitem_type = 'F'::text)) OR (pkgitem_type = 'G'::text)) OR (pkgitem_type = 'I'::text)) OR (pkgitem_type = 'M'::text)) OR (pkgitem_type = 'P'::text)) OR (pkgitem_type = 'R'::text)) OR (pkgitem_type = 'S'::text)) OR (pkgitem_type = 'T'::text)) OR (pkgitem_type = 'U'::text)) OR (pkgitem_type = 'V'::text)))
);


ALTER TABLE public.pkgitem OWNER TO admin;

--
-- TOC entry 10057 (class 0 OID 0)
-- Dependencies: 715
-- Name: TABLE pkgitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE pkgitem IS 'Deprecated - the pkgitem table is no longer used to track package contents. It has been replaced by direct queries to the database schema and component tables. This table will be removed when all users have switched to Updater 2.2.0 or later.';


--
-- TOC entry 716 (class 1259 OID 146569599)
-- Dependencies: 715 8
-- Name: pkgitem_pkgitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE pkgitem_pkgitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pkgitem_pkgitem_id_seq OWNER TO admin;

--
-- TOC entry 10059 (class 0 OID 0)
-- Dependencies: 716
-- Name: pkgitem_pkgitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE pkgitem_pkgitem_id_seq OWNED BY pkgitem.pkgitem_id;


--
-- TOC entry 717 (class 1259 OID 146569601)
-- Dependencies: 8
-- Name: plancode_plancode_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE plancode_plancode_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.plancode_plancode_id_seq OWNER TO admin;

--
-- TOC entry 718 (class 1259 OID 146569603)
-- Dependencies: 8
-- Name: planord_planord_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE planord_planord_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.planord_planord_id_seq OWNER TO admin;

--
-- TOC entry 719 (class 1259 OID 146569605)
-- Dependencies: 8
-- Name: pohead_pohead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE pohead_pohead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.pohead_pohead_id_seq OWNER TO admin;

--
-- TOC entry 720 (class 1259 OID 146569607)
-- Dependencies: 8
-- Name: poitem_poitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE poitem_poitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.poitem_poitem_id_seq OWNER TO admin;

--
-- TOC entry 721 (class 1259 OID 146569609)
-- Dependencies: 6607 6608 6609 6611 8
-- Name: recv; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE recv (
    recv_id integer NOT NULL,
    recv_order_type text NOT NULL,
    recv_order_number text NOT NULL,
    recv_orderitem_id integer NOT NULL,
    recv_agent_username text,
    recv_itemsite_id integer,
    recv_vend_id integer,
    recv_vend_item_number text,
    recv_vend_item_descrip text,
    recv_vend_uom text,
    recv_purchcost numeric(16,6),
    recv_purchcost_curr_id integer,
    recv_duedate date,
    recv_qty numeric(18,6),
    recv_recvcost numeric(16,6),
    recv_recvcost_curr_id integer,
    recv_freight numeric(16,4),
    recv_freight_curr_id integer,
    recv_date timestamp with time zone,
    recv_value numeric(18,6),
    recv_posted boolean DEFAULT false NOT NULL,
    recv_invoiced boolean DEFAULT false NOT NULL,
    recv_vohead_id integer,
    recv_voitem_id integer,
    recv_trans_usr_name text DEFAULT geteffectivextuser() NOT NULL,
    recv_notes text,
    recv_gldistdate date,
    recv_splitfrom_id integer,
    recv_rlsd_duedate date,
    CONSTRAINT recv_recv_order_type_check CHECK ((((recv_order_type = 'PO'::text) OR (recv_order_type = 'RA'::text)) OR (recv_order_type = 'TO'::text)))
);


ALTER TABLE public.recv OWNER TO admin;

--
-- TOC entry 10065 (class 0 OID 0)
-- Dependencies: 721
-- Name: TABLE recv; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE recv IS 'Information about Received Orders.';


--
-- TOC entry 722 (class 1259 OID 146569619)
-- Dependencies: 8586 8
-- Name: porecv; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW porecv AS
    SELECT recv.recv_id AS porecv_id, recv.recv_date AS porecv_date, recv.recv_rlsd_duedate AS porecv_rlsd_duedate, pohead.pohead_orderdate AS porecv_orderdate, pohead.pohead_released AS porecv_released, recv.recv_order_number AS porecv_ponumber, recv.recv_itemsite_id AS porecv_itemsite_id, recv.recv_vend_id AS porecv_vend_id, item.item_number AS porecv_item_number, recv.recv_vend_item_number AS porecv_vend_item_number, COALESCE(item.item_descrip1, recv.recv_vend_item_descrip) AS porecv_vend_item_descrip, recv.recv_vend_uom AS porecv_vend_uom, recv.recv_qty AS porecv_qty, recv.recv_posted AS porecv_posted, recv.recv_invoiced AS porecv_invoiced, (pg_user.usesysid)::integer AS porecv_trans_usr_id, recv.recv_orderitem_id AS porecv_poitem_id, NULL::integer AS porecv_linenumber, recv.recv_purchcost AS porecv_purchcost, recv.recv_vohead_id AS porecv_vohead_id, recv.recv_recvcost AS porecv_recvcost, recv.recv_duedate AS porecv_duedate, recv.recv_agent_username AS porecv_agent_username, recv.recv_notes AS porecv_notes, recv.recv_freight AS porecv_freight, recv.recv_freight_curr_id AS porecv_curr_id, recv.recv_gldistdate AS porecv_gldistdate, recv.recv_voitem_id AS porecv_voitem_id, recv.recv_value AS porecv_value FROM ((((recv LEFT JOIN pg_user ON ((recv.recv_trans_usr_name = (pg_user.usename)::text))) LEFT JOIN pohead ON ((recv.recv_order_number = pohead.pohead_number))) LEFT JOIN itemsite ON ((recv.recv_itemsite_id = itemsite.itemsite_id))) LEFT JOIN item ON ((itemsite.itemsite_item_id = item.item_id))) WHERE (recv.recv_order_type = 'PO'::text);


ALTER TABLE public.porecv OWNER TO admin;

--
-- TOC entry 723 (class 1259 OID 146569624)
-- Dependencies: 8
-- Name: porecv_porecv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE porecv_porecv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.porecv_porecv_id_seq OWNER TO admin;

--
-- TOC entry 724 (class 1259 OID 146569626)
-- Dependencies: 6612 8
-- Name: poreject; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE poreject (
    poreject_id integer DEFAULT nextval(('"poreject_poreject_id_seq"'::text)::regclass) NOT NULL,
    poreject_date timestamp with time zone,
    poreject_ponumber text,
    poreject_itemsite_id integer,
    poreject_vend_id integer,
    poreject_vend_item_number text,
    poreject_vend_item_descrip text,
    poreject_vend_uom text,
    poreject_qty numeric(18,6),
    poreject_posted boolean,
    poreject_rjctcode_id integer,
    poreject_poitem_id integer,
    poreject_invoiced boolean,
    poreject_vohead_id integer,
    poreject_agent_username text,
    poreject_voitem_id integer,
    poreject_value numeric(18,6),
    poreject_trans_username text,
    poreject_recv_id integer
);


ALTER TABLE public.poreject OWNER TO admin;

--
-- TOC entry 10069 (class 0 OID 0)
-- Dependencies: 724
-- Name: TABLE poreject; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE poreject IS 'The poreject table describes Purchase Order Items that were returned to Vendors.';


--
-- TOC entry 10070 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_id IS 'This is the internal id of this poreject record';


--
-- TOC entry 10071 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_date IS 'This is the date and time the return was entered into the database';


--
-- TOC entry 10072 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_ponumber; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_ponumber IS 'This is the number of the original Purchase Order of this item';


--
-- TOC entry 10073 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_itemsite_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_itemsite_id IS 'This is the Item Site into which the item had been received';


--
-- TOC entry 10074 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_vend_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_vend_id IS 'This is the Vendor from which the item had been purchased';


--
-- TOC entry 10075 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_vend_item_number; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_vend_item_number IS 'This is the Vendor''s item number for this item';


--
-- TOC entry 10076 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_vend_item_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_vend_item_descrip IS 'This is the Vendor''s description of this item';


--
-- TOC entry 10077 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_vend_uom; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_vend_uom IS 'This is the Unit of Measure in which the Vendor sold this item';


--
-- TOC entry 10078 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_qty; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_qty IS 'This is the quantity of the item that was returned';


--
-- TOC entry 10079 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_posted; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_posted IS 'This indicates whether or not the return has been recorded in the General Ledger, Inventory History, and Purchase Order Item';


--
-- TOC entry 10080 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_rjctcode_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_rjctcode_id IS 'This indicates the reason for the return';


--
-- TOC entry 10081 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_poitem_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_poitem_id IS 'This is the internal id of the original Purchase Order Item';


--
-- TOC entry 10082 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_invoiced; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_invoiced IS 'This indicates whether the Credit Memo associated with the return has been posted';


--
-- TOC entry 10083 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_vohead_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_vohead_id IS 'This is the Voucher associated with the Purchase Order Item';


--
-- TOC entry 10084 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_agent_username; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_agent_username IS 'This is the Purchase Order Agent responsible for the original Purchase Order';


--
-- TOC entry 10085 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_voitem_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_voitem_id IS 'This is the Voucher Item associated with the Purchase Order Item';


--
-- TOC entry 10086 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_value; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_value IS 'This is the value (in base currency) of the return at the time it was posted to the General Ledger';


--
-- TOC entry 10087 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN poreject.poreject_trans_username; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN poreject.poreject_trans_username IS 'This is the user who recorded the return';


--
-- TOC entry 725 (class 1259 OID 146569633)
-- Dependencies: 8
-- Name: poreject_poreject_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE poreject_poreject_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.poreject_poreject_id_seq OWNER TO admin;

--
-- TOC entry 726 (class 1259 OID 146569635)
-- Dependencies: 8
-- Name: potype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE potype (
    potype_id integer NOT NULL,
    potype_name text,
    potype_descrip text
);


ALTER TABLE public.potype OWNER TO admin;

--
-- TOC entry 10090 (class 0 OID 0)
-- Dependencies: 726
-- Name: TABLE potype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE potype IS 'Purchase Order Type information';


--
-- TOC entry 727 (class 1259 OID 146569641)
-- Dependencies: 726 8
-- Name: potype_potype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE potype_potype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.potype_potype_id_seq OWNER TO admin;

--
-- TOC entry 10092 (class 0 OID 0)
-- Dependencies: 727
-- Name: potype_potype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE potype_potype_id_seq OWNED BY potype.potype_id;


--
-- TOC entry 728 (class 1259 OID 146569643)
-- Dependencies: 6614 6615 8
-- Name: pr; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE pr (
    pr_id integer DEFAULT nextval(('"pr_pr_id_seq"'::text)::regclass) NOT NULL,
    pr_number integer,
    pr_subnumber integer,
    pr_status character(1),
    pr_order_type character(1),
    pr_order_id integer,
    pr_poitem_id integer,
    pr_duedate date,
    pr_itemsite_id integer,
    pr_qtyreq numeric(18,6),
    pr_prj_id integer,
    pr_releasenote text,
    pr_createdate timestamp without time zone DEFAULT now()
);


ALTER TABLE public.pr OWNER TO admin;

--
-- TOC entry 10094 (class 0 OID 0)
-- Dependencies: 728
-- Name: TABLE pr; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE pr IS 'Purchase Request information';


--
-- TOC entry 729 (class 1259 OID 146569651)
-- Dependencies: 8
-- Name: pr_pr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE pr_pr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pr_pr_id_seq OWNER TO admin;

--
-- TOC entry 730 (class 1259 OID 146569653)
-- Dependencies: 6617 8
-- Name: prftcntr; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE prftcntr (
    prftcntr_id integer NOT NULL,
    prftcntr_number text NOT NULL,
    prftcntr_descrip text,
    CONSTRAINT prftcntr_prftcntr_number_check CHECK ((prftcntr_number <> ''::text))
);


ALTER TABLE public.prftcntr OWNER TO admin;

--
-- TOC entry 10097 (class 0 OID 0)
-- Dependencies: 730
-- Name: TABLE prftcntr; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE prftcntr IS 'Profit Center information';


--
-- TOC entry 731 (class 1259 OID 146569660)
-- Dependencies: 730 8
-- Name: prftcntr_prftcntr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prftcntr_prftcntr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prftcntr_prftcntr_id_seq OWNER TO admin;

--
-- TOC entry 10099 (class 0 OID 0)
-- Dependencies: 731
-- Name: prftcntr_prftcntr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE prftcntr_prftcntr_id_seq OWNED BY prftcntr.prftcntr_id;


--
-- TOC entry 732 (class 1259 OID 146569662)
-- Dependencies: 8
-- Name: usrgrp; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usrgrp (
    usrgrp_id integer NOT NULL,
    usrgrp_grp_id integer NOT NULL,
    usrgrp_username text NOT NULL
);


ALTER TABLE public.usrgrp OWNER TO admin;

--
-- TOC entry 10101 (class 0 OID 0)
-- Dependencies: 732
-- Name: TABLE usrgrp; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usrgrp IS 'This is which group a user belongs to.';


--
-- TOC entry 733 (class 1259 OID 146569668)
-- Dependencies: 6619 8
-- Name: usrpriv; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usrpriv (
    usrpriv_id integer DEFAULT nextval(('usrpriv_usrpriv_id_seq'::text)::regclass) NOT NULL,
    usrpriv_priv_id integer,
    usrpriv_username text
);


ALTER TABLE public.usrpriv OWNER TO admin;

--
-- TOC entry 10103 (class 0 OID 0)
-- Dependencies: 733
-- Name: TABLE usrpriv; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usrpriv IS 'User Privileges information';


--
-- TOC entry 734 (class 1259 OID 146569675)
-- Dependencies: 8587 8
-- Name: privgranted; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW privgranted AS
    SELECT priv.priv_name AS privilege, (COALESCE(usrpriv.usrpriv_priv_id, grppriv.grppriv_priv_id, (-1)) > 0) AS granted, priv.priv_seq AS sequence FROM ((priv LEFT JOIN usrpriv ON (((priv.priv_id = usrpriv.usrpriv_priv_id) AND (usrpriv.usrpriv_username = geteffectivextuser())))) LEFT JOIN (SELECT DISTINCT grppriv.grppriv_priv_id FROM (grppriv JOIN usrgrp ON (((grppriv.grppriv_grp_id = usrgrp.usrgrp_grp_id) AND (usrgrp.usrgrp_username = geteffectivextuser()))))) grppriv ON ((grppriv.grppriv_priv_id = priv.priv_id)));


ALTER TABLE public.privgranted OWNER TO admin;

--
-- TOC entry 735 (class 1259 OID 146569680)
-- Dependencies: 225 8
-- Name: prj_prj_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prj_prj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prj_prj_id_seq OWNER TO admin;

--
-- TOC entry 10106 (class 0 OID 0)
-- Dependencies: 735
-- Name: prj_prj_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE prj_prj_id_seq OWNED BY prj.prj_id;


--
-- TOC entry 736 (class 1259 OID 146569682)
-- Dependencies: 232 8
-- Name: prjtask_prjtask_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prjtask_prjtask_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prjtask_prjtask_id_seq OWNER TO admin;

--
-- TOC entry 10108 (class 0 OID 0)
-- Dependencies: 736
-- Name: prjtask_prjtask_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE prjtask_prjtask_id_seq OWNED BY prjtask.prjtask_id;


--
-- TOC entry 737 (class 1259 OID 146569684)
-- Dependencies: 8
-- Name: prjtaskuser; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE prjtaskuser (
    prjtaskuser_id integer NOT NULL,
    prjtaskuser_prjtask_id integer,
    prjtaskuser_username text
);


ALTER TABLE public.prjtaskuser OWNER TO admin;

--
-- TOC entry 10110 (class 0 OID 0)
-- Dependencies: 737
-- Name: TABLE prjtaskuser; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE prjtaskuser IS 'Project Task user information';


--
-- TOC entry 738 (class 1259 OID 146569690)
-- Dependencies: 737 8
-- Name: prjtaskuser_prjtaskuser_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prjtaskuser_prjtaskuser_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prjtaskuser_prjtaskuser_id_seq OWNER TO admin;

--
-- TOC entry 10112 (class 0 OID 0)
-- Dependencies: 738
-- Name: prjtaskuser_prjtaskuser_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE prjtaskuser_prjtaskuser_id_seq OWNED BY prjtaskuser.prjtaskuser_id;


--
-- TOC entry 739 (class 1259 OID 146569692)
-- Dependencies: 6622 8
-- Name: prjtype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE prjtype (
    prjtype_id integer NOT NULL,
    prjtype_code text,
    prjtype_descr text,
    prjtype_active boolean DEFAULT true
);


ALTER TABLE public.prjtype OWNER TO admin;

--
-- TOC entry 740 (class 1259 OID 146569699)
-- Dependencies: 739 8
-- Name: prjtype_prjtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prjtype_prjtype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prjtype_prjtype_id_seq OWNER TO admin;

--
-- TOC entry 10115 (class 0 OID 0)
-- Dependencies: 740
-- Name: prjtype_prjtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE prjtype_prjtype_id_seq OWNED BY prjtype.prjtype_id;


--
-- TOC entry 741 (class 1259 OID 146569701)
-- Dependencies: 8
-- Name: prodcat_prodcat_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE prodcat_prodcat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.prodcat_prodcat_id_seq OWNER TO admin;

--
-- TOC entry 742 (class 1259 OID 146569703)
-- Dependencies: 6624 6625 6626 8
-- Name: qryhead; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE qryhead (
    qryhead_id integer NOT NULL,
    qryhead_name text NOT NULL,
    qryhead_descrip text,
    qryhead_notes text,
    qryhead_username text DEFAULT geteffectivextuser() NOT NULL,
    qryhead_updated date DEFAULT ('now'::text)::date NOT NULL,
    CONSTRAINT qryhead_qryhead_name_check CHECK ((qryhead_name <> ''::text))
);


ALTER TABLE public.qryhead OWNER TO admin;

--
-- TOC entry 10117 (class 0 OID 0)
-- Dependencies: 742
-- Name: TABLE qryhead; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE qryhead IS 'A header record for a set of queries to be run sequentially. One use is for data export.';


--
-- TOC entry 10118 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_id IS 'The primary key, holding an internal value used to cross-reference this table.';


--
-- TOC entry 10119 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_name IS 'The user-assigned short name for this set of queries.';


--
-- TOC entry 10120 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_descrip IS 'A long description of the purpose of this set of queries.';


--
-- TOC entry 10121 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_notes; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_notes IS 'General information about this queryset.';


--
-- TOC entry 10122 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_username; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_username IS 'The name of the user who last modified this qryhead record.';


--
-- TOC entry 10123 (class 0 OID 0)
-- Dependencies: 742
-- Name: COLUMN qryhead.qryhead_updated; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryhead.qryhead_updated IS 'The date this qryhead was last modified.';


--
-- TOC entry 743 (class 1259 OID 146569712)
-- Dependencies: 742 8
-- Name: qryhead_qryhead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE qryhead_qryhead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.qryhead_qryhead_id_seq OWNER TO admin;

--
-- TOC entry 10125 (class 0 OID 0)
-- Dependencies: 743
-- Name: qryhead_qryhead_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE qryhead_qryhead_id_seq OWNED BY qryhead.qryhead_id;


--
-- TOC entry 744 (class 1259 OID 146569714)
-- Dependencies: 6627 6628 6629 6631 6632 8
-- Name: qryitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE qryitem (
    qryitem_id integer NOT NULL,
    qryitem_qryhead_id integer NOT NULL,
    qryitem_name text NOT NULL,
    qryitem_order integer NOT NULL,
    qryitem_src text NOT NULL,
    qryitem_group text,
    qryitem_detail text NOT NULL,
    qryitem_notes text DEFAULT ''::text NOT NULL,
    qryitem_username text DEFAULT geteffectivextuser() NOT NULL,
    qryitem_updated date DEFAULT ('now'::text)::date NOT NULL,
    CONSTRAINT qryitem_qryitem_detail_check CHECK ((btrim(qryitem_detail) <> ''::text)),
    CONSTRAINT qryitem_qryitem_src_check CHECK ((qryitem_src = ANY (ARRAY['REL'::text, 'MQL'::text, 'CUSTOM'::text])))
);


ALTER TABLE public.qryitem OWNER TO admin;

--
-- TOC entry 10127 (class 0 OID 0)
-- Dependencies: 744
-- Name: TABLE qryitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE qryitem IS 'The description of a query to be run as part of a set (see qryhead).';


--
-- TOC entry 10128 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_id IS 'The primary key, holding an internal value used to cross-reference this table.';


--
-- TOC entry 10129 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_qryhead_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_qryhead_id IS 'The primary key of the query set to which this individual query belongs.';


--
-- TOC entry 10130 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_order; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_order IS 'The order in which query items within a query set should be run.';


--
-- TOC entry 10131 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_src; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_src IS 'The source of the query. If the qryitem_src is "REL" then the qryitem_group and _detail name a particular table or view and all rows will be returned. If the source is "MQL" then the qryitem_group and _detail name a pre-defined MetaSQL query in the metasql table. If the source is "CUSTOM" then the qryitem_detail contains the full MetaSQL text of the query to run.';


--
-- TOC entry 10132 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_group; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_group IS 'Information to help find the query to run. If the qryitem_src is "REL" then this is the schema in which to find the table or view to query and all rows will be returned (the qryitem_detail names the table or view). If the qryitem_src is "MQL" then this is the group of the query in the metasql table to run (the name is in qryitem_detail). If the qryitem_src IS "CUSTOM" then this ignored.';


--
-- TOC entry 10133 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_detail; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_detail IS 'The particular query to run. If the qryitem_src is "REL" then this is the name of the table or view to query and all rows will be returned. If the qryitem_src is "MQL" then this is the name of the query in the metasql table to run. If the qryitem_src IS "CUSTOM" then this is the actual MetaSQL query text to be parsed and run.';


--
-- TOC entry 10134 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_notes; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_notes IS 'General information about this query.';


--
-- TOC entry 10135 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_username; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_username IS 'The name of the user who last modified this qryitem record.';


--
-- TOC entry 10136 (class 0 OID 0)
-- Dependencies: 744
-- Name: COLUMN qryitem.qryitem_updated; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN qryitem.qryitem_updated IS 'The date this qryitem was last modified.';


--
-- TOC entry 745 (class 1259 OID 146569725)
-- Dependencies: 744 8
-- Name: qryitem_qryitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE qryitem_qryitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.qryitem_qryitem_id_seq OWNER TO admin;

--
-- TOC entry 10138 (class 0 OID 0)
-- Dependencies: 745
-- Name: qryitem_qryitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE qryitem_qryitem_id_seq OWNED BY qryitem.qryitem_id;


--
-- TOC entry 746 (class 1259 OID 146569727)
-- Dependencies: 8
-- Name: quhead_quhead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE quhead_quhead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quhead_quhead_id_seq OWNER TO admin;

--
-- TOC entry 747 (class 1259 OID 146569729)
-- Dependencies: 8
-- Name: quitem_quitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE quitem_quitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quitem_quitem_id_seq OWNER TO admin;

--
-- TOC entry 748 (class 1259 OID 146569731)
-- Dependencies: 6633 8
-- Name: rcalitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE rcalitem (
    rcalitem_id integer DEFAULT nextval(('"xcalitem_xcalitem_id_seq"'::text)::regclass) NOT NULL,
    rcalitem_calhead_id integer,
    rcalitem_offsettype character(1),
    rcalitem_offsetcount integer,
    rcalitem_periodtype character(1),
    rcalitem_periodcount integer,
    rcalitem_name text
);


ALTER TABLE public.rcalitem OWNER TO admin;

--
-- TOC entry 10142 (class 0 OID 0)
-- Dependencies: 748
-- Name: TABLE rcalitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE rcalitem IS 'Relative Calendar Item information';


--
-- TOC entry 749 (class 1259 OID 146569738)
-- Dependencies: 6635 6636 6637 8
-- Name: recur; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE recur (
    recur_id integer NOT NULL,
    recur_parent_id integer NOT NULL,
    recur_parent_type text NOT NULL,
    recur_period text NOT NULL,
    recur_freq integer DEFAULT 1 NOT NULL,
    recur_start timestamp with time zone DEFAULT now(),
    recur_end timestamp with time zone,
    recur_max integer,
    recur_data text,
    CONSTRAINT recur_recur_period_check CHECK ((recur_period = ANY (ARRAY['m'::text, 'H'::text, 'D'::text, 'W'::text, 'M'::text, 'Y'::text, 'C'::text])))
);


ALTER TABLE public.recur OWNER TO admin;

--
-- TOC entry 10144 (class 0 OID 0)
-- Dependencies: 749
-- Name: TABLE recur; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE recur IS 'Track recurring events and objects.';


--
-- TOC entry 10145 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_id IS 'Internal ID of this recurrence record.';


--
-- TOC entry 10146 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_parent_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_parent_id IS 'The internal ID of the event/object that recurs.';


--
-- TOC entry 10147 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_parent_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_parent_type IS 'The table in which the parent event or object is stored.';


--
-- TOC entry 10148 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_period; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_period IS 'With recur_freq, how often this event recurs. Values are "m" for every minute, "H" for every hour, "D" for daily, "W" for weekly, "M" for monthly, "Y" for yearly, and "C" for customized or complex.';


--
-- TOC entry 10149 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_freq; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_freq IS 'With recur_period, how often this event recurs. Values are integers counts of recur_periods. For example, if recur_freq = 2 and recur_period = w then the event recurs every 2 weeks.';


--
-- TOC entry 10150 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_start; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_start IS 'The first date/time when the event should occur.';


--
-- TOC entry 10151 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_end; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_end IS 'The last date/time when the event should occur. NULL means there is no end date/time and the event should recur forever.';


--
-- TOC entry 10152 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_max; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_max IS 'The maximum number of recurrence events to create at one time. If this is NULL then when new events are created, a system-wide default will limit the number.';


--
-- TOC entry 10153 (class 0 OID 0)
-- Dependencies: 749
-- Name: COLUMN recur.recur_data; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recur.recur_data IS 'Not yet used and format still undetermined. Additional data to describe how to apply the period and frequency, particularly when period = "C".';


--
-- TOC entry 750 (class 1259 OID 146569747)
-- Dependencies: 749 8
-- Name: recur_recur_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE recur_recur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recur_recur_id_seq OWNER TO admin;

--
-- TOC entry 10155 (class 0 OID 0)
-- Dependencies: 750
-- Name: recur_recur_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE recur_recur_id_seq OWNED BY recur.recur_id;


--
-- TOC entry 751 (class 1259 OID 146569749)
-- Dependencies: 8
-- Name: recurtype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE recurtype (
    recurtype_id integer NOT NULL,
    recurtype_type text NOT NULL,
    recurtype_table text NOT NULL,
    recurtype_donecheck text NOT NULL,
    recurtype_schedcol text NOT NULL,
    recurtype_limit text,
    recurtype_copyfunc text NOT NULL,
    recurtype_copyargs text[] NOT NULL,
    recurtype_delfunc text
);


ALTER TABLE public.recurtype OWNER TO admin;

--
-- TOC entry 10157 (class 0 OID 0)
-- Dependencies: 751
-- Name: TABLE recurtype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE recurtype IS 'Describes the properties of recurring items/events in way that can be used by stored procedures to maintain the recurrence.';


--
-- TOC entry 10158 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_id IS 'The internal id of this recurrence description.';


--
-- TOC entry 10159 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_type IS 'A code value used by the RecurrenceWidget and the code that uses it to describe the item/event that will recur. Examples include "INCDT" for CRM Incidents and "J" for Projects.';


--
-- TOC entry 10160 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_table; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_table IS 'The table that holds the item/event that will recur.';


--
-- TOC entry 10161 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_donecheck; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_donecheck IS 'A boolean expression that returns TRUE if an individual item/event record in the recurtype_table has already been completed.';


--
-- TOC entry 10162 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_schedcol; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_schedcol IS 'The name of the column in the recurtype_table holding the date or timestamp by which the item is scheduled to be completed or at which the event is supposed to occur.';


--
-- TOC entry 10163 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_limit; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_limit IS 'A boolean expression that returns TRUE if the current user should see the row in the recurtype_table. NULL indicates there is no specific limitation. For example, the maintainance of recurring TODO items should restricted to those items belonging to the user unless s/he has been granted the privilege to modify other people''s todo lists.';


--
-- TOC entry 10164 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_copyfunc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_copyfunc IS 'The name of the function to copy an existing item/event record. The copy function is expected to take at least 2 arguments: the id of the item to copy and the new date/timestamp. If the function accepts more than 2, it must be able to accept NULL values for the 3rd and following arguments.';


--
-- TOC entry 10165 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_copyargs; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_copyargs IS 'An abbreviated argument list for the copy function. This is used to determine whether the second argument must be cast to a date or a timestamp, and to figure out how many additional arguments to pass.';


--
-- TOC entry 10166 (class 0 OID 0)
-- Dependencies: 751
-- Name: COLUMN recurtype.recurtype_delfunc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_delfunc IS 'The name of the function to delete an existing item/event record. The function is expected to take exactly one argument: the id of the item to delete. NULL indicates there is no delete function and that an SQL DELETE statement can be used. In this case, the id column name will be built as the recurtype_table concatenated with the "_id" suffix.';


--
-- TOC entry 752 (class 1259 OID 146569755)
-- Dependencies: 751 8
-- Name: recurtype_recurtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE recurtype_recurtype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recurtype_recurtype_id_seq OWNER TO admin;

--
-- TOC entry 10168 (class 0 OID 0)
-- Dependencies: 752
-- Name: recurtype_recurtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE recurtype_recurtype_id_seq OWNED BY recurtype.recurtype_id;


--
-- TOC entry 753 (class 1259 OID 146569757)
-- Dependencies: 721 8
-- Name: recv_recv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE recv_recv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recv_recv_id_seq OWNER TO admin;

--
-- TOC entry 10170 (class 0 OID 0)
-- Dependencies: 753
-- Name: recv_recv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE recv_recv_id_seq OWNED BY recv.recv_id;


--
-- TOC entry 754 (class 1259 OID 146569759)
-- Dependencies: 8588 8
-- Name: remitto; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW remitto AS
    SELECT (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_name'::text)) AS remitto_name, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address1'::text)) AS remitto_address1, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address2'::text)) AS remitto_address2, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address3'::text)) AS remitto_address3, (((((SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_city'::text)) || '  '::text) || (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_state'::text))) || '  '::text) || (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_zipcode'::text))) AS remitto_citystatezip, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_country'::text)) AS remitto_country, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_phone'::text)) AS remitto_phone;


ALTER TABLE public.remitto OWNER TO admin;

--
-- TOC entry 755 (class 1259 OID 146569763)
-- Dependencies: 6639 6640 8
-- Name: rjctcode; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE rjctcode (
    rjctcode_id integer DEFAULT nextval(('"rjctcode_rjctcode_id_seq"'::text)::regclass) NOT NULL,
    rjctcode_code text NOT NULL,
    rjctcode_descrip text,
    CONSTRAINT rjctcode_rjctcode_code_check CHECK ((rjctcode_code <> ''::text))
);


ALTER TABLE public.rjctcode OWNER TO admin;

--
-- TOC entry 10173 (class 0 OID 0)
-- Dependencies: 755
-- Name: TABLE rjctcode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE rjctcode IS 'Reject Code information';


--
-- TOC entry 756 (class 1259 OID 146569771)
-- Dependencies: 8
-- Name: rjctcode_rjctcode_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE rjctcode_rjctcode_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.rjctcode_rjctcode_id_seq OWNER TO admin;

--
-- TOC entry 757 (class 1259 OID 146569773)
-- Dependencies: 214 8
-- Name: rsncode_rsncode_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE rsncode_rsncode_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rsncode_rsncode_id_seq OWNER TO admin;

--
-- TOC entry 10176 (class 0 OID 0)
-- Dependencies: 757
-- Name: rsncode_rsncode_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE rsncode_rsncode_id_seq OWNED BY rsncode.rsncode_id;


--
-- TOC entry 758 (class 1259 OID 146569775)
-- Dependencies: 6641 6642 8
-- Name: sale; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sale (
    sale_id integer DEFAULT nextval(('"sale_sale_id_seq"'::text)::regclass) NOT NULL,
    sale_name text NOT NULL,
    sale_descrip text,
    sale_ipshead_id integer,
    sale_startdate date,
    sale_enddate date,
    CONSTRAINT sale_sale_name_check CHECK ((sale_name <> ''::text))
);


ALTER TABLE public.sale OWNER TO admin;

--
-- TOC entry 10178 (class 0 OID 0)
-- Dependencies: 758
-- Name: TABLE sale; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sale IS 'Sale information';


--
-- TOC entry 759 (class 1259 OID 146569783)
-- Dependencies: 8
-- Name: sale_sale_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE sale_sale_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sale_sale_id_seq OWNER TO admin;

--
-- TOC entry 760 (class 1259 OID 146569785)
-- Dependencies: 8
-- Name: salesaccnt_salesaccnt_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE salesaccnt_salesaccnt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.salesaccnt_salesaccnt_id_seq OWNER TO admin;

--
-- TOC entry 761 (class 1259 OID 146569787)
-- Dependencies: 215 8
-- Name: salescat_salescat_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE salescat_salescat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.salescat_salescat_id_seq OWNER TO admin;

--
-- TOC entry 10182 (class 0 OID 0)
-- Dependencies: 761
-- Name: salescat_salescat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE salescat_salescat_id_seq OWNED BY salescat.salescat_id;


--
-- TOC entry 762 (class 1259 OID 146569789)
-- Dependencies: 8589 8
-- Name: saleshistory; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW saleshistory AS
    SELECT cohist.cohist_id, cohist.cohist_cust_id, cohist.cohist_itemsite_id, cohist.cohist_shipdate, cohist.cohist_shipvia, cohist.cohist_ordernumber, cohist.cohist_orderdate, cohist.cohist_invcnumber, cohist.cohist_invcdate, cohist.cohist_qtyshipped, cohist.cohist_unitprice, cohist.cohist_shipto_id, cohist.cohist_salesrep_id, cohist.cohist_duedate, cohist.cohist_imported, cohist.cohist_billtoname, cohist.cohist_billtoaddress1, cohist.cohist_billtoaddress2, cohist.cohist_billtoaddress3, cohist.cohist_billtocity, cohist.cohist_billtostate, cohist.cohist_billtozip, cohist.cohist_shiptoname, cohist.cohist_shiptoaddress1, cohist.cohist_shiptoaddress2, cohist.cohist_shiptoaddress3, cohist.cohist_shiptocity, cohist.cohist_shiptostate, cohist.cohist_shiptozip, cohist.cohist_commission, cohist.cohist_commissionpaid, cohist.cohist_unitcost, cohist.cohist_misc_type, cohist.cohist_misc_descrip, cohist.cohist_misc_id, cohist.cohist_doctype, cohist.cohist_promisedate, cohist.cohist_ponumber, cohist.cohist_curr_id, cohist.cohist_sequence, cohist.cohist_taxtype_id, cohist.cohist_taxzone_id, cohist.cohist_cohead_ccpay_id, cohist.cohist_saletype_id, cohist.cohist_shipzone_id, CASE WHEN (cohist.cohist_invcnumber = '-1'::text) THEN 'Credit'::text ELSE cohist.cohist_invcnumber END AS invoicenumber, custinfo.cust_id, custinfo.cust_number, custinfo.cust_name, custinfo.cust_curr_id, custinfo.cust_custtype_id, custtype.custtype_code, custtype.custtype_descrip, salesrep.salesrep_number, salesrep.salesrep_name, shipzone.shipzone_id, shipzone.shipzone_name, shipzone.shipzone_descrip, itemsite.itemsite_warehous_id, itemsite.itemsite_item_id, item.item_id, item.item_number, item.item_descrip1, ((item.item_descrip1 || ' '::text) || item.item_descrip2) AS itemdescription, item.item_prodcat_id, site.warehous_code, site.warehous_descrip, prodcat.prodcat_code, currtobase(cohist.cohist_curr_id, cohist.cohist_commission, cohist.cohist_invcdate) AS basecommission, currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS baseunitprice, currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS custunitprice, round((cohist.cohist_qtyshipped * cohist.cohist_unitprice), 2) AS extprice, round((cohist.cohist_qtyshipped * currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate)), 2) AS baseextprice, round((cohist.cohist_qtyshipped * currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate)), 2) AS custextprice, round((cohist.cohist_qtyshipped * cohist.cohist_unitcost), 4) AS extcost, currconcat(cohist.cohist_curr_id) AS currabbr, 'Return'::text AS cohist_invcdate_xtnullrole, 'qty'::text AS cohist_qtyshipped_xtnumericrole, 'salesprice'::text AS cohist_unitprice_xtnumericrole, 'salesprice'::text AS baseunitprice_xtnumericrole, 'curr'::text AS custunitprice_xtnumericrole, 'curr'::text AS custextprice_xtnumericrole, 'curr'::text AS extprice_xtnumericrole, 'curr'::text AS baseextprice_xtnumericrole, 'cost'::text AS cohist_unitcost_xtnumericrole, 'curr'::text AS extcost_xtnumericrole, 'curr'::text AS cohist_commission_xtnumericrole, 'curr'::text AS basecommission_xtnumericrole, 0 AS cohist_qtyshipped_xttotalrole, 0 AS custextprice_xttotalrole, 0 AS baseextprice_xttotalrole, 0 AS extcost_xttotalrole, 0 AS basecommission_xttotalrole FROM (((((((((cohist JOIN custinfo ON ((custinfo.cust_id = cohist.cohist_cust_id))) JOIN custtype ON ((custtype.custtype_id = custinfo.cust_custtype_id))) JOIN salesrep ON ((salesrep.salesrep_id = cohist.cohist_salesrep_id))) JOIN itemsite ON ((itemsite.itemsite_id = cohist.cohist_itemsite_id))) JOIN site() site(warehous_id, warehous_code, warehous_descrip, warehous_fob, warehous_active, warehous_counttag_prefix, warehous_counttag_number, warehous_bol_prefix, warehous_bol_number, warehous_shipping, warehous_useslips, warehous_usezones, warehous_aislesize, warehous_aislealpha, warehous_racksize, warehous_rackalpha, warehous_binsize, warehous_binalpha, warehous_locationsize, warehous_locationalpha, warehous_enforcearbl, warehous_default_accnt_id, warehous_shipping_commission, warehous_cntct_id, warehous_addr_id, warehous_transit, warehous_shipform_id, warehous_shipvia_id, warehous_shipcomments, warehous_costcat_id, warehous_sitetype_id, warehous_taxzone_id, warehous_sequence) ON ((site.warehous_id = itemsite.itemsite_warehous_id))) JOIN item ON ((item.item_id = itemsite.itemsite_item_id))) JOIN prodcat ON ((prodcat.prodcat_id = item.item_prodcat_id))) LEFT JOIN shiptoinfo ON ((shiptoinfo.shipto_id = cohist.cohist_shipto_id))) LEFT JOIN shipzone ON ((shipzone.shipzone_id = shiptoinfo.shipto_shipzone_id)));


ALTER TABLE public.saleshistory OWNER TO admin;

--
-- TOC entry 10184 (class 0 OID 0)
-- Dependencies: 762
-- Name: VIEW saleshistory; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON VIEW saleshistory IS 'Single point for sales history calculations.';


--
-- TOC entry 763 (class 1259 OID 146569794)
-- Dependencies: 8590 8
-- Name: saleshistorymisc; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW saleshistorymisc AS
    SELECT cohist.cohist_id, cohist.cohist_cust_id, cohist.cohist_itemsite_id, cohist.cohist_shipdate, cohist.cohist_shipvia, cohist.cohist_ordernumber, cohist.cohist_orderdate, cohist.cohist_invcnumber, cohist.cohist_invcdate, cohist.cohist_qtyshipped, cohist.cohist_unitprice, cohist.cohist_shipto_id, cohist.cohist_salesrep_id, cohist.cohist_duedate, cohist.cohist_imported, cohist.cohist_billtoname, cohist.cohist_billtoaddress1, cohist.cohist_billtoaddress2, cohist.cohist_billtoaddress3, cohist.cohist_billtocity, cohist.cohist_billtostate, cohist.cohist_billtozip, cohist.cohist_shiptoname, cohist.cohist_shiptoaddress1, cohist.cohist_shiptoaddress2, cohist.cohist_shiptoaddress3, cohist.cohist_shiptocity, cohist.cohist_shiptostate, cohist.cohist_shiptozip, cohist.cohist_commission, cohist.cohist_commissionpaid, cohist.cohist_unitcost, cohist.cohist_misc_type, cohist.cohist_misc_descrip, cohist.cohist_misc_id, cohist.cohist_doctype, cohist.cohist_promisedate, cohist.cohist_ponumber, cohist.cohist_curr_id, cohist.cohist_sequence, cohist.cohist_taxtype_id, cohist.cohist_taxzone_id, cohist.cohist_cohead_ccpay_id, cohist.cohist_saletype_id, cohist.cohist_shipzone_id, CASE WHEN (cohist.cohist_invcnumber = '-1'::text) THEN 'Credit'::text ELSE cohist.cohist_invcnumber END AS invoicenumber, custinfo.cust_id, custinfo.cust_number, custinfo.cust_name, custinfo.cust_curr_id, custinfo.cust_custtype_id, custtype.custtype_code, salesrep.salesrep_number, salesrep.salesrep_name, shipzone.shipzone_id, shipzone.shipzone_name, itemsite.itemsite_warehous_id, itemsite.itemsite_item_id, item.item_number, item.item_descrip1, ((item.item_descrip1 || ' '::text) || item.item_descrip2) AS itemdescription, item.item_prodcat_id, site.warehous_code, prodcat.prodcat_code, currtobase(cohist.cohist_curr_id, cohist.cohist_commission, cohist.cohist_invcdate) AS basecommission, currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS baseunitprice, currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS custunitprice, round((cohist.cohist_qtyshipped * cohist.cohist_unitprice), 2) AS extprice, round((cohist.cohist_qtyshipped * currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate)), 2) AS baseextprice, round((cohist.cohist_qtyshipped * currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate)), 2) AS custextprice, round((cohist.cohist_qtyshipped * cohist.cohist_unitcost), 4) AS extcost, currconcat(cohist.cohist_curr_id) AS currabbr, 'Return'::text AS cohist_invcdate_xtnullrole, 'qty'::text AS cohist_qtyshipped_xtnumericrole, 'salesprice'::text AS cohist_unitprice_xtnumericrole, 'salesprice'::text AS baseunitprice_xtnumericrole, 'curr'::text AS custunitprice_xtnumericrole, 'curr'::text AS custextprice_xtnumericrole, 'curr'::text AS extprice_xtnumericrole, 'curr'::text AS baseextprice_xtnumericrole, 'cost'::text AS cohist_unitcost_xtnumericrole, 'curr'::text AS extcost_xtnumericrole, 'curr'::text AS cohist_commission_xtnumericrole, 'curr'::text AS basecommission_xtnumericrole, 0 AS cohist_qtyshipped_xttotalrole, 0 AS custextprice_xttotalrole, 0 AS baseextprice_xttotalrole, 0 AS extcost_xttotalrole, 0 AS basecommission_xttotalrole FROM (((((((((cohist JOIN custinfo ON ((custinfo.cust_id = cohist.cohist_cust_id))) JOIN custtype ON ((custtype.custtype_id = custinfo.cust_custtype_id))) JOIN salesrep ON ((salesrep.salesrep_id = cohist.cohist_salesrep_id))) LEFT JOIN itemsite ON ((itemsite.itemsite_id = cohist.cohist_itemsite_id))) LEFT JOIN site() site(warehous_id, warehous_code, warehous_descrip, warehous_fob, warehous_active, warehous_counttag_prefix, warehous_counttag_number, warehous_bol_prefix, warehous_bol_number, warehous_shipping, warehous_useslips, warehous_usezones, warehous_aislesize, warehous_aislealpha, warehous_racksize, warehous_rackalpha, warehous_binsize, warehous_binalpha, warehous_locationsize, warehous_locationalpha, warehous_enforcearbl, warehous_default_accnt_id, warehous_shipping_commission, warehous_cntct_id, warehous_addr_id, warehous_transit, warehous_shipform_id, warehous_shipvia_id, warehous_shipcomments, warehous_costcat_id, warehous_sitetype_id, warehous_taxzone_id, warehous_sequence) ON ((site.warehous_id = itemsite.itemsite_warehous_id))) LEFT JOIN item ON ((item.item_id = itemsite.itemsite_item_id))) LEFT JOIN prodcat ON ((prodcat.prodcat_id = item.item_prodcat_id))) LEFT JOIN shiptoinfo ON ((shiptoinfo.shipto_id = cohist.cohist_shipto_id))) LEFT JOIN shipzone ON ((shipzone.shipzone_id = shiptoinfo.shipto_shipzone_id)));


ALTER TABLE public.saleshistorymisc OWNER TO admin;

--
-- TOC entry 10186 (class 0 OID 0)
-- Dependencies: 763
-- Name: VIEW saleshistorymisc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON VIEW saleshistorymisc IS 'Single point for sales history (including misc. items) calculations.';


--
-- TOC entry 764 (class 1259 OID 146569799)
-- Dependencies: 8
-- Name: salesrep_salesrep_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE salesrep_salesrep_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.salesrep_salesrep_id_seq OWNER TO admin;

--
-- TOC entry 765 (class 1259 OID 146569801)
-- Dependencies: 226 8
-- Name: saletype_saletype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE saletype_saletype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.saletype_saletype_id_seq OWNER TO admin;

--
-- TOC entry 10189 (class 0 OID 0)
-- Dependencies: 765
-- Name: saletype_saletype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE saletype_saletype_id_seq OWNED BY saletype.saletype_id;


--
-- TOC entry 766 (class 1259 OID 146569803)
-- Dependencies: 6644 6645 8
-- Name: schemaord; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE schemaord (
    schemaord_id integer NOT NULL,
    schemaord_name text NOT NULL,
    schemaord_order integer NOT NULL,
    CONSTRAINT schemaord_schemaord_name_check CHECK ((length(schemaord_name) > 0)),
    CONSTRAINT schemaord_schemaord_name_check1 CHECK ((schemaord_name <> ''::text))
);


ALTER TABLE public.schemaord OWNER TO admin;

--
-- TOC entry 10191 (class 0 OID 0)
-- Dependencies: 766
-- Name: TABLE schemaord; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE schemaord IS 'Set the order in which db schemas will appear in the search path after login';


--
-- TOC entry 767 (class 1259 OID 146569811)
-- Dependencies: 766 8
-- Name: schemaord_schemaord_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE schemaord_schemaord_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.schemaord_schemaord_id_seq OWNER TO admin;

--
-- TOC entry 10193 (class 0 OID 0)
-- Dependencies: 767
-- Name: schemaord_schemaord_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE schemaord_schemaord_id_seq OWNED BY schemaord.schemaord_id;


--
-- TOC entry 768 (class 1259 OID 146569813)
-- Dependencies: 8
-- Name: sequence; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sequence (
    sequence_value integer
);


ALTER TABLE public.sequence OWNER TO admin;

--
-- TOC entry 10195 (class 0 OID 0)
-- Dependencies: 768
-- Name: TABLE sequence; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sequence IS 'Pre-populated list of sequence numbers (1-1000) used for printing Labels and other uses';


--
-- TOC entry 769 (class 1259 OID 146569816)
-- Dependencies: 293 8
-- Name: shift_shift_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shift_shift_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shift_shift_id_seq OWNER TO admin;

--
-- TOC entry 10197 (class 0 OID 0)
-- Dependencies: 769
-- Name: shift_shift_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shift_shift_id_seq OWNED BY shift.shift_id;


--
-- TOC entry 770 (class 1259 OID 146569818)
-- Dependencies: 281 8
-- Name: shipchrg_shipchrg_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipchrg_shipchrg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shipchrg_shipchrg_id_seq OWNER TO admin;

--
-- TOC entry 10199 (class 0 OID 0)
-- Dependencies: 770
-- Name: shipchrg_shipchrg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shipchrg_shipchrg_id_seq OWNED BY shipchrg.shipchrg_id;


--
-- TOC entry 771 (class 1259 OID 146569820)
-- Dependencies: 6646 6647 6648 6649 6650 8
-- Name: shipdatasum; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE shipdatasum (
    shipdatasum_cohead_number text NOT NULL,
    shipdatasum_cosmisc_tracknum text NOT NULL,
    shipdatasum_cosmisc_packnum_tracknum text NOT NULL,
    shipdatasum_weight numeric(16,4),
    shipdatasum_base_freight numeric(16,4),
    shipdatasum_total_freight numeric(16,4),
    shipdatasum_shipper text DEFAULT 'UPS'::text,
    shipdatasum_billing_option text,
    shipdatasum_package_type text,
    shipdatasum_lastupdated timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
    shipdatasum_shipped boolean DEFAULT false,
    shipdatasum_shiphead_number text,
    shipdatasum_base_freight_curr_id integer DEFAULT basecurrid(),
    shipdatasum_total_freight_curr_id integer DEFAULT basecurrid()
);


ALTER TABLE public.shipdatasum OWNER TO admin;

--
-- TOC entry 10201 (class 0 OID 0)
-- Dependencies: 771
-- Name: TABLE shipdatasum; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE shipdatasum IS 'Shipping Interface information.';


--
-- TOC entry 772 (class 1259 OID 146569831)
-- Dependencies: 8
-- Name: shipform_shipform_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipform_shipform_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.shipform_shipform_id_seq OWNER TO admin;

--
-- TOC entry 773 (class 1259 OID 146569833)
-- Dependencies: 526 8
-- Name: shiphead_shiphead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shiphead_shiphead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shiphead_shiphead_id_seq OWNER TO admin;

--
-- TOC entry 10204 (class 0 OID 0)
-- Dependencies: 773
-- Name: shiphead_shiphead_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shiphead_shiphead_id_seq OWNED BY shiphead.shiphead_id;


--
-- TOC entry 774 (class 1259 OID 146569835)
-- Dependencies: 527 8
-- Name: shipitem_shipitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipitem_shipitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shipitem_shipitem_id_seq OWNER TO admin;

--
-- TOC entry 10206 (class 0 OID 0)
-- Dependencies: 774
-- Name: shipitem_shipitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shipitem_shipitem_id_seq OWNED BY shipitem.shipitem_id;


--
-- TOC entry 775 (class 1259 OID 146569837)
-- Dependencies: 8
-- Name: shipment_number_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipment_number_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shipment_number_seq OWNER TO admin;

--
-- TOC entry 776 (class 1259 OID 146569839)
-- Dependencies: 8591 8
-- Name: shipto; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW shipto AS
    SELECT shiptoinfo.shipto_id, shiptoinfo.shipto_cust_id, shiptoinfo.shipto_name, m.addr_line1 AS shipto_address1, m.addr_line2 AS shipto_address2, m.addr_line3 AS shipto_address3, m.addr_city AS shipto_city, m.addr_state AS shipto_state, m.addr_postalcode AS shipto_zipcode, shiptoinfo.shipto_taxzone_id, shiptoinfo.shipto_salesrep_id, c1.cntct_phone AS shipto_phone, shiptoinfo.shipto_comments, shiptoinfo.shipto_shipcomments, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS shipto_contact, c1.cntct_fax AS shipto_fax, c1.cntct_email AS shipto_email, shiptoinfo.shipto_shipzone_id, shiptoinfo.shipto_shipvia, shiptoinfo.shipto_commission, shiptoinfo.shipto_shipform_id, shiptoinfo.shipto_shipchrg_id, shiptoinfo.shipto_active, shiptoinfo.shipto_default, shiptoinfo.shipto_num, shiptoinfo.shipto_ediprofile_id, m.addr_country AS shipto_country FROM ((shiptoinfo LEFT JOIN cntct c1 ON ((shiptoinfo.shipto_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((shiptoinfo.shipto_addr_id = m.addr_id)));


ALTER TABLE public.shipto OWNER TO admin;

--
-- TOC entry 777 (class 1259 OID 146569844)
-- Dependencies: 8
-- Name: shipto_shipto_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipto_shipto_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.shipto_shipto_id_seq OWNER TO admin;

--
-- TOC entry 778 (class 1259 OID 146569846)
-- Dependencies: 8
-- Name: shipvia_shipvia_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipvia_shipvia_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.shipvia_shipvia_id_seq OWNER TO admin;

--
-- TOC entry 779 (class 1259 OID 146569848)
-- Dependencies: 8
-- Name: shipzone_shipzone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE shipzone_shipzone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.shipzone_shipzone_id_seq OWNER TO admin;

--
-- TOC entry 780 (class 1259 OID 146569850)
-- Dependencies: 387 8
-- Name: sitetype_sitetype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE sitetype_sitetype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sitetype_sitetype_id_seq OWNER TO admin;

--
-- TOC entry 10213 (class 0 OID 0)
-- Dependencies: 780
-- Name: sitetype_sitetype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE sitetype_sitetype_id_seq OWNED BY sitetype.sitetype_id;


--
-- TOC entry 781 (class 1259 OID 146569852)
-- Dependencies: 6651 6652 6653 8
-- Name: sltrans; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sltrans (
    sltrans_id integer DEFAULT nextval('gltrans_gltrans_id_seq'::regclass) NOT NULL,
    sltrans_created timestamp with time zone,
    sltrans_date date NOT NULL,
    sltrans_sequence integer,
    sltrans_accnt_id integer NOT NULL,
    sltrans_source text,
    sltrans_docnumber text,
    sltrans_misc_id integer,
    sltrans_amount numeric(20,2) NOT NULL,
    sltrans_notes text,
    sltrans_journalnumber integer,
    sltrans_posted boolean NOT NULL,
    sltrans_doctype text,
    sltrans_username text DEFAULT geteffectivextuser() NOT NULL,
    sltrans_gltrans_journalnumber integer,
    sltrans_rec boolean DEFAULT false NOT NULL
);


ALTER TABLE public.sltrans OWNER TO admin;

--
-- TOC entry 10215 (class 0 OID 0)
-- Dependencies: 781
-- Name: TABLE sltrans; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sltrans IS 'Journal transaction information';


--
-- TOC entry 782 (class 1259 OID 146569861)
-- Dependencies: 8
-- Name: sltrans_backup; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sltrans_backup (
    sltrans_old_id integer,
    sltrans_new_id integer
);


ALTER TABLE public.sltrans_backup OWNER TO admin;

--
-- TOC entry 10217 (class 0 OID 0)
-- Dependencies: 782
-- Name: TABLE sltrans_backup; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sltrans_backup IS 'backup cross references of old and new ids for sltrans 4.0 upgrade.';


--
-- TOC entry 783 (class 1259 OID 146569864)
-- Dependencies: 8592 8
-- Name: sopack; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW sopack AS
    SELECT pack.pack_id AS sopack_id, pack.pack_head_id AS sopack_sohead_id, pack.pack_printed AS sopack_printed, pack.pack_shiphead_id AS sopack_cosmisc_id FROM pack WHERE (pack.pack_head_type = 'SO'::text);


ALTER TABLE public.sopack OWNER TO admin;

--
-- TOC entry 784 (class 1259 OID 146569868)
-- Dependencies: 8
-- Name: sopack_sopack_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE sopack_sopack_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sopack_sopack_id_seq OWNER TO admin;

--
-- TOC entry 785 (class 1259 OID 146569870)
-- Dependencies: 6655 8
-- Name: source; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE source (
    source_id integer NOT NULL,
    source_module text,
    source_name text NOT NULL,
    source_descrip text,
    CONSTRAINT source_source_name_check CHECK ((source_name <> ''::text))
);


ALTER TABLE public.source OWNER TO admin;

--
-- TOC entry 10220 (class 0 OID 0)
-- Dependencies: 785
-- Name: TABLE source; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE source IS 'Tax class information';


--
-- TOC entry 10221 (class 0 OID 0)
-- Dependencies: 785
-- Name: COLUMN source.source_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_id IS 'Primary key';


--
-- TOC entry 10222 (class 0 OID 0)
-- Dependencies: 785
-- Name: COLUMN source.source_module; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_module IS 'Application module';


--
-- TOC entry 10223 (class 0 OID 0)
-- Dependencies: 785
-- Name: COLUMN source.source_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_name IS 'Name';


--
-- TOC entry 10224 (class 0 OID 0)
-- Dependencies: 785
-- Name: COLUMN source.source_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_descrip IS 'Description';


--
-- TOC entry 786 (class 1259 OID 146569877)
-- Dependencies: 785 8
-- Name: source_source_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE source_source_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.source_source_id_seq OWNER TO admin;

--
-- TOC entry 10226 (class 0 OID 0)
-- Dependencies: 786
-- Name: source_source_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE source_source_id_seq OWNED BY source.source_id;


--
-- TOC entry 787 (class 1259 OID 146569879)
-- Dependencies: 6657 8
-- Name: state; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE state (
    state_id integer NOT NULL,
    state_name text NOT NULL,
    state_abbr text,
    state_country_id integer,
    CONSTRAINT state_state_name_check CHECK ((state_name <> ''::text))
);


ALTER TABLE public.state OWNER TO admin;

--
-- TOC entry 10228 (class 0 OID 0)
-- Dependencies: 787
-- Name: TABLE state; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE state IS 'List of states, provinces, and territories associated with various countries.';


--
-- TOC entry 788 (class 1259 OID 146569886)
-- Dependencies: 787 8
-- Name: state_state_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE state_state_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.state_state_id_seq OWNER TO admin;

--
-- TOC entry 10230 (class 0 OID 0)
-- Dependencies: 788
-- Name: state_state_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE state_state_id_seq OWNED BY state.state_id;


--
-- TOC entry 789 (class 1259 OID 146569888)
-- Dependencies: 6659 8
-- Name: status; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE status (
    status_id integer NOT NULL,
    status_type text NOT NULL,
    status_code character(1) NOT NULL,
    status_name text,
    status_seq integer,
    status_color text DEFAULT 'white'::text
);


ALTER TABLE public.status OWNER TO admin;

--
-- TOC entry 790 (class 1259 OID 146569895)
-- Dependencies: 789 8
-- Name: status_status_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE status_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.status_status_id_seq OWNER TO admin;

--
-- TOC entry 10233 (class 0 OID 0)
-- Dependencies: 790
-- Name: status_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE status_status_id_seq OWNED BY status.status_id;


--
-- TOC entry 791 (class 1259 OID 146569897)
-- Dependencies: 6661 8
-- Name: stdjrnl; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnl (
    stdjrnl_id integer NOT NULL,
    stdjrnl_name text NOT NULL,
    stdjrnl_descrip text,
    stdjrnl_notes text,
    CONSTRAINT stdjrnl_stdjrnl_name_check CHECK ((stdjrnl_name <> ''::text))
);


ALTER TABLE public.stdjrnl OWNER TO admin;

--
-- TOC entry 10235 (class 0 OID 0)
-- Dependencies: 791
-- Name: TABLE stdjrnl; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnl IS 'Standard Journal information';


--
-- TOC entry 792 (class 1259 OID 146569904)
-- Dependencies: 791 8
-- Name: stdjrnl_stdjrnl_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE stdjrnl_stdjrnl_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.stdjrnl_stdjrnl_id_seq OWNER TO admin;

--
-- TOC entry 10237 (class 0 OID 0)
-- Dependencies: 792
-- Name: stdjrnl_stdjrnl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnl_stdjrnl_id_seq OWNED BY stdjrnl.stdjrnl_id;


--
-- TOC entry 793 (class 1259 OID 146569906)
-- Dependencies: 6663 8
-- Name: stdjrnlgrp; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlgrp (
    stdjrnlgrp_id integer NOT NULL,
    stdjrnlgrp_name text NOT NULL,
    stdjrnlgrp_descrip text,
    CONSTRAINT stdjrnlgrp_stdjrnlgrp_name_check CHECK ((stdjrnlgrp_name <> ''::text))
);


ALTER TABLE public.stdjrnlgrp OWNER TO admin;

--
-- TOC entry 10239 (class 0 OID 0)
-- Dependencies: 793
-- Name: TABLE stdjrnlgrp; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlgrp IS 'Standard Journal Group information';


--
-- TOC entry 794 (class 1259 OID 146569913)
-- Dependencies: 793 8
-- Name: stdjrnlgrp_stdjrnlgrp_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.stdjrnlgrp_stdjrnlgrp_id_seq OWNER TO admin;

--
-- TOC entry 10241 (class 0 OID 0)
-- Dependencies: 794
-- Name: stdjrnlgrp_stdjrnlgrp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq OWNED BY stdjrnlgrp.stdjrnlgrp_id;


--
-- TOC entry 795 (class 1259 OID 146569915)
-- Dependencies: 8
-- Name: stdjrnlgrpitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlgrpitem (
    stdjrnlgrpitem_id integer NOT NULL,
    stdjrnlgrpitem_stdjrnl_id integer,
    stdjrnlgrpitem_toapply integer,
    stdjrnlgrpitem_applied integer,
    stdjrnlgrpitem_effective date,
    stdjrnlgrpitem_expires date,
    stdjrnlgrpitem_stdjrnlgrp_id integer
);


ALTER TABLE public.stdjrnlgrpitem OWNER TO admin;

--
-- TOC entry 10243 (class 0 OID 0)
-- Dependencies: 795
-- Name: TABLE stdjrnlgrpitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlgrpitem IS 'Standard Journal Group Item information';


--
-- TOC entry 796 (class 1259 OID 146569918)
-- Dependencies: 795 8
-- Name: stdjrnlgrpitem_stdjrnlgrpitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.stdjrnlgrpitem_stdjrnlgrpitem_id_seq OWNER TO admin;

--
-- TOC entry 10245 (class 0 OID 0)
-- Dependencies: 796
-- Name: stdjrnlgrpitem_stdjrnlgrpitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq OWNED BY stdjrnlgrpitem.stdjrnlgrpitem_id;


--
-- TOC entry 797 (class 1259 OID 146569920)
-- Dependencies: 8
-- Name: stdjrnlitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlitem (
    stdjrnlitem_id integer NOT NULL,
    stdjrnlitem_stdjrnl_id integer NOT NULL,
    stdjrnlitem_accnt_id integer NOT NULL,
    stdjrnlitem_amount numeric(20,2) NOT NULL,
    stdjrnlitem_notes text
);


ALTER TABLE public.stdjrnlitem OWNER TO admin;

--
-- TOC entry 10247 (class 0 OID 0)
-- Dependencies: 797
-- Name: TABLE stdjrnlitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlitem IS 'Standard Journal Item information';


--
-- TOC entry 798 (class 1259 OID 146569926)
-- Dependencies: 797 8
-- Name: stdjrnlitem_stdjrnlitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE stdjrnlitem_stdjrnlitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.stdjrnlitem_stdjrnlitem_id_seq OWNER TO admin;

--
-- TOC entry 10249 (class 0 OID 0)
-- Dependencies: 798
-- Name: stdjrnlitem_stdjrnlitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlitem_stdjrnlitem_id_seq OWNED BY stdjrnlitem.stdjrnlitem_id;


--
-- TOC entry 799 (class 1259 OID 146569928)
-- Dependencies: 6667 8
-- Name: subaccnt; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE subaccnt (
    subaccnt_id integer NOT NULL,
    subaccnt_number text NOT NULL,
    subaccnt_descrip text,
    CONSTRAINT subaccnt_subaccnt_number_check CHECK ((subaccnt_number <> ''::text))
);


ALTER TABLE public.subaccnt OWNER TO admin;

--
-- TOC entry 10251 (class 0 OID 0)
-- Dependencies: 799
-- Name: TABLE subaccnt; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE subaccnt IS 'Subaccount information';


--
-- TOC entry 800 (class 1259 OID 146569935)
-- Dependencies: 799 8
-- Name: subaccnt_subaccnt_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE subaccnt_subaccnt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subaccnt_subaccnt_id_seq OWNER TO admin;

--
-- TOC entry 10253 (class 0 OID 0)
-- Dependencies: 800
-- Name: subaccnt_subaccnt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE subaccnt_subaccnt_id_seq OWNED BY subaccnt.subaccnt_id;


--
-- TOC entry 801 (class 1259 OID 146569937)
-- Dependencies: 8
-- Name: subaccnttype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE subaccnttype (
    subaccnttype_id integer NOT NULL,
    subaccnttype_accnt_type character(1) NOT NULL,
    subaccnttype_code text NOT NULL,
    subaccnttype_descrip text
);


ALTER TABLE public.subaccnttype OWNER TO admin;

--
-- TOC entry 10255 (class 0 OID 0)
-- Dependencies: 801
-- Name: TABLE subaccnttype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE subaccnttype IS 'User defined Sub Account Types.';


--
-- TOC entry 802 (class 1259 OID 146569943)
-- Dependencies: 801 8
-- Name: subaccnttype_subaccnttype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE subaccnttype_subaccnttype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subaccnttype_subaccnttype_id_seq OWNER TO admin;

--
-- TOC entry 10257 (class 0 OID 0)
-- Dependencies: 802
-- Name: subaccnttype_subaccnttype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE subaccnttype_subaccnttype_id_seq OWNED BY subaccnttype.subaccnttype_id;


--
-- TOC entry 803 (class 1259 OID 146569945)
-- Dependencies: 8
-- Name: tax_tax_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE tax_tax_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tax_tax_id_seq OWNER TO admin;

--
-- TOC entry 804 (class 1259 OID 146569947)
-- Dependencies: 8
-- Name: taxass; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxass (
    taxass_id integer NOT NULL,
    taxass_taxzone_id integer,
    taxass_taxtype_id integer,
    taxass_tax_id integer NOT NULL
);


ALTER TABLE public.taxass OWNER TO admin;

--
-- TOC entry 10260 (class 0 OID 0)
-- Dependencies: 804
-- Name: TABLE taxass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxass IS 'The tax assignment table associates different tax zones and tax types to a given set of tax codes.';


--
-- TOC entry 10261 (class 0 OID 0)
-- Dependencies: 804
-- Name: COLUMN taxass.taxass_taxzone_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_taxzone_id IS 'The id of the tax zone. If NULL any tax zone will apply.';


--
-- TOC entry 10262 (class 0 OID 0)
-- Dependencies: 804
-- Name: COLUMN taxass.taxass_taxtype_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_taxtype_id IS 'The id of the tax type. If NULL any tax type will apply.';


--
-- TOC entry 10263 (class 0 OID 0)
-- Dependencies: 804
-- Name: COLUMN taxass.taxass_tax_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_tax_id IS 'The id of the tax code.';


--
-- TOC entry 805 (class 1259 OID 146569950)
-- Dependencies: 804 8
-- Name: taxass_taxass_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxass_taxass_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxass_taxass_id_seq OWNER TO admin;

--
-- TOC entry 10265 (class 0 OID 0)
-- Dependencies: 805
-- Name: taxass_taxass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxass_taxass_id_seq OWNED BY taxass.taxass_id;


--
-- TOC entry 806 (class 1259 OID 146569952)
-- Dependencies: 284 8
-- Name: taxauth_taxauth_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxauth_taxauth_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxauth_taxauth_id_seq OWNER TO admin;

--
-- TOC entry 10267 (class 0 OID 0)
-- Dependencies: 806
-- Name: taxauth_taxauth_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxauth_taxauth_id_seq OWNED BY taxauth.taxauth_id;


--
-- TOC entry 807 (class 1259 OID 146569954)
-- Dependencies: 6671 8
-- Name: taxclass; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxclass (
    taxclass_id integer NOT NULL,
    taxclass_code text NOT NULL,
    taxclass_descrip text,
    taxclass_sequence integer,
    CONSTRAINT taxclass_taxclass_code_check CHECK ((taxclass_code <> ''::text))
);


ALTER TABLE public.taxclass OWNER TO admin;

--
-- TOC entry 10269 (class 0 OID 0)
-- Dependencies: 807
-- Name: TABLE taxclass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxclass IS 'Tax class information';


--
-- TOC entry 10270 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN taxclass.taxclass_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_id IS 'Primary key';


--
-- TOC entry 10271 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN taxclass.taxclass_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_code IS 'Code';


--
-- TOC entry 10272 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN taxclass.taxclass_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_descrip IS 'Description';


--
-- TOC entry 10273 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN taxclass.taxclass_sequence; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_sequence IS 'Group sequence';


--
-- TOC entry 808 (class 1259 OID 146569961)
-- Dependencies: 807 8
-- Name: taxclass_taxclass_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxclass_taxclass_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxclass_taxclass_id_seq OWNER TO admin;

--
-- TOC entry 10275 (class 0 OID 0)
-- Dependencies: 808
-- Name: taxclass_taxclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxclass_taxclass_id_seq OWNED BY taxclass.taxclass_id;


--
-- TOC entry 378 (class 1259 OID 146568112)
-- Dependencies: 377 8
-- Name: taxhist_taxhist_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxhist_taxhist_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxhist_taxhist_id_seq OWNER TO admin;

--
-- TOC entry 10277 (class 0 OID 0)
-- Dependencies: 378
-- Name: taxhist_taxhist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxhist_taxhist_id_seq OWNED BY taxhist.taxhist_id;


--
-- TOC entry 809 (class 1259 OID 146569963)
-- Dependencies: 8
-- Name: taxrate; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxrate (
    taxrate_id integer NOT NULL,
    taxrate_tax_id integer NOT NULL,
    taxrate_percent numeric(10,6) NOT NULL,
    taxrate_curr_id integer,
    taxrate_amount numeric(16,2) NOT NULL,
    taxrate_effective date,
    taxrate_expires date
);


ALTER TABLE public.taxrate OWNER TO admin;

--
-- TOC entry 10279 (class 0 OID 0)
-- Dependencies: 809
-- Name: TABLE taxrate; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxrate IS 'Tax rates.';


--
-- TOC entry 10280 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_id IS 'Primary key.';


--
-- TOC entry 10281 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_tax_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_tax_id IS 'The id of the parent tax code.';


--
-- TOC entry 10282 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_percent; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_percent IS 'Tax rate percentage.';


--
-- TOC entry 10283 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_curr_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_curr_id IS 'The currency id of the flat rate amount.';


--
-- TOC entry 10284 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_amount IS 'Flat tax rate amount.';


--
-- TOC entry 10285 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_effective; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_effective IS 'The effective date of the tax rate.  NULL value means always.';


--
-- TOC entry 10286 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN taxrate.taxrate_expires; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_expires IS 'The expire date of the tax rate.  NULL value means never.';


--
-- TOC entry 810 (class 1259 OID 146569966)
-- Dependencies: 809 8
-- Name: taxrate_taxrate_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxrate_taxrate_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxrate_taxrate_id_seq OWNER TO admin;

--
-- TOC entry 10288 (class 0 OID 0)
-- Dependencies: 810
-- Name: taxrate_taxrate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxrate_taxrate_id_seq OWNED BY taxrate.taxrate_id;


--
-- TOC entry 811 (class 1259 OID 146569968)
-- Dependencies: 285 8
-- Name: taxreg_taxreg_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxreg_taxreg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxreg_taxreg_id_seq OWNER TO admin;

--
-- TOC entry 10290 (class 0 OID 0)
-- Dependencies: 811
-- Name: taxreg_taxreg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxreg_taxreg_id_seq OWNED BY taxreg.taxreg_id;


--
-- TOC entry 812 (class 1259 OID 146569970)
-- Dependencies: 199 8
-- Name: taxtype_taxtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxtype_taxtype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxtype_taxtype_id_seq OWNER TO admin;

--
-- TOC entry 10292 (class 0 OID 0)
-- Dependencies: 812
-- Name: taxtype_taxtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxtype_taxtype_id_seq OWNED BY taxtype.taxtype_id;


--
-- TOC entry 813 (class 1259 OID 146569972)
-- Dependencies: 220 8
-- Name: taxzone_taxzone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE taxzone_taxzone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.taxzone_taxzone_id_seq OWNER TO admin;

--
-- TOC entry 10294 (class 0 OID 0)
-- Dependencies: 813
-- Name: taxzone_taxzone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxzone_taxzone_id_seq OWNED BY taxzone.taxzone_id;


--
-- TOC entry 814 (class 1259 OID 146569974)
-- Dependencies: 8
-- Name: terms_terms_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE terms_terms_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.terms_terms_id_seq OWNER TO admin;

--
-- TOC entry 815 (class 1259 OID 146569976)
-- Dependencies: 233 8
-- Name: todoitem_todoitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE todoitem_todoitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.todoitem_todoitem_id_seq OWNER TO admin;

--
-- TOC entry 10297 (class 0 OID 0)
-- Dependencies: 815
-- Name: todoitem_todoitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE todoitem_todoitem_id_seq OWNED BY todoitem.todoitem_id;


--
-- TOC entry 816 (class 1259 OID 146569978)
-- Dependencies: 8
-- Name: trgthist; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE trgthist (
    trgthist_src_cntct_id integer NOT NULL,
    trgthist_trgt_cntct_id integer NOT NULL,
    trgthist_col text NOT NULL,
    trgthist_value text NOT NULL
);


ALTER TABLE public.trgthist OWNER TO admin;

--
-- TOC entry 817 (class 1259 OID 146569984)
-- Dependencies: 6674 8
-- Name: trialbal; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE trialbal (
    trialbal_id integer NOT NULL,
    trialbal_period_id integer,
    trialbal_accnt_id integer,
    trialbal_beginning numeric(20,2),
    trialbal_ending numeric(20,2),
    trialbal_credits numeric(20,2),
    trialbal_debits numeric(20,2),
    trialbal_dirty boolean,
    trialbal_yearend numeric(20,2) DEFAULT 0.00 NOT NULL
);


ALTER TABLE public.trialbal OWNER TO admin;

--
-- TOC entry 10300 (class 0 OID 0)
-- Dependencies: 817
-- Name: TABLE trialbal; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE trialbal IS 'Trial Balance information';


--
-- TOC entry 818 (class 1259 OID 146569988)
-- Dependencies: 817 8
-- Name: trialbal_trialbal_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE trialbal_trialbal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trialbal_trialbal_id_seq OWNER TO admin;

--
-- TOC entry 10302 (class 0 OID 0)
-- Dependencies: 818
-- Name: trialbal_trialbal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE trialbal_trialbal_id_seq OWNED BY trialbal.trialbal_id;


--
-- TOC entry 819 (class 1259 OID 146569990)
-- Dependencies: 200 8
-- Name: uom_uom_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE uom_uom_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.uom_uom_id_seq OWNER TO admin;

--
-- TOC entry 10304 (class 0 OID 0)
-- Dependencies: 819
-- Name: uom_uom_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uom_uom_id_seq OWNED BY uom.uom_id;


--
-- TOC entry 820 (class 1259 OID 146569992)
-- Dependencies: 6676 8
-- Name: uomconv; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE uomconv (
    uomconv_id integer NOT NULL,
    uomconv_from_uom_id integer NOT NULL,
    uomconv_from_value numeric(20,10) NOT NULL,
    uomconv_to_uom_id integer NOT NULL,
    uomconv_to_value numeric(20,10) NOT NULL,
    uomconv_fractional boolean DEFAULT false NOT NULL
);


ALTER TABLE public.uomconv OWNER TO admin;

--
-- TOC entry 10306 (class 0 OID 0)
-- Dependencies: 820
-- Name: TABLE uomconv; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE uomconv IS 'UOM conversion information. From Unit to To Unit with a value per ratio.';


--
-- TOC entry 821 (class 1259 OID 146569996)
-- Dependencies: 820 8
-- Name: uomconv_uomconv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE uomconv_uomconv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.uomconv_uomconv_id_seq OWNER TO admin;

--
-- TOC entry 10308 (class 0 OID 0)
-- Dependencies: 821
-- Name: uomconv_uomconv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uomconv_uomconv_id_seq OWNED BY uomconv.uomconv_id;


--
-- TOC entry 822 (class 1259 OID 146569998)
-- Dependencies: 6678 6679 8
-- Name: uomtype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE uomtype (
    uomtype_id integer NOT NULL,
    uomtype_name text NOT NULL,
    uomtype_descrip text,
    uomtype_multiple boolean DEFAULT false NOT NULL,
    CONSTRAINT uomtype_uomtype_name_check CHECK ((uomtype_name <> ''::text))
);


ALTER TABLE public.uomtype OWNER TO admin;

--
-- TOC entry 10310 (class 0 OID 0)
-- Dependencies: 822
-- Name: TABLE uomtype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE uomtype IS 'UOM Type values.';


--
-- TOC entry 823 (class 1259 OID 146570006)
-- Dependencies: 822 8
-- Name: uomtype_uomtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE uomtype_uomtype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.uomtype_uomtype_id_seq OWNER TO admin;

--
-- TOC entry 10312 (class 0 OID 0)
-- Dependencies: 823
-- Name: uomtype_uomtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uomtype_uomtype_id_seq OWNED BY uomtype.uomtype_id;


--
-- TOC entry 824 (class 1259 OID 146570008)
-- Dependencies: 244 8
-- Name: urlinfo_url_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE urlinfo_url_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.urlinfo_url_id_seq OWNER TO admin;

--
-- TOC entry 10314 (class 0 OID 0)
-- Dependencies: 824
-- Name: urlinfo_url_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE urlinfo_url_id_seq OWNED BY urlinfo.url_id;


--
-- TOC entry 825 (class 1259 OID 146570010)
-- Dependencies: 6680 8
-- Name: usrpref; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usrpref (
    usrpref_id integer DEFAULT nextval(('usrpref_usrpref_id_seq'::text)::regclass) NOT NULL,
    usrpref_name text,
    usrpref_value text,
    usrpref_username text
);


ALTER TABLE public.usrpref OWNER TO admin;

--
-- TOC entry 10316 (class 0 OID 0)
-- Dependencies: 825
-- Name: TABLE usrpref; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usrpref IS 'User Preferences information';


--
-- TOC entry 826 (class 1259 OID 146570017)
-- Dependencies: 8593 8
-- Name: usr; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW usr AS
    SELECT (pg_user.usesysid)::integer AS usr_id, (pg_user.usename)::text AS usr_username, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'propername'::text))), ''::text) AS usr_propername, NULL::text AS usr_passwd, COALESCE((SELECT (usrpref.usrpref_value)::integer AS usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'locale_id'::text))), COALESCE((SELECT locale.locale_id FROM locale WHERE (lower(locale.locale_code) = 'default'::text) LIMIT 1), (SELECT locale.locale_id FROM locale ORDER BY locale.locale_id LIMIT 1))) AS usr_locale_id, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'initials'::text))), ''::text) AS usr_initials, COALESCE((SELECT CASE WHEN (usrpref.usrpref_value = 't'::text) THEN true ELSE false END AS "case" FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'agent'::text))), false) AS usr_agent, COALESCE((SELECT CASE WHEN (usrpref.usrpref_value = 't'::text) THEN true ELSE false END AS "case" FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'active'::text))), usercanlogin((pg_user.usename)::text)) AS usr_active, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'email'::text))), ''::text) AS usr_email, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'window'::text))), ''::text) AS usr_window FROM pg_user;


ALTER TABLE public.usr OWNER TO admin;

--
-- TOC entry 827 (class 1259 OID 146570022)
-- Dependencies: 6681 8
-- Name: usr_bak; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usr_bak (
    usr_id integer DEFAULT nextval(('usr_usr_id_seq'::text)::regclass) NOT NULL,
    usr_username text NOT NULL,
    usr_propername text,
    usr_passwd text,
    usr_locale_id integer NOT NULL,
    usr_initials text,
    usr_agent boolean NOT NULL,
    usr_active boolean NOT NULL,
    usr_email text,
    usr_window text
);


ALTER TABLE public.usr_bak OWNER TO admin;

--
-- TOC entry 10319 (class 0 OID 0)
-- Dependencies: 827
-- Name: TABLE usr_bak; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usr_bak IS 'User information';


--
-- TOC entry 828 (class 1259 OID 146570029)
-- Dependencies: 8
-- Name: usr_usr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE usr_usr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.usr_usr_id_seq OWNER TO admin;

--
-- TOC entry 829 (class 1259 OID 146570031)
-- Dependencies: 732 8
-- Name: usrgrp_usrgrp_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE usrgrp_usrgrp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.usrgrp_usrgrp_id_seq OWNER TO admin;

--
-- TOC entry 10322 (class 0 OID 0)
-- Dependencies: 829
-- Name: usrgrp_usrgrp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE usrgrp_usrgrp_id_seq OWNED BY usrgrp.usrgrp_id;


--
-- TOC entry 830 (class 1259 OID 146570033)
-- Dependencies: 8
-- Name: usrpref_usrpref_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE usrpref_usrpref_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.usrpref_usrpref_id_seq OWNER TO admin;

--
-- TOC entry 831 (class 1259 OID 146570035)
-- Dependencies: 8
-- Name: usrpriv_usrpriv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE usrpriv_usrpriv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.usrpriv_usrpriv_id_seq OWNER TO admin;

--
-- TOC entry 832 (class 1259 OID 146570037)
-- Dependencies: 8594 8
-- Name: vend; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW vend AS
    SELECT vendinfo.vend_id, vendinfo.vend_name, m.addr_line1 AS vend_address1, m.addr_line2 AS vend_address2, m.addr_line3 AS vend_address3, m.addr_city AS vend_city, m.addr_state AS vend_state, m.addr_postalcode AS vend_zip, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS vend_contact1, c1.cntct_phone AS vend_phone1, btrim(((c2.cntct_first_name || ' '::text) || c2.cntct_last_name)) AS vend_contact2, c2.cntct_phone AS vend_phone2, vendinfo.vend_lastpurchdate, vendinfo.vend_active, vendinfo.vend_po, vendinfo.vend_comments, vendinfo.vend_pocomments, vendinfo.vend_number, c1.cntct_fax AS vend_fax1, c2.cntct_fax AS vend_fax2, c1.cntct_email AS vend_email1, c2.cntct_email AS vend_email2, vendinfo.vend_1099, vendinfo.vend_exported, vendinfo.vend_fobsource, vendinfo.vend_fob, vendinfo.vend_terms_id, vendinfo.vend_shipvia, vendinfo.vend_vendtype_id, vendinfo.vend_qualified, vendinfo.vend_ediemail, vendinfo.vend_ediemailbody, vendinfo.vend_edisubject, vendinfo.vend_edifilename, vendinfo.vend_accntnum, vendinfo.vend_emailpodelivery, vendinfo.vend_restrictpurch, vendinfo.vend_edicc, m.addr_country AS vend_country, vendinfo.vend_curr_id, vendinfo.vend_taxzone_id FROM (((vendinfo LEFT JOIN cntct c1 ON ((vendinfo.vend_cntct1_id = c1.cntct_id))) LEFT JOIN addr m ON ((vendinfo.vend_addr_id = m.addr_id))) LEFT JOIN cntct c2 ON ((vendinfo.vend_cntct2_id = c2.cntct_id)));


ALTER TABLE public.vend OWNER TO admin;

--
-- TOC entry 833 (class 1259 OID 146570042)
-- Dependencies: 8
-- Name: vend_vend_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE vend_vend_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.vend_vend_id_seq OWNER TO admin;

--
-- TOC entry 834 (class 1259 OID 146570044)
-- Dependencies: 8595 8
-- Name: vendaddr; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW vendaddr AS
    SELECT vendaddrinfo.vendaddr_id, vendaddrinfo.vendaddr_vend_id, vendaddrinfo.vendaddr_code, vendaddrinfo.vendaddr_name, m.addr_line1 AS vendaddr_address1, m.addr_line2 AS vendaddr_address2, m.addr_line3 AS vendaddr_address3, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS vendaddr_contact1, c1.cntct_phone AS vendaddr_phone1, c1.cntct_fax AS vendaddr_fax1, m.addr_city AS vendaddr_city, m.addr_state AS vendaddr_state, m.addr_postalcode AS vendaddr_zipcode, m.addr_country AS vendaddr_country FROM ((vendaddrinfo LEFT JOIN cntct c1 ON ((vendaddrinfo.vendaddr_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((vendaddrinfo.vendaddr_addr_id = m.addr_id)));


ALTER TABLE public.vendaddr OWNER TO admin;

--
-- TOC entry 835 (class 1259 OID 146570049)
-- Dependencies: 8
-- Name: vendaddr_vendaddr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE vendaddr_vendaddr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.vendaddr_vendaddr_id_seq OWNER TO admin;

--
-- TOC entry 836 (class 1259 OID 146570051)
-- Dependencies: 393 8
-- Name: vendtype_vendtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE vendtype_vendtype_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.vendtype_vendtype_id_seq OWNER TO admin;

--
-- TOC entry 10330 (class 0 OID 0)
-- Dependencies: 836
-- Name: vendtype_vendtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE vendtype_vendtype_id_seq OWNED BY vendtype.vendtype_id;


--
-- TOC entry 837 (class 1259 OID 146570053)
-- Dependencies: 6682 6683 6684 6685 8
-- Name: vodist; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE vodist (
    vodist_id integer DEFAULT nextval(('"vodist_vodist_id_seq"'::text)::regclass) NOT NULL,
    vodist_poitem_id integer,
    vodist_vohead_id integer,
    vodist_costelem_id integer,
    vodist_accnt_id integer,
    vodist_amount numeric(18,6),
    vodist_qty numeric(18,6),
    vodist_expcat_id integer DEFAULT (-1),
    vodist_tax_id integer DEFAULT (-1),
    vodist_discountable boolean DEFAULT true NOT NULL,
    vodist_notes text
);


ALTER TABLE public.vodist OWNER TO admin;

--
-- TOC entry 10332 (class 0 OID 0)
-- Dependencies: 837
-- Name: TABLE vodist; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE vodist IS 'Voucher distribution information';


--
-- TOC entry 838 (class 1259 OID 146570063)
-- Dependencies: 8
-- Name: vodist_vodist_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE vodist_vodist_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.vodist_vodist_id_seq OWNER TO admin;

--
-- TOC entry 839 (class 1259 OID 146570065)
-- Dependencies: 6686 6687 6688 8
-- Name: vohead; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE vohead (
    vohead_id integer DEFAULT nextval(('vohead_vohead_id_seq'::text)::regclass) NOT NULL,
    vohead_number text NOT NULL,
    vohead_pohead_id integer,
    vohead_posted boolean,
    vohead_duedate date,
    vohead_invcnumber text,
    vohead_amount numeric(16,4),
    vohead_docdate date,
    vohead_1099 boolean,
    vohead_distdate date,
    vohead_reference text,
    vohead_terms_id integer,
    vohead_vend_id integer,
    vohead_curr_id integer DEFAULT basecurrid(),
    vohead_adjtaxtype_id integer,
    vohead_freighttaxtype_id integer,
    vohead_gldistdate date,
    vohead_misc boolean,
    vohead_taxzone_id integer,
    vohead_taxtype_id integer,
    vohead_notes text,
    vohead_recurring_vohead_id integer,
    CONSTRAINT vohead_vohead_number_check CHECK ((vohead_number <> ''::text))
);


ALTER TABLE public.vohead OWNER TO admin;

--
-- TOC entry 10335 (class 0 OID 0)
-- Dependencies: 839
-- Name: TABLE vohead; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE vohead IS 'Voucher header information';


--
-- TOC entry 840 (class 1259 OID 146570074)
-- Dependencies: 8
-- Name: vohead_vohead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE vohead_vohead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.vohead_vohead_id_seq OWNER TO admin;

--
-- TOC entry 841 (class 1259 OID 146570076)
-- Dependencies: 377 8
-- Name: voheadtax; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voheadtax (
)
INHERITS (taxhist);


ALTER TABLE public.voheadtax OWNER TO admin;

--
-- TOC entry 842 (class 1259 OID 146570082)
-- Dependencies: 6690 6691 8
-- Name: voitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voitem (
    voitem_id integer DEFAULT nextval(('"voitem_voitem_id_seq"'::text)::regclass) NOT NULL,
    voitem_vohead_id integer,
    voitem_poitem_id integer,
    voitem_close boolean,
    voitem_qty numeric(18,6),
    voitem_freight numeric(16,4) DEFAULT 0.0 NOT NULL,
    voitem_taxtype_id integer
);


ALTER TABLE public.voitem OWNER TO admin;

--
-- TOC entry 10339 (class 0 OID 0)
-- Dependencies: 842
-- Name: TABLE voitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE voitem IS 'Voucher Line Item information';


--
-- TOC entry 843 (class 1259 OID 146570087)
-- Dependencies: 8
-- Name: voitem_voitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE voitem_voitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.voitem_voitem_id_seq OWNER TO admin;

--
-- TOC entry 844 (class 1259 OID 146570089)
-- Dependencies: 377 8
-- Name: voitemtax; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voitemtax (
)
INHERITS (taxhist);


ALTER TABLE public.voitemtax OWNER TO admin;

--
-- TOC entry 845 (class 1259 OID 146570095)
-- Dependencies: 8596 8
-- Name: warehous; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW warehous AS
    SELECT whsinfo.warehous_id, whsinfo.warehous_code, whsinfo.warehous_descrip, m.addr_line1 AS warehous_addr1, m.addr_line2 AS warehous_addr2, m.addr_line3 AS warehous_addr3, m.addr_city AS warehous_addr4, m.addr_city AS warehous_city, m.addr_state AS warehous_state, m.addr_postalcode AS warehous_zip, m.addr_country AS warehous_country, whsinfo.warehous_fob, whsinfo.warehous_active, whsinfo.warehous_sitetype_id, whsinfo.warehous_counttag_prefix, whsinfo.warehous_counttag_number, whsinfo.warehous_bol_prefix, whsinfo.warehous_bol_number, whsinfo.warehous_shipping, whsinfo.warehous_useslips, whsinfo.warehous_usezones, whsinfo.warehous_aislesize, whsinfo.warehous_aislealpha, whsinfo.warehous_racksize, whsinfo.warehous_rackalpha, whsinfo.warehous_binsize, whsinfo.warehous_binalpha, whsinfo.warehous_locationsize, whsinfo.warehous_locationalpha, whsinfo.warehous_enforcearbl, whsinfo.warehous_default_accnt_id, whsinfo.warehous_shipping_commission FROM ((whsinfo LEFT JOIN cntct c1 ON ((whsinfo.warehous_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((whsinfo.warehous_addr_id = m.addr_id)));


ALTER TABLE public.warehous OWNER TO admin;

--
-- TOC entry 846 (class 1259 OID 146570100)
-- Dependencies: 8
-- Name: warehous_warehous_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE warehous_warehous_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.warehous_warehous_id_seq OWNER TO admin;

--
-- TOC entry 847 (class 1259 OID 146570102)
-- Dependencies: 343 8
-- Name: whsezone_whsezone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE whsezone_whsezone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.whsezone_whsezone_id_seq OWNER TO admin;

--
-- TOC entry 10345 (class 0 OID 0)
-- Dependencies: 847
-- Name: whsezone_whsezone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE whsezone_whsezone_id_seq OWNED BY whsezone.whsezone_id;


--
-- TOC entry 848 (class 1259 OID 146570104)
-- Dependencies: 8
-- Name: wo_wo_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE wo_wo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.wo_wo_id_seq OWNER TO admin;

--
-- TOC entry 849 (class 1259 OID 146570106)
-- Dependencies: 8
-- Name: womatl_womatl_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE womatl_womatl_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.womatl_womatl_id_seq OWNER TO admin;

--
-- TOC entry 850 (class 1259 OID 146570108)
-- Dependencies: 8
-- Name: womatlpost; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE womatlpost (
    womatlpost_id integer NOT NULL,
    womatlpost_womatl_id integer,
    womatlpost_invhist_id integer
);


ALTER TABLE public.womatlpost OWNER TO admin;

--
-- TOC entry 10349 (class 0 OID 0)
-- Dependencies: 850
-- Name: TABLE womatlpost; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE womatlpost IS 'Table to tie work order to work order material transactions for efficient queries';


--
-- TOC entry 851 (class 1259 OID 146570111)
-- Dependencies: 850 8
-- Name: womatlpost_womatlpost_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE womatlpost_womatlpost_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.womatlpost_womatlpost_id_seq OWNER TO admin;

--
-- TOC entry 10351 (class 0 OID 0)
-- Dependencies: 851
-- Name: womatlpost_womatlpost_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE womatlpost_womatlpost_id_seq OWNED BY womatlpost.womatlpost_id;


--
-- TOC entry 852 (class 1259 OID 146570113)
-- Dependencies: 6694 6695 8
-- Name: womatlvar; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE womatlvar (
    womatlvar_id integer DEFAULT nextval(('"womatlvar_womatlvar_id_seq"'::text)::regclass) NOT NULL,
    womatlvar_number integer,
    womatlvar_subnumber integer,
    womatlvar_posted date,
    womatlvar_parent_itemsite_id integer,
    womatlvar_component_itemsite_id integer,
    womatlvar_qtyord numeric(18,6),
    womatlvar_qtyrcv numeric(18,6),
    womatlvar_qtyiss numeric(18,6),
    womatlvar_qtyper numeric(18,6),
    womatlvar_scrap numeric(18,6),
    womatlvar_wipscrap numeric(18,6),
    womatlvar_bomitem_id integer,
    womatlvar_ref text,
    womatlvar_notes text,
    womatlvar_qtyfxd numeric(20,8) DEFAULT 0 NOT NULL
);


ALTER TABLE public.womatlvar OWNER TO admin;

--
-- TOC entry 10353 (class 0 OID 0)
-- Dependencies: 852
-- Name: TABLE womatlvar; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE womatlvar IS 'Work Order Material Requirements Variance information';


--
-- TOC entry 10354 (class 0 OID 0)
-- Dependencies: 852
-- Name: COLUMN womatlvar.womatlvar_qtyfxd; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN womatlvar.womatlvar_qtyfxd IS 'The fixed quantity required';


--
-- TOC entry 853 (class 1259 OID 146570121)
-- Dependencies: 8
-- Name: womatlvar_womatlvar_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE womatlvar_womatlvar_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.womatlvar_womatlvar_id_seq OWNER TO admin;

--
-- TOC entry 854 (class 1259 OID 146570123)
-- Dependencies: 8
-- Name: xcalitem_xcalitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE xcalitem_xcalitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.xcalitem_xcalitem_id_seq OWNER TO admin;

--
-- TOC entry 855 (class 1259 OID 146570125)
-- Dependencies: 6697 6698 6699 6700 8
-- Name: xsltmap; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE xsltmap (
    xsltmap_id integer NOT NULL,
    xsltmap_name text NOT NULL,
    xsltmap_doctype text NOT NULL,
    xsltmap_system text NOT NULL,
    xsltmap_import text NOT NULL,
    xsltmap_export text DEFAULT ''::text NOT NULL,
    CONSTRAINT xsltmap_check CHECK (((xsltmap_doctype <> ''::text) OR (xsltmap_system <> ''::text))),
    CONSTRAINT xsltmap_xsltmap_importexport_check CHECK (((xsltmap_import <> ''::text) OR (xsltmap_export <> ''::text))),
    CONSTRAINT xsltmap_xsltmap_name_check CHECK ((xsltmap_name <> ''::text))
);


ALTER TABLE public.xsltmap OWNER TO admin;

--
-- TOC entry 10358 (class 0 OID 0)
-- Dependencies: 855
-- Name: TABLE xsltmap; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE xsltmap IS 'Mapping of XML System identifiers to XSLT transformation files';


--
-- TOC entry 856 (class 1259 OID 146570135)
-- Dependencies: 855 8
-- Name: xsltmap_xsltmap_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE xsltmap_xsltmap_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.xsltmap_xsltmap_id_seq OWNER TO admin;

--
-- TOC entry 10360 (class 0 OID 0)
-- Dependencies: 856
-- Name: xsltmap_xsltmap_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE xsltmap_xsltmap_id_seq OWNED BY xsltmap.xsltmap_id;


--
-- TOC entry 857 (class 1259 OID 146570137)
-- Dependencies: 6702 8
-- Name: yearperiod; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE yearperiod (
    yearperiod_id integer NOT NULL,
    yearperiod_start date NOT NULL,
    yearperiod_end date NOT NULL,
    yearperiod_closed boolean DEFAULT false NOT NULL
);


ALTER TABLE public.yearperiod OWNER TO admin;

--
-- TOC entry 10362 (class 0 OID 0)
-- Dependencies: 857
-- Name: TABLE yearperiod; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE yearperiod IS 'Accounting Year Periods information';


--
-- TOC entry 858 (class 1259 OID 146570141)
-- Dependencies: 857 8
-- Name: yearperiod_yearperiod_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE yearperiod_yearperiod_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.yearperiod_yearperiod_id_seq OWNER TO admin;

--
-- TOC entry 10364 (class 0 OID 0)
-- Dependencies: 858
-- Name: yearperiod_yearperiod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE yearperiod_yearperiod_id_seq OWNED BY yearperiod.yearperiod_id;



--
-- TOC entry 859 (class 1259 OID 146570143)
-- Dependencies: 6703 397 9
-- Name: pkgcmd; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmd (
    cmd_id integer DEFAULT nextval('public.cmd_cmd_id_seq'::regclass)
)
INHERITS (public.cmd);


ALTER TABLE te.pkgcmd OWNER TO admin;

--
-- TOC entry 860 (class 1259 OID 146570150)
-- Dependencies: 6704 400 9
-- Name: pkgcmdarg; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmdarg (
    cmdarg_id integer DEFAULT nextval('public.cmdarg_cmdarg_id_seq'::regclass)
)
INHERITS (public.cmdarg);


ALTER TABLE te.pkgcmdarg OWNER TO admin;

--
-- TOC entry 861 (class 1259 OID 146570157)
-- Dependencies: 6705 248 9
-- Name: pkgimage; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgimage (
    image_id integer DEFAULT nextval('public.image_image_id_seq'::regclass)
)
INHERITS (public.image);


ALTER TABLE te.pkgimage OWNER TO admin;

--
-- TOC entry 862 (class 1259 OID 146570164)
-- Dependencies: 6706 405 9
-- Name: pkgmetasql; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgmetasql (
    metasql_id integer DEFAULT nextval('public.metasql_metasql_id_seq'::regclass)
)
INHERITS (public.metasql);


ALTER TABLE te.pkgmetasql OWNER TO admin;

--
-- TOC entry 863 (class 1259 OID 146570172)
-- Dependencies: 6708 408 9
-- Name: pkgpriv; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgpriv (
    priv_id integer DEFAULT nextval('public.priv_priv_id_seq'::regclass)
)
INHERITS (public.priv);


ALTER TABLE te.pkgpriv OWNER TO admin;

--
-- TOC entry 864 (class 1259 OID 146570179)
-- Dependencies: 6709 411 9
-- Name: pkgreport; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgreport (
    report_id integer DEFAULT nextval('public.report_report_id_seq'::regclass)
)
INHERITS (public.report);


ALTER TABLE te.pkgreport OWNER TO admin;

--
-- TOC entry 865 (class 1259 OID 146570186)
-- Dependencies: 6710 414 9
-- Name: pkgscript; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgscript (
    script_id integer DEFAULT nextval('public.script_script_id_seq'::regclass)
)
INHERITS (public.script);


ALTER TABLE te.pkgscript OWNER TO admin;

--
-- TOC entry 866 (class 1259 OID 146570194)
-- Dependencies: 6712 417 9
-- Name: pkguiform; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkguiform (
    uiform_id integer DEFAULT nextval('public.uiform_uiform_id_seq'::regclass)
)
INHERITS (public.uiform);


ALTER TABLE te.pkguiform OWNER TO admin;

--
-- TOC entry 867 (class 1259 OID 146570202)
-- Dependencies: 6715 9
-- Name: tecustrate; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE tecustrate (
    tecustrate_cust_id integer NOT NULL,
    tecustrate_rate numeric(16,4) NOT NULL,
    tecustrate_id integer NOT NULL,
    tecustrate_curr_id integer DEFAULT public.basecurrid() NOT NULL
);


ALTER TABLE te.tecustrate OWNER TO admin;

--
-- TOC entry 10374 (class 0 OID 0)
-- Dependencies: 867
-- Name: TABLE tecustrate; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE tecustrate IS 'Default Customer Billing rate for Time/Expense';


--
-- TOC entry 868 (class 1259 OID 146570206)
-- Dependencies: 867 9
-- Name: tecustrate_tecustrate_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE tecustrate_tecustrate_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.tecustrate_tecustrate_id_seq OWNER TO admin;

--
-- TOC entry 10376 (class 0 OID 0)
-- Dependencies: 868
-- Name: tecustrate_tecustrate_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE tecustrate_tecustrate_id_seq OWNED BY tecustrate.tecustrate_id;


--
-- TOC entry 869 (class 1259 OID 146570208)
-- Dependencies: 6717 9
-- Name: teemp; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teemp (
    teemp_id integer NOT NULL,
    teemp_emp_id integer,
    teemp_contractor boolean DEFAULT false
);


ALTER TABLE te.teemp OWNER TO admin;

--
-- TOC entry 870 (class 1259 OID 146570212)
-- Dependencies: 869 9
-- Name: teemp_teemp_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE teemp_teemp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.teemp_teemp_id_seq OWNER TO admin;

--
-- TOC entry 10378 (class 0 OID 0)
-- Dependencies: 870
-- Name: teemp_teemp_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teemp_teemp_id_seq OWNED BY teemp.teemp_id;


--
-- TOC entry 871 (class 1259 OID 146570214)
-- Dependencies: 9
-- Name: teexp; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teexp (
    teexp_id integer NOT NULL,
    teexp_expcat_id integer,
    teexp_accnt_id integer
);


ALTER TABLE te.teexp OWNER TO admin;

--
-- TOC entry 10380 (class 0 OID 0)
-- Dependencies: 871
-- Name: TABLE teexp; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teexp IS 'Expense/Item';


--
-- TOC entry 872 (class 1259 OID 146570217)
-- Dependencies: 9
-- Name: timesheet_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE timesheet_seq
    START WITH 1000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.timesheet_seq OWNER TO admin;

--
-- TOC entry 873 (class 1259 OID 146570219)
-- Dependencies: 6718 6719 6720 6721 6723 9
-- Name: tehead; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE tehead (
    tehead_id integer NOT NULL,
    tehead_number text DEFAULT nextval('timesheet_seq'::regclass),
    tehead_weekending date,
    tehead_lastupdated timestamp without time zone DEFAULT now() NOT NULL,
    tehead_notes text,
    tehead_status character(1) DEFAULT 'O'::bpchar NOT NULL,
    tehead_emp_id integer,
    tehead_warehous_id integer NOT NULL,
    tehead_username text DEFAULT "current_user"() NOT NULL,
    CONSTRAINT tehead_tehead_status_check CHECK ((tehead_status = ANY (ARRAY['O'::bpchar, 'A'::bpchar, 'C'::bpchar])))
);


ALTER TABLE te.tehead OWNER TO admin;

--
-- TOC entry 10383 (class 0 OID 0)
-- Dependencies: 873
-- Name: TABLE tehead; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE tehead IS 'time/expense header';


--
-- TOC entry 874 (class 1259 OID 146570230)
-- Dependencies: 873 9
-- Name: tehead_tehead_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE tehead_tehead_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.tehead_tehead_id_seq OWNER TO admin;

--
-- TOC entry 10385 (class 0 OID 0)
-- Dependencies: 874
-- Name: tehead_tehead_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE tehead_tehead_id_seq OWNED BY tehead.tehead_id;


--
-- TOC entry 875 (class 1259 OID 146570232)
-- Dependencies: 6724 6725 6726 6727 9
-- Name: teitem; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teitem (
    teitem_id integer NOT NULL,
    teitem_tehead_id integer,
    teitem_linenumber integer NOT NULL,
    teitem_type character(1) NOT NULL,
    teitem_workdate date,
    teitem_cust_id integer,
    teitem_vend_id integer,
    teitem_po text,
    teitem_item_id integer NOT NULL,
    teitem_qty numeric NOT NULL,
    teitem_rate numeric NOT NULL,
    teitem_total numeric NOT NULL,
    teitem_prjtask_id numeric,
    teitem_lastupdated timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
    teitem_billable boolean,
    teitem_prepaid boolean,
    teitem_notes text,
    teitem_posted boolean DEFAULT false,
    teitem_curr_id integer DEFAULT public.basecurrid() NOT NULL,
    teitem_uom_id integer,
    teitem_invcitem_id integer,
    teitem_vodist_id integer,
    teitem_postedvalue numeric DEFAULT 0 NOT NULL,
    teitem_empcost numeric
);


ALTER TABLE te.teitem OWNER TO admin;

--
-- TOC entry 10387 (class 0 OID 0)
-- Dependencies: 875
-- Name: TABLE teitem; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teitem IS 'time/expense detail';


--
-- TOC entry 10388 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN teitem.teitem_type; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_type IS 'T or E';


--
-- TOC entry 10389 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN teitem.teitem_vend_id; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_vend_id IS 'future use - for payment of vendor for expenses';


--
-- TOC entry 10390 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN teitem.teitem_prepaid; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_prepaid IS 'Used for expenses only.  CC paid expenses would be prepaid.';


--
-- TOC entry 876 (class 1259 OID 146570242)
-- Dependencies: 875 9
-- Name: teitem_teitem_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE teitem_teitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.teitem_teitem_id_seq OWNER TO admin;

--
-- TOC entry 10392 (class 0 OID 0)
-- Dependencies: 876
-- Name: teitem_teitem_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teitem_teitem_id_seq OWNED BY teitem.teitem_id;


--
-- TOC entry 877 (class 1259 OID 146570244)
-- Dependencies: 9
-- Name: teprj; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teprj (
    teprj_id integer NOT NULL,
    teprj_prj_id integer,
    teprj_cust_id integer,
    teprj_rate numeric,
    teprj_curr_id integer
);


ALTER TABLE te.teprj OWNER TO admin;

--
-- TOC entry 10394 (class 0 OID 0)
-- Dependencies: 877
-- Name: TABLE teprj; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teprj IS 't/e information for projects';


--
-- TOC entry 878 (class 1259 OID 146570250)
-- Dependencies: 877 9
-- Name: teprj_teprj_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE teprj_teprj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.teprj_teprj_id_seq OWNER TO admin;

--
-- TOC entry 10396 (class 0 OID 0)
-- Dependencies: 878
-- Name: teprj_teprj_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teprj_teprj_id_seq OWNED BY teprj.teprj_id;


--
-- TOC entry 879 (class 1259 OID 146570252)
-- Dependencies: 6731 9
-- Name: teprjtask; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teprjtask (
    teprjtask_id integer NOT NULL,
    teprjtask_cust_id integer,
    teprjtask_rate numeric,
    teprjtask_item_id integer,
    teprjtask_prjtask_id integer,
    teprjtask_curr_id integer DEFAULT public.basecurrid()
);


ALTER TABLE te.teprjtask OWNER TO admin;

--
-- TOC entry 10398 (class 0 OID 0)
-- Dependencies: 879
-- Name: TABLE teprjtask; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teprjtask IS 't/e information for tasks';


--
-- TOC entry 880 (class 1259 OID 146570259)
-- Dependencies: 879 9
-- Name: teprjtask_teprjtask_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

CREATE SEQUENCE teprjtask_teprjtask_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE te.teprjtask_teprjtask_id_seq OWNER TO admin;

--
-- TOC entry 10400 (class 0 OID 0)
-- Dependencies: 880
-- Name: teprjtask_teprjtask_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teprjtask_teprjtask_id_seq OWNED BY teprjtask.teprjtask_id;



--
-- TOC entry 881 (class 1259 OID 146570261)
-- Dependencies: 6732 397 10
-- Name: pkgcmd; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmd (
    cmd_id integer DEFAULT nextval('public.cmd_cmd_id_seq'::regclass)
)
INHERITS (public.cmd);


ALTER TABLE xtdesktop.pkgcmd OWNER TO admin;

--
-- TOC entry 882 (class 1259 OID 146570268)
-- Dependencies: 6733 400 10
-- Name: pkgcmdarg; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmdarg (
    cmdarg_id integer DEFAULT nextval('public.cmdarg_cmdarg_id_seq'::regclass)
)
INHERITS (public.cmdarg);


ALTER TABLE xtdesktop.pkgcmdarg OWNER TO admin;

--
-- TOC entry 883 (class 1259 OID 146570275)
-- Dependencies: 6734 248 10
-- Name: pkgimage; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgimage (
    image_id integer DEFAULT nextval('public.image_image_id_seq'::regclass)
)
INHERITS (public.image);


ALTER TABLE xtdesktop.pkgimage OWNER TO admin;

--
-- TOC entry 884 (class 1259 OID 146570282)
-- Dependencies: 6735 405 10
-- Name: pkgmetasql; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgmetasql (
    metasql_id integer DEFAULT nextval('public.metasql_metasql_id_seq'::regclass)
)
INHERITS (public.metasql);


ALTER TABLE xtdesktop.pkgmetasql OWNER TO admin;

--
-- TOC entry 885 (class 1259 OID 146570290)
-- Dependencies: 6737 408 10
-- Name: pkgpriv; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgpriv (
    priv_id integer DEFAULT nextval('public.priv_priv_id_seq'::regclass)
)
INHERITS (public.priv);


ALTER TABLE xtdesktop.pkgpriv OWNER TO admin;

--
-- TOC entry 886 (class 1259 OID 146570297)
-- Dependencies: 6738 411 10
-- Name: pkgreport; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgreport (
    report_id integer DEFAULT nextval('public.report_report_id_seq'::regclass)
)
INHERITS (public.report);


ALTER TABLE xtdesktop.pkgreport OWNER TO admin;

--
-- TOC entry 887 (class 1259 OID 146570304)
-- Dependencies: 6739 414 10
-- Name: pkgscript; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgscript (
    script_id integer DEFAULT nextval('public.script_script_id_seq'::regclass)
)
INHERITS (public.script);


ALTER TABLE xtdesktop.pkgscript OWNER TO admin;

--
-- TOC entry 888 (class 1259 OID 146570312)
-- Dependencies: 6741 417 10
-- Name: pkguiform; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkguiform (
    uiform_id integer DEFAULT nextval('public.uiform_uiform_id_seq'::regclass)
)
INHERITS (public.uiform);


ALTER TABLE xtdesktop.pkguiform OWNER TO admin;


--
-- TOC entry 6273 (class 2604 OID 146568264)
-- Dependencies: 407 407
-- Name: metasql_grade; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- TOC entry 6281 (class 2604 OID 146568314)
-- Dependencies: 416 416
-- Name: script_enabled; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- TOC entry 6285 (class 2604 OID 146568332)
-- Dependencies: 419 419
-- Name: uiform_enabled; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;



--
-- TOC entry 6055 (class 2604 OID 146570320)
-- Dependencies: 422 234
-- Name: addr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY addr ALTER COLUMN addr_id SET DEFAULT nextval('addr_addr_id_seq'::regclass);


--
-- TOC entry 6290 (class 2604 OID 146570321)
-- Dependencies: 425 424
-- Name: alarm_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY alarm ALTER COLUMN alarm_id SET DEFAULT nextval('alarm_alarm_id_seq'::regclass);


--
-- TOC entry 6291 (class 2604 OID 146570322)
-- Dependencies: 427 426
-- Name: apaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apaccnt ALTER COLUMN apaccnt_id SET DEFAULT nextval('apaccnt_apaccnt_id_seq'::regclass);


--
-- TOC entry 6292 (class 2604 OID 146570323)
-- Dependencies: 429 428
-- Name: apapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apapply ALTER COLUMN apapply_id SET DEFAULT nextval('apapply_apapply_id_seq'::regclass);


--
-- TOC entry 6310 (class 2604 OID 146570324)
-- Dependencies: 435 434
-- Name: apcreditapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apcreditapply ALTER COLUMN apcreditapply_id SET DEFAULT nextval('apcreditapply_apcreditapply_id_seq'::regclass);


--
-- TOC entry 6312 (class 2604 OID 146570448)
-- Dependencies: 438 378 438
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6313 (class 2604 OID 146570325)
-- Dependencies: 440 439
-- Name: apselect_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apselect ALTER COLUMN apselect_id SET DEFAULT nextval('apselect_apselect_id_seq'::regclass);


--
-- TOC entry 6317 (class 2604 OID 146570326)
-- Dependencies: 444 443
-- Name: arapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY arapply ALTER COLUMN arapply_id SET DEFAULT nextval('arapply_arapply_id_seq'::regclass);


--
-- TOC entry 6321 (class 2604 OID 146570449)
-- Dependencies: 450 378 450
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6322 (class 2604 OID 146570327)
-- Dependencies: 452 451
-- Name: asohist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohist ALTER COLUMN asohist_id SET DEFAULT nextval('asohist_asohist_id_seq'::regclass);


--
-- TOC entry 6324 (class 2604 OID 146570450)
-- Dependencies: 453 378 453
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6325 (class 2604 OID 146570328)
-- Dependencies: 455 454
-- Name: atlasmap_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY atlasmap ALTER COLUMN atlasmap_id SET DEFAULT nextval('atlasmap_atlasmap_id_seq'::regclass);


--
-- TOC entry 6107 (class 2604 OID 146570329)
-- Dependencies: 457 266
-- Name: bankaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankaccnt ALTER COLUMN bankaccnt_id SET DEFAULT nextval('bankaccnt_bankaccnt_id_seq'::regclass);


--
-- TOC entry 6332 (class 2604 OID 146570330)
-- Dependencies: 459 458
-- Name: bankadj_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankadj ALTER COLUMN bankadj_id SET DEFAULT nextval('bankadj_bankadj_id_seq'::regclass);


--
-- TOC entry 6333 (class 2604 OID 146570331)
-- Dependencies: 461 460
-- Name: bankadjtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankadjtype ALTER COLUMN bankadjtype_id SET DEFAULT nextval('bankadjtype_bankadjtype_id_seq'::regclass);


--
-- TOC entry 6339 (class 2604 OID 146570332)
-- Dependencies: 463 462
-- Name: bankrec_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankrec ALTER COLUMN bankrec_id SET DEFAULT nextval('bankrec_bankrec_id_seq'::regclass);


--
-- TOC entry 6340 (class 2604 OID 146570333)
-- Dependencies: 465 464
-- Name: bankrecitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankrecitem ALTER COLUMN bankrecitem_id SET DEFAULT nextval('bankrecitem_bankrecitem_id_seq'::regclass);


--
-- TOC entry 6346 (class 2604 OID 146570334)
-- Dependencies: 469 468
-- Name: bomitemcost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemcost ALTER COLUMN bomitemcost_id SET DEFAULT nextval('bomitemcost_bomitemcost_id_seq'::regclass);


--
-- TOC entry 6092 (class 2604 OID 146570335)
-- Dependencies: 470 258
-- Name: bomitemsub_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemsub ALTER COLUMN bomitemsub_id SET DEFAULT nextval('bomitemsub_bomitemsub_id_seq'::regclass);


--
-- TOC entry 6347 (class 2604 OID 146570336)
-- Dependencies: 472 471
-- Name: bomwork_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomwork ALTER COLUMN bomwork_id SET DEFAULT nextval('bomwork_bomwork_id_seq'::regclass);


--
-- TOC entry 6093 (class 2604 OID 146570337)
-- Dependencies: 474 260
-- Name: budghead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budghead ALTER COLUMN budghead_id SET DEFAULT nextval('budghead_budghead_id_seq'::regclass);


--
-- TOC entry 6099 (class 2604 OID 146570338)
-- Dependencies: 475 263
-- Name: budgitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budgitem ALTER COLUMN budgitem_id SET DEFAULT nextval('budgitem_budgitem_id_seq'::regclass);


--
-- TOC entry 6116 (class 2604 OID 146570339)
-- Dependencies: 479 267
-- Name: cashrcpt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcpt ALTER COLUMN cashrcpt_id SET DEFAULT nextval('cashrcpt_cashrcpt_id_seq'::regclass);


--
-- TOC entry 6118 (class 2604 OID 146570340)
-- Dependencies: 445 269
-- Name: cashrcptitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptitem ALTER COLUMN cashrcptitem_id SET DEFAULT nextval('cashrcptitem_cashrcptitem_id_seq'::regclass);


--
-- TOC entry 6121 (class 2604 OID 146570341)
-- Dependencies: 480 271
-- Name: cashrcptmisc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptmisc ALTER COLUMN cashrcptmisc_id SET DEFAULT nextval('cashrcptmisc_cashrcptmisc_id_seq'::regclass);


--
-- TOC entry 6129 (class 2604 OID 146570342)
-- Dependencies: 481 278
-- Name: ccard_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccard ALTER COLUMN ccard_id SET DEFAULT nextval('ccard_ccard_id_seq'::regclass);


--
-- TOC entry 6352 (class 2604 OID 146570343)
-- Dependencies: 483 482
-- Name: ccardaud_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccardaud ALTER COLUMN ccardaud_id SET DEFAULT nextval('ccardaud_ccardaud_id_seq'::regclass);


--
-- TOC entry 6355 (class 2604 OID 146570344)
-- Dependencies: 485 484
-- Name: ccbank_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccbank ALTER COLUMN ccbank_id SET DEFAULT nextval('ccbank_ccbank_id_seq'::regclass);


--
-- TOC entry 6362 (class 2604 OID 146570345)
-- Dependencies: 487 486
-- Name: ccpay_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccpay ALTER COLUMN ccpay_id SET DEFAULT nextval('ccpay_ccpay_id_seq'::regclass);


--
-- TOC entry 6070 (class 2604 OID 146570346)
-- Dependencies: 488 236
-- Name: char_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY "char" ALTER COLUMN char_id SET DEFAULT nextval('char_char_id_seq'::regclass);


--
-- TOC entry 6072 (class 2604 OID 146570347)
-- Dependencies: 489 237
-- Name: charass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charass ALTER COLUMN charass_id SET DEFAULT nextval('charass_charass_id_seq'::regclass);


--
-- TOC entry 6363 (class 2604 OID 146570348)
-- Dependencies: 491 490
-- Name: charopt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charopt ALTER COLUMN charopt_id SET DEFAULT nextval('charopt_charopt_id_seq'::regclass);


--
-- TOC entry 6302 (class 2604 OID 146570349)
-- Dependencies: 492 430
-- Name: checkhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkhead ALTER COLUMN checkhead_id SET DEFAULT nextval('checkhead_checkhead_id_seq'::regclass);


--
-- TOC entry 6308 (class 2604 OID 146570350)
-- Dependencies: 493 432
-- Name: checkitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem ALTER COLUMN checkitem_id SET DEFAULT nextval('checkitem_checkitem_id_seq'::regclass);


--
-- TOC entry 6265 (class 2604 OID 146568218)
-- Dependencies: 398 397
-- Name: cmd_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmd ALTER COLUMN cmd_id SET DEFAULT nextval('cmd_cmd_id_seq'::regclass);


--
-- TOC entry 6267 (class 2604 OID 146568234)
-- Dependencies: 401 400
-- Name: cmdarg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmdarg ALTER COLUMN cmdarg_id SET DEFAULT nextval('cmdarg_cmdarg_id_seq'::regclass);


--
-- TOC entry 6365 (class 2604 OID 146570451)
-- Dependencies: 497 378 497
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6366 (class 2604 OID 146570452)
-- Dependencies: 499 378 499
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6075 (class 2604 OID 146570351)
-- Dependencies: 500 239
-- Name: cmnttype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttype ALTER COLUMN cmnttype_id SET DEFAULT nextval('cmnttype_cmnttype_id_seq'::regclass);


--
-- TOC entry 6367 (class 2604 OID 146570352)
-- Dependencies: 502 501
-- Name: cmnttypesource_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttypesource ALTER COLUMN cmnttypesource_id SET DEFAULT nextval('cmnttypesource_cmnttypesource_id_seq'::regclass);


--
-- TOC entry 5944 (class 2604 OID 146570353)
-- Dependencies: 503 204
-- Name: cntct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntct ALTER COLUMN cntct_id SET DEFAULT nextval('cntct_cntct_id_seq'::regclass);


--
-- TOC entry 6368 (class 2604 OID 146570354)
-- Dependencies: 505 504
-- Name: cntctaddr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctaddr ALTER COLUMN cntctaddr_id SET DEFAULT nextval('cntctaddr_cntctaddr_id_seq'::regclass);


--
-- TOC entry 6369 (class 2604 OID 146570355)
-- Dependencies: 507 506
-- Name: cntctdata_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctdata ALTER COLUMN cntctdata_id SET DEFAULT nextval('cntctdata_cntctdata_id_seq'::regclass);


--
-- TOC entry 6370 (class 2604 OID 146570356)
-- Dependencies: 509 508
-- Name: cntcteml_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntcteml ALTER COLUMN cntcteml_id SET DEFAULT nextval('cntcteml_cntcteml_id_seq'::regclass);


--
-- TOC entry 6390 (class 2604 OID 146570453)
-- Dependencies: 515 378 515
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6393 (class 2604 OID 146570454)
-- Dependencies: 518 378 518
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6258 (class 2604 OID 146570447)
-- Dependencies: 379 378 379
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6394 (class 2604 OID 146570357)
-- Dependencies: 524 523
-- Name: company_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company ALTER COLUMN company_id SET DEFAULT nextval('company_company_id_seq'::regclass);


--
-- TOC entry 6193 (class 2604 OID 146570358)
-- Dependencies: 525 329
-- Name: contrct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY contrct ALTER COLUMN contrct_id SET DEFAULT nextval('contrct_contrct_id_seq'::regclass);


--
-- TOC entry 6411 (class 2604 OID 146570359)
-- Dependencies: 539 538
-- Name: country_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY country ALTER COLUMN country_id SET DEFAULT nextval('country_country_id_seq'::regclass);


--
-- TOC entry 5946 (class 2604 OID 146570360)
-- Dependencies: 543 205
-- Name: crmacct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct ALTER COLUMN crmacct_id SET DEFAULT nextval('crmacct_crmacct_id_seq'::regclass);


--
-- TOC entry 6433 (class 2604 OID 146570361)
-- Dependencies: 546 545
-- Name: curr_rate_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY curr_rate ALTER COLUMN curr_rate_id SET DEFAULT nextval('curr_rate_curr_rate_id_seq'::regclass);


--
-- TOC entry 5965 (class 2604 OID 146570362)
-- Dependencies: 547 208
-- Name: curr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY curr_symbol ALTER COLUMN curr_id SET DEFAULT nextval('curr_symbol_curr_id_seq'::regclass);


--
-- TOC entry 6144 (class 2604 OID 146570363)
-- Dependencies: 557 291
-- Name: dept_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY dept ALTER COLUMN dept_id SET DEFAULT nextval('dept_dept_id_seq'::regclass);


--
-- TOC entry 6080 (class 2604 OID 146570364)
-- Dependencies: 247 242
-- Name: docass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY docass ALTER COLUMN docass_id SET DEFAULT nextval('docass_docass_id_seq'::regclass);


--
-- TOC entry 6149 (class 2604 OID 146570365)
-- Dependencies: 562 292
-- Name: emp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp ALTER COLUMN emp_id SET DEFAULT nextval('emp_emp_id_seq'::regclass);


--
-- TOC entry 6449 (class 2604 OID 146570366)
-- Dependencies: 564 563
-- Name: empgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrp ALTER COLUMN empgrp_id SET DEFAULT nextval('empgrp_empgrp_id_seq'::regclass);


--
-- TOC entry 6451 (class 2604 OID 146570367)
-- Dependencies: 566 565
-- Name: empgrpitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrpitem ALTER COLUMN empgrpitem_id SET DEFAULT nextval('empgrpitem_empgrpitem_id_seq'::regclass);


--
-- TOC entry 6228 (class 2604 OID 146570368)
-- Dependencies: 573 358
-- Name: expcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY expcat ALTER COLUMN expcat_id SET DEFAULT nextval('expcat_expcat_id_seq'::regclass);


--
-- TOC entry 6084 (class 2604 OID 146570369)
-- Dependencies: 574 243
-- Name: file_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY file ALTER COLUMN file_id SET DEFAULT nextval('file_file_id_seq'::regclass);


--
-- TOC entry 6456 (class 2604 OID 146570370)
-- Dependencies: 576 575
-- Name: filter_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY filter ALTER COLUMN filter_id SET DEFAULT nextval('filter_filter_id_seq'::regclass);


--
-- TOC entry 6458 (class 2604 OID 146570371)
-- Dependencies: 578 577
-- Name: fincharg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY fincharg ALTER COLUMN fincharg_id SET DEFAULT nextval('fincharg_fincharg_id_seq'::regclass);


--
-- TOC entry 6491 (class 2604 OID 146570372)
-- Dependencies: 583 582
-- Name: flcol_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flcol ALTER COLUMN flcol_id SET DEFAULT nextval('flcol_flcol_id_seq'::regclass);


--
-- TOC entry 6509 (class 2604 OID 146570373)
-- Dependencies: 585 584
-- Name: flgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flgrp ALTER COLUMN flgrp_id SET DEFAULT nextval('flgrp_flgrp_id_seq'::regclass);


--
-- TOC entry 6477 (class 2604 OID 146570374)
-- Dependencies: 586 579
-- Name: flhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flhead ALTER COLUMN flhead_id SET DEFAULT nextval('flhead_flhead_id_seq'::regclass);


--
-- TOC entry 6490 (class 2604 OID 146570375)
-- Dependencies: 587 580
-- Name: flitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flitem ALTER COLUMN flitem_id SET DEFAULT nextval('flitem_flitem_id_seq'::regclass);


--
-- TOC entry 6510 (class 2604 OID 146570376)
-- Dependencies: 589 588
-- Name: flnotes_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flnotes ALTER COLUMN flnotes_id SET DEFAULT nextval('flnotes_flnotes_id_seq'::regclass);


--
-- TOC entry 6512 (class 2604 OID 146570377)
-- Dependencies: 591 590
-- Name: flrpt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flrpt ALTER COLUMN flrpt_id SET DEFAULT nextval('flrpt_flrpt_id_seq'::regclass);


--
-- TOC entry 6527 (class 2604 OID 146570378)
-- Dependencies: 593 592
-- Name: flspec_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flspec ALTER COLUMN flspec_id SET DEFAULT nextval('flspec_flspec_id_seq'::regclass);


--
-- TOC entry 6160 (class 2604 OID 146570379)
-- Dependencies: 596 299
-- Name: freightclass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY freightclass ALTER COLUMN freightclass_id SET DEFAULT nextval('freightclass_freightclass_id_seq'::regclass);


--
-- TOC entry 6531 (class 2604 OID 146570380)
-- Dependencies: 602 601
-- Name: grp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY grp ALTER COLUMN grp_id SET DEFAULT nextval('grp_grp_id_seq'::regclass);


--
-- TOC entry 6533 (class 2604 OID 146570381)
-- Dependencies: 604 603
-- Name: grppriv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY grppriv ALTER COLUMN grppriv_id SET DEFAULT nextval('grppriv_grppriv_id_seq'::regclass);


--
-- TOC entry 6534 (class 2604 OID 146570382)
-- Dependencies: 606 605
-- Name: hnfc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY hnfc ALTER COLUMN hnfc_id SET DEFAULT nextval('hnfc_hnfc_id_seq'::regclass);


--
-- TOC entry 5955 (class 2604 OID 146570383)
-- Dependencies: 607 206
-- Name: incdt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt ALTER COLUMN incdt_id SET DEFAULT nextval('incdt_incdt_id_seq'::regclass);


--
-- TOC entry 6168 (class 2604 OID 146570384)
-- Dependencies: 608 304
-- Name: incdtcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtcat ALTER COLUMN incdtcat_id SET DEFAULT nextval('incdtcat_incdtcat_id_seq'::regclass);


--
-- TOC entry 6536 (class 2604 OID 146570385)
-- Dependencies: 610 609
-- Name: incdthist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdthist ALTER COLUMN incdthist_id SET DEFAULT nextval('incdthist_incdthist_id_seq'::regclass);


--
-- TOC entry 6170 (class 2604 OID 146570386)
-- Dependencies: 611 305
-- Name: incdtpriority_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtpriority ALTER COLUMN incdtpriority_id SET DEFAULT nextval('incdtpriority_incdtpriority_id_seq'::regclass);


--
-- TOC entry 6172 (class 2604 OID 146570387)
-- Dependencies: 612 306
-- Name: incdtresolution_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtresolution ALTER COLUMN incdtresolution_id SET DEFAULT nextval('incdtresolution_incdtresolution_id_seq'::regclass);


--
-- TOC entry 6174 (class 2604 OID 146570388)
-- Dependencies: 613 307
-- Name: incdtseverity_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtseverity ALTER COLUMN incdtseverity_id SET DEFAULT nextval('incdtseverity_incdtseverity_id_seq'::regclass);


--
-- TOC entry 5935 (class 2604 OID 146570389)
-- Dependencies: 614 202
-- Name: invbal_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invbal ALTER COLUMN invbal_id SET DEFAULT nextval('invbal_invbal_id_seq'::regclass);


--
-- TOC entry 6025 (class 2604 OID 146570390)
-- Dependencies: 616 224
-- Name: invchead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead ALTER COLUMN invchead_id SET DEFAULT nextval('invchead_invchead_id_seq'::regclass);


--
-- TOC entry 6539 (class 2604 OID 146570455)
-- Dependencies: 617 378 617
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6034 (class 2604 OID 146570391)
-- Dependencies: 618 229
-- Name: invcitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem ALTER COLUMN invcitem_id SET DEFAULT nextval('invcitem_invcitem_id_seq'::regclass);


--
-- TOC entry 6540 (class 2604 OID 146570456)
-- Dependencies: 619 378 619
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6549 (class 2604 OID 146570392)
-- Dependencies: 626 625
-- Name: invhistexpcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invhistexpcat ALTER COLUMN invhistexpcat_id SET DEFAULT nextval('invhistexpcat_invhistexpcat_id_seq'::regclass);


--
-- TOC entry 6217 (class 2604 OID 146570393)
-- Dependencies: 628 347
-- Name: ipsass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsass ALTER COLUMN ipsass_id SET DEFAULT nextval('ipsass_ipsass_id_seq'::regclass);


--
-- TOC entry 6162 (class 2604 OID 146570394)
-- Dependencies: 631 300
-- Name: ipsfreight_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight ALTER COLUMN ipsfreight_id SET DEFAULT nextval('ipsfreight_ipsfreight_id_seq'::regclass);


--
-- TOC entry 6223 (class 2604 OID 146570395)
-- Dependencies: 634 351
-- Name: ipsitemchar_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsitemchar ALTER COLUMN ipsitemchar_id SET DEFAULT nextval('ipsitemchar_ipsitemchar_id_seq'::regclass);


--
-- TOC entry 6550 (class 2604 OID 146570396)
-- Dependencies: 637 636
-- Name: ipsprodcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsprodcat_bak ALTER COLUMN ipsprodcat_id SET DEFAULT nextval('ipsprodcat_ipsprodcat_id_seq'::regclass);


--
-- TOC entry 6562 (class 2604 OID 146570397)
-- Dependencies: 655 654
-- Name: itemlocpost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemlocpost ALTER COLUMN itemlocpost_id SET DEFAULT nextval('itemlocpost_itemlocpost_id_seq'::regclass);


--
-- TOC entry 6207 (class 2604 OID 146570398)
-- Dependencies: 661 336
-- Name: itemtax_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtax ALTER COLUMN itemtax_id SET DEFAULT nextval('itemtax_itemtax_id_seq'::regclass);


--
-- TOC entry 6563 (class 2604 OID 146570399)
-- Dependencies: 663 662
-- Name: itemtrans_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtrans ALTER COLUMN itemtrans_id SET DEFAULT nextval('itemtrans_itemtrans_id_seq'::regclass);


--
-- TOC entry 6564 (class 2604 OID 146570400)
-- Dependencies: 665 664
-- Name: itemuom_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuom ALTER COLUMN itemuom_id SET DEFAULT nextval('itemuom_itemuom_id_seq'::regclass);


--
-- TOC entry 6208 (class 2604 OID 146570401)
-- Dependencies: 666 338
-- Name: itemuomconv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuomconv ALTER COLUMN itemuomconv_id SET DEFAULT nextval('itemuomconv_itemuomconv_id_seq'::regclass);


--
-- TOC entry 6566 (class 2604 OID 146570402)
-- Dependencies: 671 670
-- Name: labeldef_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY labeldef ALTER COLUMN labeldef_id SET DEFAULT nextval('labeldef_labeldef_id_seq'::regclass);


--
-- TOC entry 6569 (class 2604 OID 146570403)
-- Dependencies: 675 674
-- Name: lang_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY lang ALTER COLUMN lang_id SET DEFAULT nextval('lang_lang_id_seq'::regclass);


--
-- TOC entry 6270 (class 2604 OID 146568260)
-- Dependencies: 406 405
-- Name: metasql_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY metasql ALTER COLUMN metasql_id SET DEFAULT nextval('metasql_metasql_id_seq'::regclass);


--
-- TOC entry 6577 (class 2604 OID 146570404)
-- Dependencies: 685 684
-- Name: metricenc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY metricenc ALTER COLUMN metricenc_id SET DEFAULT nextval('metricenc_metricenc_id_seq'::regclass);


--
-- TOC entry 6037 (class 2604 OID 146570405)
-- Dependencies: 695 231
-- Name: ophead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead ALTER COLUMN ophead_id SET DEFAULT nextval('ophead_ophead_id_seq'::regclass);


--
-- TOC entry 6584 (class 2604 OID 146570406)
-- Dependencies: 697 696
-- Name: opsource_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY opsource ALTER COLUMN opsource_id SET DEFAULT nextval('opsource_opsource_id_seq'::regclass);


--
-- TOC entry 6586 (class 2604 OID 146570407)
-- Dependencies: 699 698
-- Name: opstage_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY opstage ALTER COLUMN opstage_id SET DEFAULT nextval('opstage_opstage_id_seq'::regclass);


--
-- TOC entry 6590 (class 2604 OID 146570408)
-- Dependencies: 701 700
-- Name: optype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY optype ALTER COLUMN optype_id SET DEFAULT nextval('optype_optype_id_seq'::regclass);


--
-- TOC entry 6594 (class 2604 OID 146570409)
-- Dependencies: 707 706
-- Name: pack_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pack ALTER COLUMN pack_id SET DEFAULT nextval('pack_pack_id_seq'::regclass);


--
-- TOC entry 6100 (class 2604 OID 146570410)
-- Dependencies: 710 264
-- Name: period_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY period ALTER COLUMN period_id SET DEFAULT nextval('period_period_id_seq'::regclass);


--
-- TOC entry 6601 (class 2604 OID 146570411)
-- Dependencies: 712 711
-- Name: pkgdep_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgdep ALTER COLUMN pkgdep_id SET DEFAULT nextval('pkgdep_pkgdep_id_seq'::regclass);


--
-- TOC entry 6602 (class 2604 OID 146570412)
-- Dependencies: 714 713
-- Name: pkghead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkghead ALTER COLUMN pkghead_id SET DEFAULT nextval('pkghead_pkghead_id_seq'::regclass);


--
-- TOC entry 6605 (class 2604 OID 146570413)
-- Dependencies: 716 715
-- Name: pkgitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgitem ALTER COLUMN pkgitem_id SET DEFAULT nextval('pkgitem_pkgitem_id_seq'::regclass);


--
-- TOC entry 6613 (class 2604 OID 146570414)
-- Dependencies: 727 726
-- Name: potype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY potype ALTER COLUMN potype_id SET DEFAULT nextval('potype_potype_id_seq'::regclass);


--
-- TOC entry 6616 (class 2604 OID 146570415)
-- Dependencies: 731 730
-- Name: prftcntr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prftcntr ALTER COLUMN prftcntr_id SET DEFAULT nextval('prftcntr_prftcntr_id_seq'::regclass);


--
-- TOC entry 6027 (class 2604 OID 146570416)
-- Dependencies: 735 225
-- Name: prj_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj ALTER COLUMN prj_id SET DEFAULT nextval('prj_prj_id_seq'::regclass);


--
-- TOC entry 6040 (class 2604 OID 146570417)
-- Dependencies: 736 232
-- Name: prjtask_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtask ALTER COLUMN prjtask_id SET DEFAULT nextval('prjtask_prjtask_id_seq'::regclass);


--
-- TOC entry 6620 (class 2604 OID 146570418)
-- Dependencies: 738 737
-- Name: prjtaskuser_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtaskuser ALTER COLUMN prjtaskuser_id SET DEFAULT nextval('prjtaskuser_prjtaskuser_id_seq'::regclass);


--
-- TOC entry 6621 (class 2604 OID 146570419)
-- Dependencies: 740 739
-- Name: prjtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtype ALTER COLUMN prjtype_id SET DEFAULT nextval('prjtype_prjtype_id_seq'::regclass);


--
-- TOC entry 6623 (class 2604 OID 146570420)
-- Dependencies: 743 742
-- Name: qryhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY qryhead ALTER COLUMN qryhead_id SET DEFAULT nextval('qryhead_qryhead_id_seq'::regclass);


--
-- TOC entry 6630 (class 2604 OID 146570421)
-- Dependencies: 745 744
-- Name: qryitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY qryitem ALTER COLUMN qryitem_id SET DEFAULT nextval('qryitem_qryitem_id_seq'::regclass);


--
-- TOC entry 6634 (class 2604 OID 146570422)
-- Dependencies: 750 749
-- Name: recur_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recur ALTER COLUMN recur_id SET DEFAULT nextval('recur_recur_id_seq'::regclass);


--
-- TOC entry 6638 (class 2604 OID 146570423)
-- Dependencies: 752 751
-- Name: recurtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recurtype ALTER COLUMN recurtype_id SET DEFAULT nextval('recurtype_recurtype_id_seq'::regclass);


--
-- TOC entry 6610 (class 2604 OID 146570424)
-- Dependencies: 753 721
-- Name: recv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv ALTER COLUMN recv_id SET DEFAULT nextval('recv_recv_id_seq'::regclass);


--
-- TOC entry 6006 (class 2604 OID 146570425)
-- Dependencies: 757 214
-- Name: rsncode_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY rsncode ALTER COLUMN rsncode_id SET DEFAULT nextval('rsncode_rsncode_id_seq'::regclass);


--
-- TOC entry 6008 (class 2604 OID 146570426)
-- Dependencies: 761 215
-- Name: salescat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY salescat ALTER COLUMN salescat_id SET DEFAULT nextval('salescat_salescat_id_seq'::regclass);


--
-- TOC entry 6030 (class 2604 OID 146570427)
-- Dependencies: 765 226
-- Name: saletype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY saletype ALTER COLUMN saletype_id SET DEFAULT nextval('saletype_saletype_id_seq'::regclass);


--
-- TOC entry 6643 (class 2604 OID 146570428)
-- Dependencies: 767 766
-- Name: schemaord_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY schemaord ALTER COLUMN schemaord_id SET DEFAULT nextval('schemaord_schemaord_id_seq'::regclass);


--
-- TOC entry 6278 (class 2604 OID 146568310)
-- Dependencies: 415 414
-- Name: script_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY script ALTER COLUMN script_id SET DEFAULT nextval('script_script_id_seq'::regclass);


--
-- TOC entry 6154 (class 2604 OID 146570429)
-- Dependencies: 769 293
-- Name: shift_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shift ALTER COLUMN shift_id SET DEFAULT nextval('shift_shift_id_seq'::regclass);


--
-- TOC entry 6133 (class 2604 OID 146570430)
-- Dependencies: 770 281
-- Name: shipchrg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipchrg ALTER COLUMN shipchrg_id SET DEFAULT nextval('shipchrg_shipchrg_id_seq'::regclass);


--
-- TOC entry 6400 (class 2604 OID 146570431)
-- Dependencies: 773 526
-- Name: shiphead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiphead ALTER COLUMN shiphead_id SET DEFAULT nextval('shiphead_shiphead_id_seq'::regclass);


--
-- TOC entry 6404 (class 2604 OID 146570432)
-- Dependencies: 774 527
-- Name: shipitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipitem ALTER COLUMN shipitem_id SET DEFAULT nextval('shipitem_shipitem_id_seq'::regclass);


--
-- TOC entry 6261 (class 2604 OID 146570433)
-- Dependencies: 780 387
-- Name: sitetype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY sitetype ALTER COLUMN sitetype_id SET DEFAULT nextval('sitetype_sitetype_id_seq'::regclass);


--
-- TOC entry 6654 (class 2604 OID 146570434)
-- Dependencies: 786 785
-- Name: source_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY source ALTER COLUMN source_id SET DEFAULT nextval('source_source_id_seq'::regclass);


--
-- TOC entry 6656 (class 2604 OID 146570435)
-- Dependencies: 788 787
-- Name: state_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY state ALTER COLUMN state_id SET DEFAULT nextval('state_state_id_seq'::regclass);


--
-- TOC entry 6658 (class 2604 OID 146570436)
-- Dependencies: 790 789
-- Name: status_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY status ALTER COLUMN status_id SET DEFAULT nextval('status_status_id_seq'::regclass);


--
-- TOC entry 6660 (class 2604 OID 146570437)
-- Dependencies: 792 791
-- Name: stdjrnl_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnl ALTER COLUMN stdjrnl_id SET DEFAULT nextval('stdjrnl_stdjrnl_id_seq'::regclass);


--
-- TOC entry 6662 (class 2604 OID 146570438)
-- Dependencies: 794 793
-- Name: stdjrnlgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlgrp ALTER COLUMN stdjrnlgrp_id SET DEFAULT nextval('stdjrnlgrp_stdjrnlgrp_id_seq'::regclass);


--
-- TOC entry 6664 (class 2604 OID 146570439)
-- Dependencies: 796 795
-- Name: stdjrnlgrpitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlgrpitem ALTER COLUMN stdjrnlgrpitem_id SET DEFAULT nextval('stdjrnlgrpitem_stdjrnlgrpitem_id_seq'::regclass);


--
-- TOC entry 6665 (class 2604 OID 146570440)
-- Dependencies: 798 797
-- Name: stdjrnlitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlitem ALTER COLUMN stdjrnlitem_id SET DEFAULT nextval('stdjrnlitem_stdjrnlitem_id_seq'::regclass);


--
-- TOC entry 6666 (class 2604 OID 146570441)
-- Dependencies: 800 799
-- Name: subaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY subaccnt ALTER COLUMN subaccnt_id SET DEFAULT nextval('subaccnt_subaccnt_id_seq'::regclass);


--
-- TOC entry 6668 (class 2604 OID 146570442)
-- Dependencies: 802 801
-- Name: subaccnttype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY subaccnttype ALTER COLUMN subaccnttype_id SET DEFAULT nextval('subaccnttype_subaccnttype_id_seq'::regclass);


--
-- TOC entry 6669 (class 2604 OID 146570443)
-- Dependencies: 805 804
-- Name: taxass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxass ALTER COLUMN taxass_id SET DEFAULT nextval('taxass_taxass_id_seq'::regclass);


--
-- TOC entry 6137 (class 2604 OID 146570444)
-- Dependencies: 806 284
-- Name: taxauth_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxauth ALTER COLUMN taxauth_id SET DEFAULT nextval('taxauth_taxauth_id_seq'::regclass);


--
-- TOC entry 6670 (class 2604 OID 146570445)
-- Dependencies: 808 807
-- Name: taxclass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxclass ALTER COLUMN taxclass_id SET DEFAULT nextval('taxclass_taxclass_id_seq'::regclass);


--
-- TOC entry 6257 (class 2604 OID 146570446)
-- Dependencies: 378 377
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxhist ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6672 (class 2604 OID 146570459)
-- Dependencies: 810 809
-- Name: taxrate_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxrate ALTER COLUMN taxrate_id SET DEFAULT nextval('taxrate_taxrate_id_seq'::regclass);


--
-- TOC entry 6142 (class 2604 OID 146570460)
-- Dependencies: 811 285
-- Name: taxreg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxreg ALTER COLUMN taxreg_id SET DEFAULT nextval('taxreg_taxreg_id_seq'::regclass);


--
-- TOC entry 5929 (class 2604 OID 146570461)
-- Dependencies: 812 199
-- Name: taxtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxtype ALTER COLUMN taxtype_id SET DEFAULT nextval('taxtype_taxtype_id_seq'::regclass);


--
-- TOC entry 6018 (class 2604 OID 146570462)
-- Dependencies: 813 220
-- Name: taxzone_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxzone ALTER COLUMN taxzone_id SET DEFAULT nextval('taxzone_taxzone_id_seq'::regclass);


--
-- TOC entry 6045 (class 2604 OID 146570463)
-- Dependencies: 815 233
-- Name: todoitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem ALTER COLUMN todoitem_id SET DEFAULT nextval('todoitem_todoitem_id_seq'::regclass);


--
-- TOC entry 6673 (class 2604 OID 146570464)
-- Dependencies: 818 817
-- Name: trialbal_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY trialbal ALTER COLUMN trialbal_id SET DEFAULT nextval('trialbal_trialbal_id_seq'::regclass);


--
-- TOC entry 6282 (class 2604 OID 146568328)
-- Dependencies: 418 417
-- Name: uiform_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uiform ALTER COLUMN uiform_id SET DEFAULT nextval('uiform_uiform_id_seq'::regclass);


--
-- TOC entry 5932 (class 2604 OID 146570465)
-- Dependencies: 819 200
-- Name: uom_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uom ALTER COLUMN uom_id SET DEFAULT nextval('uom_uom_id_seq'::regclass);


--
-- TOC entry 6675 (class 2604 OID 146570466)
-- Dependencies: 821 820
-- Name: uomconv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomconv ALTER COLUMN uomconv_id SET DEFAULT nextval('uomconv_uomconv_id_seq'::regclass);


--
-- TOC entry 6677 (class 2604 OID 146570467)
-- Dependencies: 823 822
-- Name: uomtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomtype ALTER COLUMN uomtype_id SET DEFAULT nextval('uomtype_uomtype_id_seq'::regclass);


--
-- TOC entry 6085 (class 2604 OID 146570468)
-- Dependencies: 824 244
-- Name: url_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY urlinfo ALTER COLUMN url_id SET DEFAULT nextval('urlinfo_url_id_seq'::regclass);


--
-- TOC entry 6618 (class 2604 OID 146570469)
-- Dependencies: 829 732
-- Name: usrgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY usrgrp ALTER COLUMN usrgrp_id SET DEFAULT nextval('usrgrp_usrgrp_id_seq'::regclass);


--
-- TOC entry 6263 (class 2604 OID 146570470)
-- Dependencies: 836 393
-- Name: vendtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendtype ALTER COLUMN vendtype_id SET DEFAULT nextval('vendtype_vendtype_id_seq'::regclass);


--
-- TOC entry 6689 (class 2604 OID 146570457)
-- Dependencies: 841 378 841
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6692 (class 2604 OID 146570458)
-- Dependencies: 844 378 844
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- TOC entry 6216 (class 2604 OID 146570471)
-- Dependencies: 847 343
-- Name: whsezone_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsezone ALTER COLUMN whsezone_id SET DEFAULT nextval('whsezone_whsezone_id_seq'::regclass);


--
-- TOC entry 6693 (class 2604 OID 146570472)
-- Dependencies: 851 850
-- Name: womatlpost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY womatlpost ALTER COLUMN womatlpost_id SET DEFAULT nextval('womatlpost_womatlpost_id_seq'::regclass);


--
-- TOC entry 6696 (class 2604 OID 146570473)
-- Dependencies: 856 855
-- Name: xsltmap_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY xsltmap ALTER COLUMN xsltmap_id SET DEFAULT nextval('xsltmap_xsltmap_id_seq'::regclass);


--
-- TOC entry 6701 (class 2604 OID 146570474)
-- Dependencies: 858 857
-- Name: yearperiod_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY yearperiod ALTER COLUMN yearperiod_id SET DEFAULT nextval('yearperiod_yearperiod_id_seq'::regclass);



--
-- TOC entry 6707 (class 2604 OID 146570167)
-- Dependencies: 862 862
-- Name: metasql_grade; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- TOC entry 6711 (class 2604 OID 146570189)
-- Dependencies: 865 865
-- Name: script_enabled; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- TOC entry 6713 (class 2604 OID 146570197)
-- Dependencies: 866 866
-- Name: uiform_enabled; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;


--
-- TOC entry 6714 (class 2604 OID 146570475)
-- Dependencies: 868 867
-- Name: tecustrate_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tecustrate ALTER COLUMN tecustrate_id SET DEFAULT nextval('tecustrate_tecustrate_id_seq'::regclass);


--
-- TOC entry 6716 (class 2604 OID 146570476)
-- Dependencies: 870 869
-- Name: teemp_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teemp ALTER COLUMN teemp_id SET DEFAULT nextval('teemp_teemp_id_seq'::regclass);


--
-- TOC entry 6722 (class 2604 OID 146570477)
-- Dependencies: 874 873
-- Name: tehead_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tehead ALTER COLUMN tehead_id SET DEFAULT nextval('tehead_tehead_id_seq'::regclass);


--
-- TOC entry 6728 (class 2604 OID 146570478)
-- Dependencies: 876 875
-- Name: teitem_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem ALTER COLUMN teitem_id SET DEFAULT nextval('teitem_teitem_id_seq'::regclass);


--
-- TOC entry 6729 (class 2604 OID 146570479)
-- Dependencies: 878 877
-- Name: teprj_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprj ALTER COLUMN teprj_id SET DEFAULT nextval('teprj_teprj_id_seq'::regclass);


--
-- TOC entry 6730 (class 2604 OID 146570480)
-- Dependencies: 880 879
-- Name: teprjtask_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprjtask ALTER COLUMN teprjtask_id SET DEFAULT nextval('teprjtask_teprjtask_id_seq'::regclass);



--
-- TOC entry 6736 (class 2604 OID 146570285)
-- Dependencies: 884 884
-- Name: metasql_grade; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- TOC entry 6740 (class 2604 OID 146570307)
-- Dependencies: 887 887
-- Name: script_enabled; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- TOC entry 6742 (class 2604 OID 146570315)
-- Dependencies: 888 888
-- Name: uiform_enabled; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;



--
-- TOC entry 7165 (class 2606 OID 146570802)
-- Dependencies: 399 399 8894
-- Name: pkgcmd_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgcmd
    ADD CONSTRAINT pkgcmd_pkey PRIMARY KEY (cmd_id);


--
-- TOC entry 7169 (class 2606 OID 146570804)
-- Dependencies: 402 402 8894
-- Name: pkgcmdarg_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgcmdarg
    ADD CONSTRAINT pkgcmdarg_pkey PRIMARY KEY (cmdarg_id);


--
-- TOC entry 7171 (class 2606 OID 146570806)
-- Dependencies: 404 404 8894
-- Name: pkgimage_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgimage
    ADD CONSTRAINT pkgimage_pkey PRIMARY KEY (image_id);


--
-- TOC entry 7177 (class 2606 OID 146570808)
-- Dependencies: 407 407 8894
-- Name: pkgmetasql_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgmetasql
    ADD CONSTRAINT pkgmetasql_pkey PRIMARY KEY (metasql_id);


--
-- TOC entry 7182 (class 2606 OID 146570810)
-- Dependencies: 410 410 8894
-- Name: pkgpriv_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgpriv
    ADD CONSTRAINT pkgpriv_pkey PRIMARY KEY (priv_id);


--
-- TOC entry 7187 (class 2606 OID 146570812)
-- Dependencies: 413 413 8894
-- Name: pkgreport_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgreport
    ADD CONSTRAINT pkgreport_pkey PRIMARY KEY (report_id);


--
-- TOC entry 7191 (class 2606 OID 146570814)
-- Dependencies: 416 416 8894
-- Name: pkgscript_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgscript
    ADD CONSTRAINT pkgscript_pkey PRIMARY KEY (script_id);


--
-- TOC entry 7195 (class 2606 OID 146570816)
-- Dependencies: 419 419 8894
-- Name: pkguiform_pkey; Type: CONSTRAINT; Schema: fixcountry; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkguiform
    ADD CONSTRAINT pkguiform_pkey PRIMARY KEY (uiform_id);



--
-- TOC entry 7197 (class 2606 OID 146570818)
-- Dependencies: 420 420 8894
-- Name: acalitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY acalitem
    ADD CONSTRAINT acalitem_pkey PRIMARY KEY (acalitem_id);


--
-- TOC entry 6955 (class 2606 OID 146570820)
-- Dependencies: 262 262 8894
-- Name: accnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY accnt
    ADD CONSTRAINT accnt_pkey PRIMARY KEY (accnt_id);


--
-- TOC entry 6919 (class 2606 OID 146570822)
-- Dependencies: 234 234 8894
-- Name: addr_addr_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY addr
    ADD CONSTRAINT addr_addr_number_key UNIQUE (addr_number);


--
-- TOC entry 6921 (class 2606 OID 146570824)
-- Dependencies: 234 234 8894
-- Name: addr_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY addr
    ADD CONSTRAINT addr_pkey PRIMARY KEY (addr_id);


--
-- TOC entry 7199 (class 2606 OID 146570826)
-- Dependencies: 424 424 8894
-- Name: alarm_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY alarm
    ADD CONSTRAINT alarm_pkey PRIMARY KEY (alarm_id);


--
-- TOC entry 7201 (class 2606 OID 146570828)
-- Dependencies: 426 426 8894
-- Name: apaccnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apaccnt
    ADD CONSTRAINT apaccnt_pkey PRIMARY KEY (apaccnt_id);


--
-- TOC entry 7203 (class 2606 OID 146570830)
-- Dependencies: 428 428 8894
-- Name: apapply_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apapply
    ADD CONSTRAINT apapply_pkey PRIMARY KEY (apapply_id);


--
-- TOC entry 7212 (class 2606 OID 146570832)
-- Dependencies: 434 434 8894
-- Name: apcreditapply_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apcreditapply
    ADD CONSTRAINT apcreditapply_pkey PRIMARY KEY (apcreditapply_id);


--
-- TOC entry 6829 (class 2606 OID 146570834)
-- Dependencies: 207 207 8894
-- Name: apopen_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apopen
    ADD CONSTRAINT apopen_pkey PRIMARY KEY (apopen_id);


--
-- TOC entry 7214 (class 2606 OID 146570836)
-- Dependencies: 438 438 8894
-- Name: apopentax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apopentax
    ADD CONSTRAINT apopentax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 7217 (class 2606 OID 146570838)
-- Dependencies: 439 439 8894
-- Name: apselect_apselect_apopen_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apselect
    ADD CONSTRAINT apselect_apselect_apopen_id_key UNIQUE (apselect_apopen_id);


--
-- TOC entry 7219 (class 2606 OID 146570840)
-- Dependencies: 439 439 8894
-- Name: apselect_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY apselect
    ADD CONSTRAINT apselect_pkey PRIMARY KEY (apselect_id);


--
-- TOC entry 7221 (class 2606 OID 146570842)
-- Dependencies: 441 441 8894
-- Name: araccnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY araccnt
    ADD CONSTRAINT araccnt_pkey PRIMARY KEY (araccnt_id);


--
-- TOC entry 7224 (class 2606 OID 146570844)
-- Dependencies: 443 443 8894
-- Name: arapply_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY arapply
    ADD CONSTRAINT arapply_pkey PRIMARY KEY (arapply_id);


--
-- TOC entry 7226 (class 2606 OID 146570846)
-- Dependencies: 446 446 8894
-- Name: arcreditapply_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY arcreditapply
    ADD CONSTRAINT arcreditapply_pkey PRIMARY KEY (arcreditapply_id);


--
-- TOC entry 6850 (class 2606 OID 146570848)
-- Dependencies: 212 212 8894
-- Name: aropen_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY aropen
    ADD CONSTRAINT aropen_pkey PRIMARY KEY (aropen_id);


--
-- TOC entry 7138 (class 2606 OID 146570850)
-- Dependencies: 374 374 374 374 8894
-- Name: aropenalloc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY aropenalloc
    ADD CONSTRAINT aropenalloc_pkey PRIMARY KEY (aropenalloc_aropen_id, aropenalloc_doctype, aropenalloc_doc_id);


--
-- TOC entry 7228 (class 2606 OID 146570852)
-- Dependencies: 450 450 8894
-- Name: aropentax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY aropentax
    ADD CONSTRAINT aropentax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 7230 (class 2606 OID 146570854)
-- Dependencies: 451 451 8894
-- Name: asohist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY asohist
    ADD CONSTRAINT asohist_pkey PRIMARY KEY (asohist_id);


--
-- TOC entry 7232 (class 2606 OID 146570856)
-- Dependencies: 453 453 8894
-- Name: asohisttax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY asohisttax
    ADD CONSTRAINT asohisttax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 7234 (class 2606 OID 146570858)
-- Dependencies: 454 454 8894
-- Name: atlasmap_atlasmap_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY atlasmap
    ADD CONSTRAINT atlasmap_atlasmap_name_key UNIQUE (atlasmap_name);


--
-- TOC entry 7236 (class 2606 OID 146570860)
-- Dependencies: 454 454 8894
-- Name: atlasmap_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY atlasmap
    ADD CONSTRAINT atlasmap_pkey PRIMARY KEY (atlasmap_id);


--
-- TOC entry 6962 (class 2606 OID 146570862)
-- Dependencies: 266 266 8894
-- Name: bankaccnt_bankaccnt_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankaccnt
    ADD CONSTRAINT bankaccnt_bankaccnt_name_key UNIQUE (bankaccnt_name);


--
-- TOC entry 6964 (class 2606 OID 146570864)
-- Dependencies: 266 266 8894
-- Name: bankaccnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankaccnt
    ADD CONSTRAINT bankaccnt_pkey PRIMARY KEY (bankaccnt_id);


--
-- TOC entry 7238 (class 2606 OID 146570866)
-- Dependencies: 458 458 8894
-- Name: bankadj_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankadj
    ADD CONSTRAINT bankadj_pkey PRIMARY KEY (bankadj_id);


--
-- TOC entry 7240 (class 2606 OID 146570868)
-- Dependencies: 460 460 8894
-- Name: bankadjtype_bankadjtype_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankadjtype
    ADD CONSTRAINT bankadjtype_bankadjtype_name_key UNIQUE (bankadjtype_name);


--
-- TOC entry 7242 (class 2606 OID 146570870)
-- Dependencies: 460 460 8894
-- Name: bankadjtype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankadjtype
    ADD CONSTRAINT bankadjtype_pkey PRIMARY KEY (bankadjtype_id);


--
-- TOC entry 7244 (class 2606 OID 146570872)
-- Dependencies: 462 462 8894
-- Name: bankrec_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankrec
    ADD CONSTRAINT bankrec_pkey PRIMARY KEY (bankrec_id);


--
-- TOC entry 7246 (class 2606 OID 146570874)
-- Dependencies: 464 464 8894
-- Name: bankrecitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bankrecitem
    ADD CONSTRAINT bankrecitem_pkey PRIMARY KEY (bankrecitem_id);


--
-- TOC entry 6947 (class 2606 OID 146570876)
-- Dependencies: 254 254 8894
-- Name: bomhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bomhead
    ADD CONSTRAINT bomhead_pkey PRIMARY KEY (bomhead_id);


--
-- TOC entry 6811 (class 2606 OID 146570878)
-- Dependencies: 203 203 8894
-- Name: bomitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bomitem
    ADD CONSTRAINT bomitem_pkey PRIMARY KEY (bomitem_id);


--
-- TOC entry 7250 (class 2606 OID 146570880)
-- Dependencies: 468 468 8894
-- Name: bomitemcost_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bomitemcost
    ADD CONSTRAINT bomitemcost_pkey PRIMARY KEY (bomitemcost_id);


--
-- TOC entry 6949 (class 2606 OID 146570882)
-- Dependencies: 258 258 8894
-- Name: bomitemsub_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bomitemsub
    ADD CONSTRAINT bomitemsub_pkey PRIMARY KEY (bomitemsub_id);


--
-- TOC entry 7252 (class 2606 OID 146570884)
-- Dependencies: 471 471 8894
-- Name: bomwork_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY bomwork
    ADD CONSTRAINT bomwork_pkey PRIMARY KEY (bomwork_id);


--
-- TOC entry 6951 (class 2606 OID 146570886)
-- Dependencies: 260 260 8894
-- Name: budghead_budghead_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY budghead
    ADD CONSTRAINT budghead_budghead_name_key UNIQUE (budghead_name);


--
-- TOC entry 6953 (class 2606 OID 146570888)
-- Dependencies: 260 260 8894
-- Name: budghead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY budghead
    ADD CONSTRAINT budghead_pkey PRIMARY KEY (budghead_id);


--
-- TOC entry 6958 (class 2606 OID 146570890)
-- Dependencies: 263 263 8894
-- Name: budgitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY budgitem
    ADD CONSTRAINT budgitem_pkey PRIMARY KEY (budgitem_id);


--
-- TOC entry 7254 (class 2606 OID 146570892)
-- Dependencies: 476 476 8894
-- Name: calhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY calhead
    ADD CONSTRAINT calhead_pkey PRIMARY KEY (calhead_id);


--
-- TOC entry 6966 (class 2606 OID 146570894)
-- Dependencies: 267 267 8894
-- Name: cashrcpt_cashrcpt_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cashrcpt
    ADD CONSTRAINT cashrcpt_cashrcpt_number_key UNIQUE (cashrcpt_number);


--
-- TOC entry 6968 (class 2606 OID 146570896)
-- Dependencies: 267 267 8894
-- Name: cashrcpt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cashrcpt
    ADD CONSTRAINT cashrcpt_pkey PRIMARY KEY (cashrcpt_id);


--
-- TOC entry 6972 (class 2606 OID 146570898)
-- Dependencies: 269 269 8894
-- Name: cashrcptitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cashrcptitem
    ADD CONSTRAINT cashrcptitem_pkey PRIMARY KEY (cashrcptitem_id);


--
-- TOC entry 6974 (class 2606 OID 146570900)
-- Dependencies: 271 271 8894
-- Name: cashrcptmisc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cashrcptmisc
    ADD CONSTRAINT cashrcptmisc_pkey PRIMARY KEY (cashrcptmisc_id);


--
-- TOC entry 6977 (class 2606 OID 146570902)
-- Dependencies: 278 278 8894
-- Name: ccard_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ccard
    ADD CONSTRAINT ccard_pkey PRIMARY KEY (ccard_id);


--
-- TOC entry 7258 (class 2606 OID 146570904)
-- Dependencies: 482 482 8894
-- Name: ccardaud_ccard_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ccardaud
    ADD CONSTRAINT ccardaud_ccard_pkey PRIMARY KEY (ccardaud_id);


--
-- TOC entry 7260 (class 2606 OID 146570906)
-- Dependencies: 484 484 8894
-- Name: ccbank_ccbank_ccard_type_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ccbank
    ADD CONSTRAINT ccbank_ccbank_ccard_type_key UNIQUE (ccbank_ccard_type);


--
-- TOC entry 7262 (class 2606 OID 146570908)
-- Dependencies: 484 484 8894
-- Name: ccbank_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ccbank
    ADD CONSTRAINT ccbank_pkey PRIMARY KEY (ccbank_id);


--
-- TOC entry 7267 (class 2606 OID 146570910)
-- Dependencies: 486 486 8894
-- Name: ccpay_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ccpay
    ADD CONSTRAINT ccpay_pkey PRIMARY KEY (ccpay_id);


--
-- TOC entry 6923 (class 2606 OID 146570912)
-- Dependencies: 236 236 8894
-- Name: char_char_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY "char"
    ADD CONSTRAINT char_char_name_key UNIQUE (char_name);


--
-- TOC entry 6925 (class 2606 OID 146570914)
-- Dependencies: 236 236 8894
-- Name: char_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY "char"
    ADD CONSTRAINT char_pkey PRIMARY KEY (char_id);


--
-- TOC entry 6927 (class 2606 OID 146570916)
-- Dependencies: 237 237 8894
-- Name: charass_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY charass
    ADD CONSTRAINT charass_pkey PRIMARY KEY (charass_id);


--
-- TOC entry 7269 (class 2606 OID 146570918)
-- Dependencies: 490 490 8894
-- Name: charopt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY charopt
    ADD CONSTRAINT charopt_pkey PRIMARY KEY (charopt_id);


--
-- TOC entry 7205 (class 2606 OID 146570920)
-- Dependencies: 430 430 8894
-- Name: checkhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY checkhead
    ADD CONSTRAINT checkhead_pkey PRIMARY KEY (checkhead_id);


--
-- TOC entry 7210 (class 2606 OID 146570922)
-- Dependencies: 432 432 8894
-- Name: checkitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY checkitem
    ADD CONSTRAINT checkitem_pkey PRIMARY KEY (checkitem_id);


--
-- TOC entry 7036 (class 2606 OID 146570924)
-- Dependencies: 313 313 8894
-- Name: classcode_classcode_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY classcode
    ADD CONSTRAINT classcode_classcode_code_key UNIQUE (classcode_code);


--
-- TOC entry 7038 (class 2606 OID 146570926)
-- Dependencies: 313 313 8894
-- Name: classcode_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY classcode
    ADD CONSTRAINT classcode_pkey PRIMARY KEY (classcode_id);


--
-- TOC entry 7163 (class 2606 OID 146570928)
-- Dependencies: 397 397 8894
-- Name: cmd_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmd
    ADD CONSTRAINT cmd_pkey PRIMARY KEY (cmd_id);


--
-- TOC entry 7167 (class 2606 OID 146570930)
-- Dependencies: 400 400 8894
-- Name: cmdarg_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmdarg
    ADD CONSTRAINT cmdarg_pkey PRIMARY KEY (cmdarg_id);


--
-- TOC entry 6870 (class 2606 OID 146570932)
-- Dependencies: 218 218 8894
-- Name: cmhead_cmhead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_number_key UNIQUE (cmhead_number);


--
-- TOC entry 6873 (class 2606 OID 146570934)
-- Dependencies: 218 218 8894
-- Name: cmhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_pkey PRIMARY KEY (cmhead_id);


--
-- TOC entry 7271 (class 2606 OID 146570936)
-- Dependencies: 497 497 8894
-- Name: cmheadtax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmheadtax
    ADD CONSTRAINT cmheadtax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6883 (class 2606 OID 146570938)
-- Dependencies: 222 222 222 8894
-- Name: cmitem_cmhead_id_linenumber_unique; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_cmhead_id_linenumber_unique UNIQUE (cmitem_cmhead_id, cmitem_linenumber);


--
-- TOC entry 6885 (class 2606 OID 146570940)
-- Dependencies: 222 222 8894
-- Name: cmitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_pkey PRIMARY KEY (cmitem_id);


--
-- TOC entry 7273 (class 2606 OID 146570942)
-- Dependencies: 499 499 8894
-- Name: cmitemtax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmitemtax
    ADD CONSTRAINT cmitemtax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6930 (class 2606 OID 146570944)
-- Dependencies: 239 239 8894
-- Name: cmnttype_cmnttype_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmnttype
    ADD CONSTRAINT cmnttype_cmnttype_name_key UNIQUE (cmnttype_name);


--
-- TOC entry 6932 (class 2606 OID 146570946)
-- Dependencies: 239 239 8894
-- Name: cmnttype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmnttype
    ADD CONSTRAINT cmnttype_pkey PRIMARY KEY (cmnttype_id);


--
-- TOC entry 7275 (class 2606 OID 146570948)
-- Dependencies: 501 501 8894
-- Name: cmnttypesource_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cmnttypesource
    ADD CONSTRAINT cmnttypesource_pkey PRIMARY KEY (cmnttypesource_id);


--
-- TOC entry 6813 (class 2606 OID 146570950)
-- Dependencies: 204 204 8894
-- Name: cntct_cntct_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntct
    ADD CONSTRAINT cntct_cntct_number_key UNIQUE (cntct_number);


--
-- TOC entry 6817 (class 2606 OID 146570953)
-- Dependencies: 204 204 8894
-- Name: cntct_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntct
    ADD CONSTRAINT cntct_pkey PRIMARY KEY (cntct_id);


--
-- TOC entry 7277 (class 2606 OID 146570955)
-- Dependencies: 504 504 8894
-- Name: cntctaddr_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntctaddr
    ADD CONSTRAINT cntctaddr_pkey PRIMARY KEY (cntctaddr_id);


--
-- TOC entry 7279 (class 2606 OID 146570958)
-- Dependencies: 506 506 8894
-- Name: cntctdata_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntctdata
    ADD CONSTRAINT cntctdata_pkey PRIMARY KEY (cntctdata_id);


--
-- TOC entry 7281 (class 2606 OID 146570960)
-- Dependencies: 508 508 8894
-- Name: cntcteml_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntcteml
    ADD CONSTRAINT cntcteml_pkey PRIMARY KEY (cntcteml_id);


--
-- TOC entry 7283 (class 2606 OID 146570962)
-- Dependencies: 510 510 8894
-- Name: cntctmrgd_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntctmrgd
    ADD CONSTRAINT cntctmrgd_pkey PRIMARY KEY (cntctmrgd_cntct_id);


--
-- TOC entry 7285 (class 2606 OID 146570964)
-- Dependencies: 511 511 8894
-- Name: cntctsel_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntctsel
    ADD CONSTRAINT cntctsel_pkey PRIMARY KEY (cntctsel_cntct_id);


--
-- TOC entry 6744 (class 2606 OID 146570967)
-- Dependencies: 189 189 8894
-- Name: cntslip_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cntslip
    ADD CONSTRAINT cntslip_pkey PRIMARY KEY (cntslip_id);


--
-- TOC entry 7289 (class 2606 OID 146570969)
-- Dependencies: 513 513 8894
-- Name: cobill_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cobill
    ADD CONSTRAINT cobill_pkey PRIMARY KEY (cobill_id);


--
-- TOC entry 7291 (class 2606 OID 146570972)
-- Dependencies: 515 515 8894
-- Name: cobilltax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cobilltax
    ADD CONSTRAINT cobilltax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 7294 (class 2606 OID 146570974)
-- Dependencies: 516 516 8894
-- Name: cobmisc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cobmisc
    ADD CONSTRAINT cobmisc_pkey PRIMARY KEY (cobmisc_id);


--
-- TOC entry 7297 (class 2606 OID 146570976)
-- Dependencies: 518 518 8894
-- Name: cobmisctax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cobmisctax
    ADD CONSTRAINT cobmisctax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6768 (class 2606 OID 146570978)
-- Dependencies: 195 195 8894
-- Name: cohead_cohead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_number_key UNIQUE (cohead_number);


--
-- TOC entry 6774 (class 2606 OID 146570980)
-- Dependencies: 195 195 8894
-- Name: cohead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_pkey PRIMARY KEY (cohead_id);


--
-- TOC entry 7143 (class 2606 OID 146570982)
-- Dependencies: 376 376 8894
-- Name: cohist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_pkey PRIMARY KEY (cohist_id);


--
-- TOC entry 7149 (class 2606 OID 146570984)
-- Dependencies: 379 379 8894
-- Name: cohisttax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY cohisttax
    ADD CONSTRAINT cohisttax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6781 (class 2606 OID 146570986)
-- Dependencies: 196 196 8894
-- Name: coitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_pkey PRIMARY KEY (coitem_id);


--
-- TOC entry 6935 (class 2606 OID 146570989)
-- Dependencies: 240 240 8894
-- Name: comment_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY comment
    ADD CONSTRAINT comment_pkey PRIMARY KEY (comment_id);


--
-- TOC entry 7299 (class 2606 OID 146570991)
-- Dependencies: 523 523 8894
-- Name: company_company_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_number_key UNIQUE (company_number);


--
-- TOC entry 7301 (class 2606 OID 146570993)
-- Dependencies: 523 523 8894
-- Name: company_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_pkey PRIMARY KEY (company_id);


--
-- TOC entry 7065 (class 2606 OID 146570995)
-- Dependencies: 329 329 8894
-- Name: contrct_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY contrct
    ADD CONSTRAINT contrct_pkey PRIMARY KEY (contrct_id);


--
-- TOC entry 7056 (class 2606 OID 146570997)
-- Dependencies: 325 325 8894
-- Name: costcat_costcat_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costcat
    ADD CONSTRAINT costcat_costcat_code_key UNIQUE (costcat_code);


--
-- TOC entry 7058 (class 2606 OID 146570999)
-- Dependencies: 325 325 8894
-- Name: costcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costcat
    ADD CONSTRAINT costcat_pkey PRIMARY KEY (costcat_id);


--
-- TOC entry 7048 (class 2606 OID 146571001)
-- Dependencies: 320 320 8894
-- Name: costelem_costelem_type_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costelem
    ADD CONSTRAINT costelem_costelem_type_key UNIQUE (costelem_type);


--
-- TOC entry 7050 (class 2606 OID 146571004)
-- Dependencies: 320 320 8894
-- Name: costelem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costelem
    ADD CONSTRAINT costelem_pkey PRIMARY KEY (costelem_id);


--
-- TOC entry 7314 (class 2606 OID 146571006)
-- Dependencies: 535 535 8894
-- Name: costhist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costhist
    ADD CONSTRAINT costhist_pkey PRIMARY KEY (costhist_id);


--
-- TOC entry 7316 (class 2606 OID 146571013)
-- Dependencies: 537 537 8894
-- Name: costupdate_costupdate_item_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY costupdate
    ADD CONSTRAINT costupdate_costupdate_item_id_key UNIQUE (costupdate_item_id);


--
-- TOC entry 7318 (class 2606 OID 146571017)
-- Dependencies: 538 538 8894
-- Name: country_country_abbr_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY country
    ADD CONSTRAINT country_country_abbr_key UNIQUE (country_abbr);


--
-- TOC entry 7320 (class 2606 OID 146571019)
-- Dependencies: 538 538 8894
-- Name: country_country_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY country
    ADD CONSTRAINT country_country_name_key UNIQUE (country_name);


--
-- TOC entry 7322 (class 2606 OID 146571021)
-- Dependencies: 538 538 8894
-- Name: country_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY country
    ADD CONSTRAINT country_pkey PRIMARY KEY (country_id);


--
-- TOC entry 6819 (class 2606 OID 146571023)
-- Dependencies: 205 205 8894
-- Name: crmacct_crmacct_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_number_key UNIQUE (crmacct_number);


--
-- TOC entry 6821 (class 2606 OID 146571025)
-- Dependencies: 205 205 8894
-- Name: crmacct_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_pkey PRIMARY KEY (crmacct_id);


--
-- TOC entry 7328 (class 2606 OID 146571027)
-- Dependencies: 544 544 8894
-- Name: crmacctsel_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY crmacctsel
    ADD CONSTRAINT crmacctsel_pkey PRIMARY KEY (crmacctsel_src_crmacct_id);


--
-- TOC entry 7330 (class 2606 OID 146571029)
-- Dependencies: 545 545 545 8894
-- Name: curr_rate_curr_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY curr_rate
    ADD CONSTRAINT curr_rate_curr_id_key UNIQUE (curr_id, curr_effective);


--
-- TOC entry 7332 (class 2606 OID 146571031)
-- Dependencies: 545 545 8894
-- Name: curr_rate_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY curr_rate
    ADD CONSTRAINT curr_rate_pkey PRIMARY KEY (curr_rate_id);


--
-- TOC entry 6831 (class 2606 OID 146571033)
-- Dependencies: 208 208 8894
-- Name: curr_symbol_curr_abbr_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY curr_symbol
    ADD CONSTRAINT curr_symbol_curr_abbr_key UNIQUE (curr_abbr);


--
-- TOC entry 6833 (class 2606 OID 146571035)
-- Dependencies: 208 208 8894
-- Name: curr_symbol_curr_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY curr_symbol
    ADD CONSTRAINT curr_symbol_curr_name_key UNIQUE (curr_name);


--
-- TOC entry 6835 (class 2606 OID 146571037)
-- Dependencies: 208 208 8894
-- Name: curr_symbol_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY curr_symbol
    ADD CONSTRAINT curr_symbol_pkey PRIMARY KEY (curr_id);


--
-- TOC entry 6854 (class 2606 OID 146571039)
-- Dependencies: 213 213 8894
-- Name: cust_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT cust_pkey PRIMARY KEY (cust_id);


--
-- TOC entry 7334 (class 2606 OID 146571041)
-- Dependencies: 550 550 8894
-- Name: custform_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custform
    ADD CONSTRAINT custform_pkey PRIMARY KEY (custform_id);


--
-- TOC entry 7336 (class 2606 OID 146571043)
-- Dependencies: 552 552 8894
-- Name: custgrp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custgrp
    ADD CONSTRAINT custgrp_pkey PRIMARY KEY (custgrp_id);


--
-- TOC entry 7338 (class 2606 OID 146571045)
-- Dependencies: 554 554 8894
-- Name: custgrpitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custgrpitem
    ADD CONSTRAINT custgrpitem_pkey PRIMARY KEY (custgrpitem_id);


--
-- TOC entry 6856 (class 2606 OID 146571047)
-- Dependencies: 213 213 8894
-- Name: custinfo_cust_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_number_key UNIQUE (cust_number);


--
-- TOC entry 6979 (class 2606 OID 146571049)
-- Dependencies: 280 280 8894
-- Name: custtype_custtype_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custtype
    ADD CONSTRAINT custtype_custtype_code_key UNIQUE (custtype_code);


--
-- TOC entry 6981 (class 2606 OID 146571051)
-- Dependencies: 280 280 8894
-- Name: custtype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY custtype
    ADD CONSTRAINT custtype_pkey PRIMARY KEY (custtype_id);


--
-- TOC entry 6995 (class 2606 OID 146571053)
-- Dependencies: 291 291 8894
-- Name: dept_dept_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY dept
    ADD CONSTRAINT dept_dept_number_key UNIQUE (dept_number);


--
-- TOC entry 6997 (class 2606 OID 146571055)
-- Dependencies: 291 291 8894
-- Name: dept_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY dept
    ADD CONSTRAINT dept_pkey PRIMARY KEY (dept_id);


--
-- TOC entry 7340 (class 2606 OID 146571057)
-- Dependencies: 558 558 8894
-- Name: destination_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY destination
    ADD CONSTRAINT destination_pkey PRIMARY KEY (destination_id);


--
-- TOC entry 6937 (class 2606 OID 146571059)
-- Dependencies: 242 242 8894
-- Name: docass_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY docass
    ADD CONSTRAINT docass_pkey PRIMARY KEY (docass_id);


--
-- TOC entry 6999 (class 2606 OID 146571061)
-- Dependencies: 292 292 8894
-- Name: emp_emp_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_code_key UNIQUE (emp_code);


--
-- TOC entry 7001 (class 2606 OID 146571063)
-- Dependencies: 292 292 8894
-- Name: emp_emp_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_number_key UNIQUE (emp_number);


--
-- TOC entry 7003 (class 2606 OID 146571065)
-- Dependencies: 292 292 8894
-- Name: emp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_pkey PRIMARY KEY (emp_id);


--
-- TOC entry 7349 (class 2606 OID 146571068)
-- Dependencies: 563 563 8894
-- Name: empgrp_empgrp_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY empgrp
    ADD CONSTRAINT empgrp_empgrp_name_key UNIQUE (empgrp_name);


--
-- TOC entry 7351 (class 2606 OID 146571070)
-- Dependencies: 563 563 8894
-- Name: empgrp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY empgrp
    ADD CONSTRAINT empgrp_pkey PRIMARY KEY (empgrp_id);


--
-- TOC entry 7353 (class 2606 OID 146571072)
-- Dependencies: 565 565 8894
-- Name: empgrpitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY empgrpitem
    ADD CONSTRAINT empgrpitem_pkey PRIMARY KEY (empgrpitem_id);


--
-- TOC entry 7357 (class 2606 OID 146571075)
-- Dependencies: 567 567 8894
-- Name: evntlog_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY evntlog
    ADD CONSTRAINT evntlog_pkey PRIMARY KEY (evntlog_id);


--
-- TOC entry 7360 (class 2606 OID 146571077)
-- Dependencies: 569 569 8894
-- Name: evntnot_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY evntnot
    ADD CONSTRAINT evntnot_pkey PRIMARY KEY (evntnot_id);


--
-- TOC entry 7363 (class 2606 OID 146571079)
-- Dependencies: 571 571 8894
-- Name: evnttype_evnttype_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY evnttype
    ADD CONSTRAINT evnttype_evnttype_name_key UNIQUE (evnttype_name);


--
-- TOC entry 7365 (class 2606 OID 146571081)
-- Dependencies: 571 571 8894
-- Name: evnttype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY evnttype
    ADD CONSTRAINT evnttype_pkey PRIMARY KEY (evnttype_id);


--
-- TOC entry 7117 (class 2606 OID 146571083)
-- Dependencies: 358 358 8894
-- Name: expcat_expcat_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY expcat
    ADD CONSTRAINT expcat_expcat_code_key UNIQUE (expcat_code);


--
-- TOC entry 7119 (class 2606 OID 146571085)
-- Dependencies: 358 358 8894
-- Name: expcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY expcat
    ADD CONSTRAINT expcat_pkey PRIMARY KEY (expcat_id);


--
-- TOC entry 6939 (class 2606 OID 146571087)
-- Dependencies: 243 243 8894
-- Name: file_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY file
    ADD CONSTRAINT file_pkey PRIMARY KEY (file_id);


--
-- TOC entry 7368 (class 2606 OID 146571089)
-- Dependencies: 575 575 8894
-- Name: filter_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY filter
    ADD CONSTRAINT filter_pkey PRIMARY KEY (filter_id);


--
-- TOC entry 7370 (class 2606 OID 146571091)
-- Dependencies: 577 577 8894
-- Name: fincharg_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY fincharg
    ADD CONSTRAINT fincharg_pkey PRIMARY KEY (fincharg_id);


--
-- TOC entry 7378 (class 2606 OID 146571093)
-- Dependencies: 582 582 8894
-- Name: fkey_flcol_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flcol
    ADD CONSTRAINT fkey_flcol_key PRIMARY KEY (flcol_id);


--
-- TOC entry 7380 (class 2606 OID 146571095)
-- Dependencies: 584 584 8894
-- Name: flgrp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flgrp
    ADD CONSTRAINT flgrp_pkey PRIMARY KEY (flgrp_id);


--
-- TOC entry 7372 (class 2606 OID 146571097)
-- Dependencies: 579 579 8894
-- Name: flhead_flhead_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flhead
    ADD CONSTRAINT flhead_flhead_name_key UNIQUE (flhead_name);


--
-- TOC entry 7374 (class 2606 OID 146571099)
-- Dependencies: 579 579 8894
-- Name: flhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flhead
    ADD CONSTRAINT flhead_pkey PRIMARY KEY (flhead_id);


--
-- TOC entry 7376 (class 2606 OID 146571101)
-- Dependencies: 580 580 8894
-- Name: flitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flitem
    ADD CONSTRAINT flitem_pkey PRIMARY KEY (flitem_id);


--
-- TOC entry 7382 (class 2606 OID 146571103)
-- Dependencies: 588 588 588 8894
-- Name: flnotes_flnotes_flhead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flnotes
    ADD CONSTRAINT flnotes_flnotes_flhead_id_key UNIQUE (flnotes_flhead_id, flnotes_period_id);


--
-- TOC entry 7384 (class 2606 OID 146571105)
-- Dependencies: 590 590 8894
-- Name: flrpt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flrpt
    ADD CONSTRAINT flrpt_pkey PRIMARY KEY (flrpt_id);


--
-- TOC entry 7386 (class 2606 OID 146571107)
-- Dependencies: 592 592 8894
-- Name: flspec_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY flspec
    ADD CONSTRAINT flspec_pkey PRIMARY KEY (flspec_id);


--
-- TOC entry 7388 (class 2606 OID 146571109)
-- Dependencies: 594 594 8894
-- Name: form_form_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY form
    ADD CONSTRAINT form_form_name_key UNIQUE (form_name);


--
-- TOC entry 7390 (class 2606 OID 146571111)
-- Dependencies: 594 594 8894
-- Name: form_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY form
    ADD CONSTRAINT form_pkey PRIMARY KEY (form_id);


--
-- TOC entry 7010 (class 2606 OID 146571113)
-- Dependencies: 299 299 8894
-- Name: freightclass_freightclass_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY freightclass
    ADD CONSTRAINT freightclass_freightclass_code_key UNIQUE (freightclass_code);


--
-- TOC entry 7012 (class 2606 OID 146571115)
-- Dependencies: 299 299 8894
-- Name: freightclass_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY freightclass
    ADD CONSTRAINT freightclass_pkey PRIMARY KEY (freightclass_id);


--
-- TOC entry 7392 (class 2606 OID 146571117)
-- Dependencies: 597 597 8894
-- Name: glseries_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY glseries
    ADD CONSTRAINT glseries_pkey PRIMARY KEY (glseries_id);


--
-- TOC entry 7090 (class 2606 OID 146571119)
-- Dependencies: 340 340 8894
-- Name: gltrans_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY gltrans
    ADD CONSTRAINT gltrans_pkey PRIMARY KEY (gltrans_id);


--
-- TOC entry 7394 (class 2606 OID 146571121)
-- Dependencies: 601 601 8894
-- Name: grp_grp_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY grp
    ADD CONSTRAINT grp_grp_name_key UNIQUE (grp_name);


--
-- TOC entry 7396 (class 2606 OID 146571123)
-- Dependencies: 601 601 8894
-- Name: grp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY grp
    ADD CONSTRAINT grp_pkey PRIMARY KEY (grp_id);


--
-- TOC entry 7398 (class 2606 OID 146571125)
-- Dependencies: 603 603 8894
-- Name: grppriv_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY grppriv
    ADD CONSTRAINT grppriv_pkey PRIMARY KEY (grppriv_id);


--
-- TOC entry 7400 (class 2606 OID 146571127)
-- Dependencies: 605 605 8894
-- Name: hnfc_hnfc_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY hnfc
    ADD CONSTRAINT hnfc_hnfc_code_key UNIQUE (hnfc_code);


--
-- TOC entry 7402 (class 2606 OID 146571129)
-- Dependencies: 605 605 8894
-- Name: hnfc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY hnfc
    ADD CONSTRAINT hnfc_pkey PRIMARY KEY (hnfc_id);


--
-- TOC entry 6943 (class 2606 OID 146571131)
-- Dependencies: 248 248 8894
-- Name: image_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY image
    ADD CONSTRAINT image_pkey PRIMARY KEY (image_id);


--
-- TOC entry 6945 (class 2606 OID 146571133)
-- Dependencies: 249 249 8894
-- Name: imageass_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY imageass
    ADD CONSTRAINT imageass_pkey PRIMARY KEY (imageass_id);


--
-- TOC entry 6823 (class 2606 OID 146571135)
-- Dependencies: 206 206 8894
-- Name: incdt_incdt_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_number_key UNIQUE (incdt_number);


--
-- TOC entry 6825 (class 2606 OID 146571137)
-- Dependencies: 206 206 8894
-- Name: incdt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_pkey PRIMARY KEY (incdt_id);


--
-- TOC entry 7020 (class 2606 OID 146571139)
-- Dependencies: 304 304 8894
-- Name: incdtcat_incdtcat_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtcat
    ADD CONSTRAINT incdtcat_incdtcat_name_key UNIQUE (incdtcat_name);


--
-- TOC entry 7022 (class 2606 OID 146571141)
-- Dependencies: 304 304 8894
-- Name: incdtcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtcat
    ADD CONSTRAINT incdtcat_pkey PRIMARY KEY (incdtcat_id);


--
-- TOC entry 7404 (class 2606 OID 146571143)
-- Dependencies: 609 609 8894
-- Name: incdthist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdthist
    ADD CONSTRAINT incdthist_pkey PRIMARY KEY (incdthist_id);


--
-- TOC entry 7024 (class 2606 OID 146571145)
-- Dependencies: 305 305 8894
-- Name: incdtpriority_incdtpriority_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtpriority
    ADD CONSTRAINT incdtpriority_incdtpriority_name_key UNIQUE (incdtpriority_name);


--
-- TOC entry 7026 (class 2606 OID 146571147)
-- Dependencies: 305 305 8894
-- Name: incdtpriority_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtpriority
    ADD CONSTRAINT incdtpriority_pkey PRIMARY KEY (incdtpriority_id);


--
-- TOC entry 7028 (class 2606 OID 146571149)
-- Dependencies: 306 306 8894
-- Name: incdtresolution_incdtresolution_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtresolution
    ADD CONSTRAINT incdtresolution_incdtresolution_name_key UNIQUE (incdtresolution_name);


--
-- TOC entry 7030 (class 2606 OID 146571151)
-- Dependencies: 306 306 8894
-- Name: incdtresolution_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtresolution
    ADD CONSTRAINT incdtresolution_pkey PRIMARY KEY (incdtresolution_id);


--
-- TOC entry 7032 (class 2606 OID 146571153)
-- Dependencies: 307 307 8894
-- Name: incdtseverity_incdtseverity_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtseverity
    ADD CONSTRAINT incdtseverity_incdtseverity_name_key UNIQUE (incdtseverity_name);


--
-- TOC entry 7034 (class 2606 OID 146571155)
-- Dependencies: 307 307 8894
-- Name: incdtseverity_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY incdtseverity
    ADD CONSTRAINT incdtseverity_pkey PRIMARY KEY (incdtseverity_id);


--
-- TOC entry 6805 (class 2606 OID 146571157)
-- Dependencies: 202 202 8894
-- Name: invbal_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invbal
    ADD CONSTRAINT invbal_pkey PRIMARY KEY (invbal_id);


--
-- TOC entry 6888 (class 2606 OID 146571159)
-- Dependencies: 224 224 8894
-- Name: invchead_invcnumber_unique; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_invcnumber_unique UNIQUE (invchead_invcnumber);


--
-- TOC entry 6890 (class 2606 OID 146571161)
-- Dependencies: 224 224 8894
-- Name: invchead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_pkey PRIMARY KEY (invchead_id);


--
-- TOC entry 7406 (class 2606 OID 146571163)
-- Dependencies: 617 617 8894
-- Name: invcheadtax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invcheadtax
    ADD CONSTRAINT invcheadtax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6902 (class 2606 OID 146571165)
-- Dependencies: 229 229 229 8894
-- Name: invcitem_invchead_id_linenumber_unique; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invchead_id_linenumber_unique UNIQUE (invcitem_invchead_id, invcitem_linenumber);


--
-- TOC entry 6906 (class 2606 OID 146571167)
-- Dependencies: 229 229 8894
-- Name: invcitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_pkey PRIMARY KEY (invcitem_id);


--
-- TOC entry 7408 (class 2606 OID 146571169)
-- Dependencies: 619 619 8894
-- Name: invcitemtax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invcitemtax
    ADD CONSTRAINT invcitemtax_pkey PRIMARY KEY (taxhist_id);


--
-- TOC entry 6746 (class 2606 OID 146571171)
-- Dependencies: 190 190 8894
-- Name: invcnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invcnt
    ADD CONSTRAINT invcnt_pkey PRIMARY KEY (invcnt_id);


--
-- TOC entry 7413 (class 2606 OID 146571173)
-- Dependencies: 621 621 8894
-- Name: invdetail_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invdetail
    ADD CONSTRAINT invdetail_pkey PRIMARY KEY (invdetail_id);


--
-- TOC entry 7418 (class 2606 OID 146571175)
-- Dependencies: 623 623 8894
-- Name: invhist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invhist
    ADD CONSTRAINT invhist_pkey PRIMARY KEY (invhist_id);


--
-- TOC entry 7423 (class 2606 OID 146571177)
-- Dependencies: 625 625 625 8894
-- Name: invhistexpcat_invhist_id_expcat_id; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invhistexpcat
    ADD CONSTRAINT invhistexpcat_invhist_id_expcat_id UNIQUE (invhistexpcat_invhist_id, invhistexpcat_expcat_id);


--
-- TOC entry 7425 (class 2606 OID 146571179)
-- Dependencies: 625 625 8894
-- Name: invhistexpcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY invhistexpcat
    ADD CONSTRAINT invhistexpcat_pkey PRIMARY KEY (invhistexpcat_id);


--
-- TOC entry 7098 (class 2606 OID 146571181)
-- Dependencies: 347 347 347 347 347 347 347 8894
-- Name: ipsass_ipsass_ipshead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsass
    ADD CONSTRAINT ipsass_ipsass_ipshead_id_key UNIQUE (ipsass_ipshead_id, ipsass_cust_id, ipsass_custtype_id, ipsass_custtype_pattern, ipsass_shipto_id, ipsass_shipto_pattern);


--
-- TOC entry 7100 (class 2606 OID 146571183)
-- Dependencies: 347 347 8894
-- Name: ipsass_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsass
    ADD CONSTRAINT ipsass_pkey PRIMARY KEY (ipsass_id);


--
-- TOC entry 7014 (class 2606 OID 146571185)
-- Dependencies: 300 300 8894
-- Name: ipsfreight_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsfreight
    ADD CONSTRAINT ipsfreight_pkey PRIMARY KEY (ipsfreight_id);


--
-- TOC entry 7016 (class 2606 OID 146571187)
-- Dependencies: 301 301 8894
-- Name: ipshead_ipshead_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipshead
    ADD CONSTRAINT ipshead_ipshead_name_key UNIQUE (ipshead_name);


--
-- TOC entry 7018 (class 2606 OID 146571189)
-- Dependencies: 301 301 8894
-- Name: ipshead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipshead
    ADD CONSTRAINT ipshead_pkey PRIMARY KEY (ipshead_id);


--
-- TOC entry 7103 (class 2606 OID 146571191)
-- Dependencies: 349 349 349 349 349 349 349 8894
-- Name: ipsitem_ipsitem_ipshead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_ipsitem_ipshead_id_key UNIQUE (ipsitem_ipshead_id, ipsitem_item_id, ipsitem_prodcat_id, ipsitem_qtybreak, ipsitem_qty_uom_id, ipsitem_price_uom_id);


--
-- TOC entry 7105 (class 2606 OID 146571193)
-- Dependencies: 349 349 8894
-- Name: ipsitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_pkey PRIMARY KEY (ipsitem_id);


--
-- TOC entry 7107 (class 2606 OID 146571195)
-- Dependencies: 351 351 351 351 8894
-- Name: ipsitemchar_ipsitemchar_ipsitem_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsitemchar
    ADD CONSTRAINT ipsitemchar_ipsitemchar_ipsitem_id_key UNIQUE (ipsitemchar_ipsitem_id, ipsitemchar_char_id, ipsitemchar_value);


--
-- TOC entry 7109 (class 2606 OID 146571197)
-- Dependencies: 351 351 351 351 8894
-- Name: ipsitemchar_ipsitemchar_ipsitem_id_key1; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsitemchar
    ADD CONSTRAINT ipsitemchar_ipsitemchar_ipsitem_id_key1 UNIQUE (ipsitemchar_ipsitem_id, ipsitemchar_char_id, ipsitemchar_value);


--
-- TOC entry 7111 (class 2606 OID 146571199)
-- Dependencies: 351 351 8894
-- Name: ipsitemchar_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsitemchar
    ADD CONSTRAINT ipsitemchar_pkey PRIMARY KEY (ipsitemchar_id);


--
-- TOC entry 7427 (class 2606 OID 146571201)
-- Dependencies: 636 636 8894
-- Name: ipsprodcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ipsprodcat_bak
    ADD CONSTRAINT ipsprodcat_pkey PRIMARY KEY (ipsprodcat_id);


--
-- TOC entry 6749 (class 2606 OID 146571203)
-- Dependencies: 191 191 8894
-- Name: item_item_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_item_number_key UNIQUE (item_number);


--
-- TOC entry 6752 (class 2606 OID 146571205)
-- Dependencies: 191 191 8894
-- Name: item_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_pkey PRIMARY KEY (item_id);


--
-- TOC entry 7044 (class 2606 OID 146571207)
-- Dependencies: 316 316 316 8894
-- Name: itemalias_itemalias_item_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemalias
    ADD CONSTRAINT itemalias_itemalias_item_id_key UNIQUE (itemalias_item_id, itemalias_number);


--
-- TOC entry 7046 (class 2606 OID 146571209)
-- Dependencies: 316 316 8894
-- Name: itemalias_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemalias
    ADD CONSTRAINT itemalias_pkey PRIMARY KEY (itemalias_id);


--
-- TOC entry 7054 (class 2606 OID 146571211)
-- Dependencies: 321 321 8894
-- Name: itemcost_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemcost
    ADD CONSTRAINT itemcost_pkey PRIMARY KEY (itemcost_id);


--
-- TOC entry 7429 (class 2606 OID 146571213)
-- Dependencies: 643 643 8894
-- Name: itemgrp_itemgrp_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemgrp
    ADD CONSTRAINT itemgrp_itemgrp_name_key UNIQUE (itemgrp_name);


--
-- TOC entry 7431 (class 2606 OID 146571215)
-- Dependencies: 643 643 8894
-- Name: itemgrp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemgrp
    ADD CONSTRAINT itemgrp_pkey PRIMARY KEY (itemgrp_id);


--
-- TOC entry 7433 (class 2606 OID 146571217)
-- Dependencies: 645 645 8894
-- Name: itemgrpitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemgrpitem
    ADD CONSTRAINT itemgrpitem_pkey PRIMARY KEY (itemgrpitem_id);


--
-- TOC entry 7435 (class 2606 OID 146571219)
-- Dependencies: 645 645 645 645 8894
-- Name: itemgrpitem_unique_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemgrpitem
    ADD CONSTRAINT itemgrpitem_unique_key UNIQUE (itemgrpitem_itemgrp_id, itemgrpitem_item_id, itemgrpitem_item_type);


--
-- TOC entry 7439 (class 2606 OID 146571221)
-- Dependencies: 649 649 8894
-- Name: itemloc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemloc
    ADD CONSTRAINT itemloc_pkey PRIMARY KEY (itemloc_id);


--
-- TOC entry 7441 (class 2606 OID 146571223)
-- Dependencies: 652 652 8894
-- Name: itemlocdist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemlocdist
    ADD CONSTRAINT itemlocdist_pkey PRIMARY KEY (itemlocdist_id);


--
-- TOC entry 7443 (class 2606 OID 146571225)
-- Dependencies: 654 654 8894
-- Name: itemlocpost_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemlocpost
    ADD CONSTRAINT itemlocpost_pkey PRIMARY KEY (itemlocpost_id);


--
-- TOC entry 6759 (class 2606 OID 146571227)
-- Dependencies: 192 192 8894
-- Name: itemsite_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsite
    ADD CONSTRAINT itemsite_pkey PRIMARY KEY (itemsite_id);


--
-- TOC entry 7067 (class 2606 OID 146571229)
-- Dependencies: 330 330 330 330 330 330 330 330 330 8894
-- Name: itemsrc_itemsrc_vend_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsrc
    ADD CONSTRAINT itemsrc_itemsrc_vend_id_key UNIQUE (itemsrc_vend_id, itemsrc_item_id, itemsrc_effective, itemsrc_expires, itemsrc_vend_item_number, itemsrc_manuf_name, itemsrc_manuf_item_number, itemsrc_contrct_id);


--
-- TOC entry 7069 (class 2606 OID 146571231)
-- Dependencies: 330 330 8894
-- Name: itemsrc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsrc
    ADD CONSTRAINT itemsrc_pkey PRIMARY KEY (itemsrc_id);


--
-- TOC entry 7073 (class 2606 OID 146571233)
-- Dependencies: 332 332 332 332 332 8894
-- Name: itemsrcp_itemsrcp_itemsrc_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsrcp
    ADD CONSTRAINT itemsrcp_itemsrcp_itemsrc_id_key UNIQUE (itemsrcp_itemsrc_id, itemsrcp_warehous_id, itemsrcp_dropship, itemsrcp_qtybreak);


--
-- TOC entry 7075 (class 2606 OID 146571235)
-- Dependencies: 332 332 8894
-- Name: itemsrcp_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsrcp
    ADD CONSTRAINT itemsrcp_pkey PRIMARY KEY (itemsrcp_id);


--
-- TOC entry 7077 (class 2606 OID 146571237)
-- Dependencies: 334 334 334 8894
-- Name: itemsub_itemsub_parent_item_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsub
    ADD CONSTRAINT itemsub_itemsub_parent_item_id_key UNIQUE (itemsub_parent_item_id, itemsub_sub_item_id);


--
-- TOC entry 7080 (class 2606 OID 146571239)
-- Dependencies: 334 334 8894
-- Name: itemsub_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemsub
    ADD CONSTRAINT itemsub_pkey PRIMARY KEY (itemsub_id);


--
-- TOC entry 7083 (class 2606 OID 146571241)
-- Dependencies: 336 336 8894
-- Name: itemtax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemtax
    ADD CONSTRAINT itemtax_pkey PRIMARY KEY (itemtax_id);


--
-- TOC entry 7445 (class 2606 OID 146571243)
-- Dependencies: 662 662 662 8894
-- Name: itemtrans_itemtrans_source_item_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemtrans
    ADD CONSTRAINT itemtrans_itemtrans_source_item_id_key UNIQUE (itemtrans_source_item_id, itemtrans_target_item_id);


--
-- TOC entry 7447 (class 2606 OID 146571245)
-- Dependencies: 662 662 8894
-- Name: itemtrans_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemtrans
    ADD CONSTRAINT itemtrans_pkey PRIMARY KEY (itemtrans_id);


--
-- TOC entry 7449 (class 2606 OID 146571247)
-- Dependencies: 664 664 8894
-- Name: itemuom_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemuom
    ADD CONSTRAINT itemuom_pkey PRIMARY KEY (itemuom_id);


--
-- TOC entry 7085 (class 2606 OID 146571249)
-- Dependencies: 338 338 8894
-- Name: itemuomconv_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY itemuomconv
    ADD CONSTRAINT itemuomconv_pkey PRIMARY KEY (itemuomconv_id);


--
-- TOC entry 7451 (class 2606 OID 146571251)
-- Dependencies: 668 668 8894
-- Name: jrnluse_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY jrnluse
    ADD CONSTRAINT jrnluse_pkey PRIMARY KEY (jrnluse_id);


--
-- TOC entry 7453 (class 2606 OID 146571253)
-- Dependencies: 670 670 8894
-- Name: labeldef_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY labeldef
    ADD CONSTRAINT labeldef_pkey PRIMARY KEY (labeldef_id);


--
-- TOC entry 7455 (class 2606 OID 146571255)
-- Dependencies: 672 672 8894
-- Name: labelform_labelform_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY labelform
    ADD CONSTRAINT labelform_labelform_name_key UNIQUE (labelform_name);


--
-- TOC entry 7457 (class 2606 OID 146571257)
-- Dependencies: 672 672 8894
-- Name: labelform_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY labelform
    ADD CONSTRAINT labelform_pkey PRIMARY KEY (labelform_id);


--
-- TOC entry 7459 (class 2606 OID 146571259)
-- Dependencies: 674 674 8894
-- Name: lang_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY lang
    ADD CONSTRAINT lang_pkey PRIMARY KEY (lang_id);


--
-- TOC entry 7461 (class 2606 OID 146571261)
-- Dependencies: 676 676 8894
-- Name: locale_locale_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY locale
    ADD CONSTRAINT locale_locale_code_key UNIQUE (locale_code);


--
-- TOC entry 7463 (class 2606 OID 146571263)
-- Dependencies: 676 676 8894
-- Name: locale_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY locale
    ADD CONSTRAINT locale_pkey PRIMARY KEY (locale_id);


--
-- TOC entry 7093 (class 2606 OID 146571265)
-- Dependencies: 342 342 8894
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY location
    ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);


--
-- TOC entry 7465 (class 2606 OID 146571267)
-- Dependencies: 679 679 8894
-- Name: locitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY locitem
    ADD CONSTRAINT locitem_pkey PRIMARY KEY (locitem_id);


--
-- TOC entry 7173 (class 2606 OID 146571269)
-- Dependencies: 405 405 405 405 8894
-- Name: metasql_metasql_group_name_grade_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metasql
    ADD CONSTRAINT metasql_metasql_group_name_grade_key UNIQUE (metasql_group, metasql_name, metasql_grade);


--
-- TOC entry 7175 (class 2606 OID 146571271)
-- Dependencies: 405 405 8894
-- Name: metasql_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metasql
    ADD CONSTRAINT metasql_pkey PRIMARY KEY (metasql_id);


--
-- TOC entry 7467 (class 2606 OID 146571273)
-- Dependencies: 682 682 8894
-- Name: metric_metric_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metric
    ADD CONSTRAINT metric_metric_name_key UNIQUE (metric_name);


--
-- TOC entry 7469 (class 2606 OID 146571275)
-- Dependencies: 682 682 8894
-- Name: metric_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metric
    ADD CONSTRAINT metric_pkey PRIMARY KEY (metric_id);


--
-- TOC entry 7471 (class 2606 OID 146571277)
-- Dependencies: 684 684 8894
-- Name: metricenc_metricenc_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metricenc
    ADD CONSTRAINT metricenc_metricenc_name_key UNIQUE (metricenc_name);


--
-- TOC entry 7473 (class 2606 OID 146571279)
-- Dependencies: 684 684 8894
-- Name: metricenc_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY metricenc
    ADD CONSTRAINT metricenc_pkey PRIMARY KEY (metricenc_id);


--
-- TOC entry 7475 (class 2606 OID 146571281)
-- Dependencies: 687 687 687 687 687 687 8894
-- Name: mrghist_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY mrghist
    ADD CONSTRAINT mrghist_pkey PRIMARY KEY (mrghist_cntct_id, mrghist_table, mrghist_pkey_col, mrghist_pkey_id, mrghist_cntct_col);


--
-- TOC entry 7477 (class 2606 OID 146571283)
-- Dependencies: 688 688 688 688 688 688 8894
-- Name: mrgundo_mrgundo_schema_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY mrgundo
    ADD CONSTRAINT mrgundo_mrgundo_schema_key UNIQUE (mrgundo_schema, mrgundo_table, mrgundo_pkey_col, mrgundo_pkey_id, mrgundo_col);


--
-- TOC entry 7479 (class 2606 OID 146571285)
-- Dependencies: 689 689 8894
-- Name: msg_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY msg
    ADD CONSTRAINT msg_pkey PRIMARY KEY (msg_id);


--
-- TOC entry 7481 (class 2606 OID 146571287)
-- Dependencies: 691 691 8894
-- Name: msguser_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY msguser
    ADD CONSTRAINT msguser_pkey PRIMARY KEY (msguser_id);


--
-- TOC entry 7483 (class 2606 OID 146571289)
-- Dependencies: 694 694 8894
-- Name: obsolete_tax_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY obsolete_tax
    ADD CONSTRAINT obsolete_tax_pkey PRIMARY KEY (tax_id);


--
-- TOC entry 6908 (class 2606 OID 146571291)
-- Dependencies: 231 231 8894
-- Name: ophead_ophead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_number_key UNIQUE (ophead_number);


--
-- TOC entry 6910 (class 2606 OID 146571293)
-- Dependencies: 231 231 8894
-- Name: ophead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_pkey PRIMARY KEY (ophead_id);


--
-- TOC entry 7485 (class 2606 OID 146571295)
-- Dependencies: 696 696 8894
-- Name: opsource_opsource_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY opsource
    ADD CONSTRAINT opsource_opsource_name_key UNIQUE (opsource_name);


--
-- TOC entry 7487 (class 2606 OID 146571297)
-- Dependencies: 696 696 8894
-- Name: opsource_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY opsource
    ADD CONSTRAINT opsource_pkey PRIMARY KEY (opsource_id);


--
-- TOC entry 7489 (class 2606 OID 146571299)
-- Dependencies: 698 698 8894
-- Name: opstage_opstage_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY opstage
    ADD CONSTRAINT opstage_opstage_name_key UNIQUE (opstage_name);


--
-- TOC entry 7491 (class 2606 OID 146571301)
-- Dependencies: 698 698 8894
-- Name: opstage_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY opstage
    ADD CONSTRAINT opstage_pkey PRIMARY KEY (opstage_id);


--
-- TOC entry 7493 (class 2606 OID 146571303)
-- Dependencies: 700 700 8894
-- Name: optype_optype_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY optype
    ADD CONSTRAINT optype_optype_name_key UNIQUE (optype_name);


--
-- TOC entry 7495 (class 2606 OID 146571305)
-- Dependencies: 700 700 8894
-- Name: optype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY optype
    ADD CONSTRAINT optype_pkey PRIMARY KEY (optype_id);


--
-- TOC entry 7497 (class 2606 OID 146571307)
-- Dependencies: 704 704 8894
-- Name: orderseq_orderseq_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY orderseq
    ADD CONSTRAINT orderseq_orderseq_name_key UNIQUE (orderseq_name);


--
-- TOC entry 7499 (class 2606 OID 146571309)
-- Dependencies: 704 704 8894
-- Name: orderseq_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY orderseq
    ADD CONSTRAINT orderseq_pkey PRIMARY KEY (orderseq_id);


--
-- TOC entry 7501 (class 2606 OID 146571311)
-- Dependencies: 706 706 8894
-- Name: pack_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pack
    ADD CONSTRAINT pack_pkey PRIMARY KEY (pack_id);


--
-- TOC entry 7505 (class 2606 OID 146571313)
-- Dependencies: 708 708 708 8894
-- Name: payaropen_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY payaropen
    ADD CONSTRAINT payaropen_pkey PRIMARY KEY (payaropen_ccpay_id, payaropen_aropen_id);


--
-- TOC entry 6960 (class 2606 OID 146571315)
-- Dependencies: 264 264 8894
-- Name: period_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY period
    ADD CONSTRAINT period_pkey PRIMARY KEY (period_id);


--
-- TOC entry 7538 (class 2606 OID 146571317)
-- Dependencies: 739 739 8894
-- Name: pk_prjtype; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prjtype
    ADD CONSTRAINT pk_prjtype PRIMARY KEY (prjtype_id);


--
-- TOC entry 7509 (class 2606 OID 146571319)
-- Dependencies: 711 711 8894
-- Name: pkgdep_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgdep
    ADD CONSTRAINT pkgdep_pkey PRIMARY KEY (pkgdep_id);


--
-- TOC entry 7511 (class 2606 OID 146571321)
-- Dependencies: 713 713 8894
-- Name: pkghead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkghead
    ADD CONSTRAINT pkghead_pkey PRIMARY KEY (pkghead_id);


--
-- TOC entry 7513 (class 2606 OID 146571323)
-- Dependencies: 715 715 8894
-- Name: pkgitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgitem
    ADD CONSTRAINT pkgitem_pkey PRIMARY KEY (pkgitem_id);


--
-- TOC entry 7515 (class 2606 OID 146571325)
-- Dependencies: 715 715 715 715 8894
-- Name: pkgitem_pkgitem_pkghead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgitem
    ADD CONSTRAINT pkgitem_pkgitem_pkghead_id_key UNIQUE (pkgitem_pkghead_id, pkgitem_type, pkgitem_name);


--
-- TOC entry 7517 (class 2606 OID 146571327)
-- Dependencies: 715 715 715 715 8894
-- Name: pkgitem_pkgitem_pkghead_id_key1; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pkgitem
    ADD CONSTRAINT pkgitem_pkgitem_pkghead_id_key1 UNIQUE (pkgitem_pkghead_id, pkgitem_type, pkgitem_item_id);


--
-- TOC entry 7060 (class 2606 OID 146571329)
-- Dependencies: 326 326 8894
-- Name: plancode_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY plancode
    ADD CONSTRAINT plancode_pkey PRIMARY KEY (plancode_id);


--
-- TOC entry 7062 (class 2606 OID 146571331)
-- Dependencies: 326 326 8894
-- Name: plancode_plancode_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY plancode
    ADD CONSTRAINT plancode_plancode_code_key UNIQUE (plancode_code);


--
-- TOC entry 6784 (class 2606 OID 146571333)
-- Dependencies: 197 197 8894
-- Name: pohead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pkey PRIMARY KEY (pohead_id);


--
-- TOC entry 6786 (class 2606 OID 146571335)
-- Dependencies: 197 197 8894
-- Name: pohead_pohead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_number_key UNIQUE (pohead_number);


--
-- TOC entry 6791 (class 2606 OID 146571337)
-- Dependencies: 198 198 8894
-- Name: poitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_pkey PRIMARY KEY (poitem_id);


--
-- TOC entry 6794 (class 2606 OID 146571339)
-- Dependencies: 198 198 198 8894
-- Name: poitem_poitem_pohead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_pohead_id_key UNIQUE (poitem_pohead_id, poitem_linenumber);


--
-- TOC entry 7522 (class 2606 OID 146571341)
-- Dependencies: 724 724 8894
-- Name: poreject_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY poreject
    ADD CONSTRAINT poreject_pkey PRIMARY KEY (poreject_id);


--
-- TOC entry 7524 (class 2606 OID 146571343)
-- Dependencies: 726 726 8894
-- Name: potype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY potype
    ADD CONSTRAINT potype_pkey PRIMARY KEY (potype_id);


--
-- TOC entry 7526 (class 2606 OID 146571345)
-- Dependencies: 728 728 8894
-- Name: pr_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY pr
    ADD CONSTRAINT pr_pkey PRIMARY KEY (pr_id);


--
-- TOC entry 7528 (class 2606 OID 146571347)
-- Dependencies: 730 730 8894
-- Name: prftcntr_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prftcntr
    ADD CONSTRAINT prftcntr_pkey PRIMARY KEY (prftcntr_id);


--
-- TOC entry 7530 (class 2606 OID 146571349)
-- Dependencies: 730 730 8894
-- Name: prftcntr_prftcntr_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prftcntr
    ADD CONSTRAINT prftcntr_prftcntr_number_key UNIQUE (prftcntr_number);


--
-- TOC entry 7180 (class 2606 OID 146571351)
-- Dependencies: 408 408 8894
-- Name: priv_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY priv
    ADD CONSTRAINT priv_pkey PRIMARY KEY (priv_id);


--
-- TOC entry 6892 (class 2606 OID 146571353)
-- Dependencies: 225 225 8894
-- Name: prj_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_pkey PRIMARY KEY (prj_id);


--
-- TOC entry 6894 (class 2606 OID 146571355)
-- Dependencies: 225 225 8894
-- Name: prj_prj_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_prj_number_key UNIQUE (prj_number);


--
-- TOC entry 6912 (class 2606 OID 146571357)
-- Dependencies: 232 232 8894
-- Name: prjtask_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prjtask
    ADD CONSTRAINT prjtask_pkey PRIMARY KEY (prjtask_id);


--
-- TOC entry 6914 (class 2606 OID 146571359)
-- Dependencies: 232 232 232 8894
-- Name: prjtask_prjtask_prj_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prjtask
    ADD CONSTRAINT prjtask_prjtask_prj_id_key UNIQUE (prjtask_prj_id, prjtask_number);


--
-- TOC entry 7536 (class 2606 OID 146571361)
-- Dependencies: 737 737 8894
-- Name: prjtaskuser_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prjtaskuser
    ADD CONSTRAINT prjtaskuser_pkey PRIMARY KEY (prjtaskuser_id);


--
-- TOC entry 7040 (class 2606 OID 146571363)
-- Dependencies: 314 314 8894
-- Name: prodcat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prodcat
    ADD CONSTRAINT prodcat_pkey PRIMARY KEY (prodcat_id);


--
-- TOC entry 7042 (class 2606 OID 146571365)
-- Dependencies: 314 314 8894
-- Name: prodcat_prodcat_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prodcat
    ADD CONSTRAINT prodcat_prodcat_code_key UNIQUE (prodcat_code);


--
-- TOC entry 7113 (class 2606 OID 146571367)
-- Dependencies: 356 356 8894
-- Name: prospect_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_pkey PRIMARY KEY (prospect_id);


--
-- TOC entry 7115 (class 2606 OID 146571369)
-- Dependencies: 356 356 8894
-- Name: prospect_prospect_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_prospect_number_key UNIQUE (prospect_number);


--
-- TOC entry 7542 (class 2606 OID 146571371)
-- Dependencies: 742 742 8894
-- Name: qryhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY qryhead
    ADD CONSTRAINT qryhead_pkey PRIMARY KEY (qryhead_id);


--
-- TOC entry 7544 (class 2606 OID 146571373)
-- Dependencies: 742 742 8894
-- Name: qryhead_qryhead_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY qryhead
    ADD CONSTRAINT qryhead_qryhead_name_key UNIQUE (qryhead_name);


--
-- TOC entry 7546 (class 2606 OID 146571375)
-- Dependencies: 744 744 744 8894
-- Name: qryitem_qryitem_qryhead_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY qryitem
    ADD CONSTRAINT qryitem_qryitem_qryhead_id_key UNIQUE (qryitem_qryhead_id, qryitem_name);


--
-- TOC entry 7548 (class 2606 OID 146571377)
-- Dependencies: 744 744 744 8894
-- Name: qryitem_qryitem_qryhead_id_key1; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY qryitem
    ADD CONSTRAINT qryitem_qryitem_qryhead_id_key1 UNIQUE (qryitem_qryhead_id, qryitem_order);


--
-- TOC entry 7129 (class 2606 OID 146571379)
-- Dependencies: 367 367 8894
-- Name: quhead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_pkey PRIMARY KEY (quhead_id);


--
-- TOC entry 7131 (class 2606 OID 146571381)
-- Dependencies: 367 367 8894
-- Name: quhead_quhead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_number_key UNIQUE (quhead_number);


--
-- TOC entry 7133 (class 2606 OID 146571383)
-- Dependencies: 370 370 8894
-- Name: quitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY quitem
    ADD CONSTRAINT quitem_pkey PRIMARY KEY (quitem_id);


--
-- TOC entry 7550 (class 2606 OID 146571385)
-- Dependencies: 748 748 8894
-- Name: rcalitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY rcalitem
    ADD CONSTRAINT rcalitem_pkey PRIMARY KEY (rcalitem_id);


--
-- TOC entry 7552 (class 2606 OID 146571387)
-- Dependencies: 749 749 8894
-- Name: recur_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY recur
    ADD CONSTRAINT recur_pkey PRIMARY KEY (recur_id);


--
-- TOC entry 7554 (class 2606 OID 146571389)
-- Dependencies: 749 749 749 8894
-- Name: recur_recur_parent_id_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY recur
    ADD CONSTRAINT recur_recur_parent_id_key UNIQUE (recur_parent_id, recur_parent_type);


--
-- TOC entry 7556 (class 2606 OID 146571391)
-- Dependencies: 751 751 8894
-- Name: recurtype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY recurtype
    ADD CONSTRAINT recurtype_pkey PRIMARY KEY (recurtype_id);


--
-- TOC entry 7558 (class 2606 OID 146571393)
-- Dependencies: 751 751 8894
-- Name: recurtype_recurtype_type_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY recurtype
    ADD CONSTRAINT recurtype_recurtype_type_key UNIQUE (recurtype_type);


--
-- TOC entry 7520 (class 2606 OID 146571395)
-- Dependencies: 721 721 8894
-- Name: recv_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_pkey PRIMARY KEY (recv_id);


--
-- TOC entry 7185 (class 2606 OID 146571397)
-- Dependencies: 411 411 8894
-- Name: report_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY report
    ADD CONSTRAINT report_pkey PRIMARY KEY (report_id);


--
-- TOC entry 7560 (class 2606 OID 146571399)
-- Dependencies: 755 755 8894
-- Name: rjctcode_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY rjctcode
    ADD CONSTRAINT rjctcode_pkey PRIMARY KEY (rjctcode_id);


--
-- TOC entry 7562 (class 2606 OID 146571401)
-- Dependencies: 755 755 8894
-- Name: rjctcode_rjctcode_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY rjctcode
    ADD CONSTRAINT rjctcode_rjctcode_code_key UNIQUE (rjctcode_code);


--
-- TOC entry 6858 (class 2606 OID 146571403)
-- Dependencies: 214 214 8894
-- Name: rsncode_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY rsncode
    ADD CONSTRAINT rsncode_pkey PRIMARY KEY (rsncode_id);


--
-- TOC entry 6860 (class 2606 OID 146571405)
-- Dependencies: 214 214 8894
-- Name: rsncode_rsncode_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY rsncode
    ADD CONSTRAINT rsncode_rsncode_code_key UNIQUE (rsncode_code);


--
-- TOC entry 7564 (class 2606 OID 146571407)
-- Dependencies: 758 758 8894
-- Name: sale_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY sale
    ADD CONSTRAINT sale_pkey PRIMARY KEY (sale_id);


--
-- TOC entry 7566 (class 2606 OID 146571409)
-- Dependencies: 758 758 8894
-- Name: sale_sale_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY sale
    ADD CONSTRAINT sale_sale_name_key UNIQUE (sale_name);


--
-- TOC entry 7324 (class 2606 OID 146571411)
-- Dependencies: 540 540 8894
-- Name: salesaccnt_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY salesaccnt
    ADD CONSTRAINT salesaccnt_pkey PRIMARY KEY (salesaccnt_id);


--
-- TOC entry 6862 (class 2606 OID 146571413)
-- Dependencies: 215 215 8894
-- Name: salescat_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY salescat
    ADD CONSTRAINT salescat_pkey PRIMARY KEY (salescat_id);


--
-- TOC entry 6864 (class 2606 OID 146571415)
-- Dependencies: 215 215 8894
-- Name: salescat_salescat_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY salescat
    ADD CONSTRAINT salescat_salescat_name_key UNIQUE (salescat_name);


--
-- TOC entry 6866 (class 2606 OID 146571417)
-- Dependencies: 216 216 8894
-- Name: salesrep_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY salesrep
    ADD CONSTRAINT salesrep_pkey PRIMARY KEY (salesrep_id);


--
-- TOC entry 6868 (class 2606 OID 146571419)
-- Dependencies: 216 216 8894
-- Name: salesrep_salesrep_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY salesrep
    ADD CONSTRAINT salesrep_salesrep_number_key UNIQUE (salesrep_number);


--
-- TOC entry 6896 (class 2606 OID 146571421)
-- Dependencies: 226 226 8894
-- Name: saletype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY saletype
    ADD CONSTRAINT saletype_pkey PRIMARY KEY (saletype_id);


--
-- TOC entry 7568 (class 2606 OID 146571423)
-- Dependencies: 766 766 8894
-- Name: schemaord_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY schemaord
    ADD CONSTRAINT schemaord_pkey PRIMARY KEY (schemaord_id);


--
-- TOC entry 7570 (class 2606 OID 146571425)
-- Dependencies: 766 766 8894
-- Name: schemaord_schemaord_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY schemaord
    ADD CONSTRAINT schemaord_schemaord_name_key UNIQUE (schemaord_name);


--
-- TOC entry 7572 (class 2606 OID 146571427)
-- Dependencies: 766 766 8894
-- Name: schemaord_schemaord_order_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY schemaord
    ADD CONSTRAINT schemaord_schemaord_order_key UNIQUE (schemaord_order);


--
-- TOC entry 7189 (class 2606 OID 146571429)
-- Dependencies: 414 414 8894
-- Name: script_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY script
    ADD CONSTRAINT script_pkey PRIMARY KEY (script_id);


--
-- TOC entry 7005 (class 2606 OID 146571431)
-- Dependencies: 293 293 8894
-- Name: shift_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shift
    ADD CONSTRAINT shift_pkey PRIMARY KEY (shift_id);


--
-- TOC entry 6983 (class 2606 OID 146571433)
-- Dependencies: 281 281 8894
-- Name: shipchrg_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipchrg
    ADD CONSTRAINT shipchrg_pkey PRIMARY KEY (shipchrg_id);


--
-- TOC entry 7008 (class 2606 OID 146571435)
-- Dependencies: 297 297 297 297 297 8894
-- Name: shipdata_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipdata
    ADD CONSTRAINT shipdata_pkey PRIMARY KEY (shipdata_cohead_number, shipdata_cosmisc_tracknum, shipdata_cosmisc_packnum_tracknum, shipdata_void_ind);


--
-- TOC entry 7576 (class 2606 OID 146571437)
-- Dependencies: 771 771 771 771 8894
-- Name: shipdatasum_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipdatasum
    ADD CONSTRAINT shipdatasum_pkey PRIMARY KEY (shipdatasum_cohead_number, shipdatasum_cosmisc_tracknum, shipdatasum_cosmisc_packnum_tracknum);


--
-- TOC entry 6985 (class 2606 OID 146571439)
-- Dependencies: 282 282 8894
-- Name: shipform_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipform
    ADD CONSTRAINT shipform_pkey PRIMARY KEY (shipform_id);


--
-- TOC entry 6987 (class 2606 OID 146571441)
-- Dependencies: 282 282 8894
-- Name: shipform_shipform_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipform
    ADD CONSTRAINT shipform_shipform_name_key UNIQUE (shipform_name);


--
-- TOC entry 7304 (class 2606 OID 146571443)
-- Dependencies: 526 526 8894
-- Name: shiphead_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shiphead
    ADD CONSTRAINT shiphead_pkey PRIMARY KEY (shiphead_id);


--
-- TOC entry 7306 (class 2606 OID 146571445)
-- Dependencies: 526 526 8894
-- Name: shiphead_shiphead_number_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shiphead
    ADD CONSTRAINT shiphead_shiphead_number_key UNIQUE (shiphead_number);


--
-- TOC entry 7311 (class 2606 OID 146571447)
-- Dependencies: 527 527 8894
-- Name: shipitem_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipitem
    ADD CONSTRAINT shipitem_pkey PRIMARY KEY (shipitem_id);


--
-- TOC entry 6875 (class 2606 OID 146571449)
-- Dependencies: 219 219 219 8894
-- Name: shipto_num_cust_unique; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shipto_num_cust_unique UNIQUE (shipto_cust_id, shipto_num);


--
-- TOC entry 6877 (class 2606 OID 146571451)
-- Dependencies: 219 219 8894
-- Name: shipto_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shipto_pkey PRIMARY KEY (shipto_id);


--
-- TOC entry 7151 (class 2606 OID 146571453)
-- Dependencies: 386 386 8894
-- Name: shipvia_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipvia
    ADD CONSTRAINT shipvia_pkey PRIMARY KEY (shipvia_id);


--
-- TOC entry 7153 (class 2606 OID 146571455)
-- Dependencies: 386 386 8894
-- Name: shipvia_shipvia_code_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipvia
    ADD CONSTRAINT shipvia_shipvia_code_key UNIQUE (shipvia_code);


--
-- TOC entry 6898 (class 2606 OID 146571457)
-- Dependencies: 227 227 8894
-- Name: shipzone_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipzone
    ADD CONSTRAINT shipzone_pkey PRIMARY KEY (shipzone_id);


--
-- TOC entry 6900 (class 2606 OID 146571459)
-- Dependencies: 227 227 8894
-- Name: shipzone_shipzone_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY shipzone
    ADD CONSTRAINT shipzone_shipzone_name_key UNIQUE (shipzone_name);


--
-- TOC entry 7155 (class 2606 OID 146571461)
-- Dependencies: 387 387 8894
-- Name: sitetype_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY sitetype
    ADD CONSTRAINT sitetype_pkey PRIMARY KEY (sitetype_id);


--
-- TOC entry 7157 (class 2606 OID 146571463)
-- Dependencies: 387 387 8894
-- Name: sitetype_sitetype_name_key; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY sitetype
    ADD CONSTRAINT sitetype_sitetype_name_key UNIQUE (sitetype_name);


--
-- TOC entry 7578 (class 2606 OID 146571465)
-- Dependencies: 781 781 8894
-- Name: sltrans_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY sltrans
    ADD CONSTRAINT sltrans_pkey PRIMARY KEY (sltrans_id);


--
-- TOC entry 7584 (class 2606 OID 146571467)
-- Dependencies: 785 785 8894
-- Name: source_pkey; Type: CONSTRAINT; Schema: public; Owner: admin; Tablespace: 
--

ALTER TABLE ONLY source
    ADD CONSTRAINT source_pkey PRIMARY KEY (source_id);


--
-- TOC entry 7586 (class 2606 OID 146571469)
-- Dependencies: 785 785 8894
