--
-- PostgreSQL database dump
--

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

--
-- Name: vegbien; Type: DATABASE; Schema: -; Owner: postgres
--

CREATE DATABASE vegbien WITH TEMPLATE = template0 ENCODING = 'UTF8';


ALTER DATABASE vegbien OWNER TO postgres;

\connect vegbien

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

SET search_path = public, pg_catalog;

--
-- Name: concat(text); Type: AGGREGATE; Schema: public; Owner: bien
--

CREATE AGGREGATE concat(text) (
    SFUNC = textcat,
    STYPE = text,
    INITCOND = ''
);


ALTER AGGREGATE public.concat(text) OWNER TO bien;

SET default_tablespace = '';

SET default_with_oids = true;

--
-- Name: address; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE address (
    address_id integer NOT NULL,
    party_id integer NOT NULL,
    organization_id integer,
    orgposition character varying(50),
    email character varying(100),
    deliverypoint character varying(200),
    city character varying(50),
    administrativearea character varying(50),
    postalcode character varying(10),
    country character varying(50),
    currentflag boolean,
    addressstartdate timestamp with time zone
);


ALTER TABLE public.address OWNER TO bien;

--
-- Name: address_address_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.address_address_id_seq OWNER TO bien;

--
-- Name: address_address_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE address_address_id_seq OWNED BY address.address_id;


--
-- Name: aux_role; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE aux_role (
    role_id integer NOT NULL,
    rolecode character varying(30) NOT NULL,
    roledescription character varying(200),
    roleproject integer,
    roleobservation integer,
    roletaxonint integer,
    roleclassint integer,
    accessioncode character varying(255)
);


ALTER TABLE public.aux_role OWNER TO bien;

--
-- Name: aux_role_role_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.aux_role_role_id_seq OWNER TO bien;

--
-- Name: aux_role_role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE aux_role_role_id_seq OWNED BY aux_role.role_id;


--
-- Name: classcontributor; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE classcontributor (
    classcontributor_id integer NOT NULL,
    commclass_id integer NOT NULL,
    party_id integer NOT NULL,
    role_id integer,
    emb_classcontributor integer
);


ALTER TABLE public.classcontributor OWNER TO bien;

--
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.classcontributor_classcontributor_id_seq OWNER TO bien;

--
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE classcontributor_classcontributor_id_seq OWNED BY classcontributor.classcontributor_id;


--
-- Name: commclass; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commclass (
    commclass_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    inspection boolean,
    tableanalysis boolean,
    multivariateanalysis boolean,
    classpublication_id integer,
    classnotes text,
    commname character varying(200),
    commcode character varying(200),
    commframework character varying(200),
    commlevel character varying(200),
    classstartdate timestamp with time zone,
    classstopdate timestamp with time zone,
    emb_commclass integer,
    expertsystem text,
    accessioncode character varying(255)
);


ALTER TABLE public.commclass OWNER TO bien;

--
-- Name: commclass_commclass_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commclass_commclass_id_seq OWNER TO bien;

--
-- Name: commclass_commclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commclass_commclass_id_seq OWNED BY commclass.commclass_id;


--
-- Name: commconcept; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commconcept (
    commconcept_id integer NOT NULL,
    commname_id integer NOT NULL,
    reference_id integer,
    commdescription text,
    d_obscount integer,
    commname text,
    d_currentaccepted boolean,
    accessioncode character varying(255)
);


ALTER TABLE public.commconcept OWNER TO bien;

--
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commconcept_commconcept_id_seq OWNER TO bien;

--
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commconcept_commconcept_id_seq OWNED BY commconcept.commconcept_id;


--
-- Name: commcorrelation; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commcorrelation (
    commcorrelation_id integer NOT NULL,
    commstatus_id integer NOT NULL,
    commconcept_id integer NOT NULL,
    commconvergence character varying(20) NOT NULL,
    correlationstart timestamp with time zone NOT NULL,
    correlationstop timestamp with time zone
);


ALTER TABLE public.commcorrelation OWNER TO bien;

--
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commcorrelation_commcorrelation_id_seq OWNER TO bien;

--
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commcorrelation_commcorrelation_id_seq OWNED BY commcorrelation.commcorrelation_id;


--
-- Name: comminterpretation; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE comminterpretation (
    comminterpretation_id integer NOT NULL,
    commclass_id integer NOT NULL,
    commconcept_id integer,
    commcode character varying(34),
    commname character varying(200),
    classfit character varying(50),
    classconfidence character varying(15),
    commauthority_id integer,
    notes text,
    type boolean,
    nomenclaturaltype boolean,
    emb_comminterpretation integer
);


ALTER TABLE public.comminterpretation OWNER TO bien;

--
-- Name: comminterpretation_comminterpretation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.comminterpretation_comminterpretation_id_seq OWNER TO bien;

--
-- Name: comminterpretation_comminterpretation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE comminterpretation_comminterpretation_id_seq OWNED BY comminterpretation.comminterpretation_id;


--
-- Name: commlineage; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commlineage (
    commlineage_id integer NOT NULL,
    parentcommstatus_id integer NOT NULL,
    childcommstatus_id integer NOT NULL
);


ALTER TABLE public.commlineage OWNER TO bien;

--
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commlineage_commlineage_id_seq OWNER TO bien;

--
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commlineage_commlineage_id_seq OWNED BY commlineage.commlineage_id;


--
-- Name: commname; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commname (
    commname_id integer NOT NULL,
    commname text NOT NULL,
    reference_id integer,
    dateentered timestamp with time zone DEFAULT now()
);


ALTER TABLE public.commname OWNER TO bien;

--
-- Name: commname_commname_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commname_commname_id_seq OWNER TO bien;

--
-- Name: commname_commname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commname_commname_id_seq OWNED BY commname.commname_id;


--
-- Name: commstatus; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commstatus (
    commstatus_id integer NOT NULL,
    commconcept_id integer NOT NULL,
    reference_id integer,
    commconceptstatus character varying(20) NOT NULL,
    commparent_id integer,
    commlevel character varying(80),
    commpartycomments text,
    party_id integer NOT NULL,
    startdate timestamp with time zone NOT NULL,
    stopdate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.commstatus OWNER TO bien;

--
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commstatus_commstatus_id_seq OWNER TO bien;

--
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commstatus_commstatus_id_seq OWNED BY commstatus.commstatus_id;


--
-- Name: commusage; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE commusage (
    commusage_id integer NOT NULL,
    commname_id integer NOT NULL,
    commname text,
    commconcept_id integer,
    commnamestatus character varying(20),
    classsystem character varying(50),
    party_id integer,
    commstatus_id integer,
    usagestart timestamp with time zone,
    usagestop timestamp with time zone
);


ALTER TABLE public.commusage OWNER TO bien;

--
-- Name: commusage_commusage_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.commusage_commusage_id_seq OWNER TO bien;

--
-- Name: commusage_commusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE commusage_commusage_id_seq OWNED BY commusage.commusage_id;


--
-- Name: coverindex; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE coverindex (
    coverindex_id integer NOT NULL,
    covermethod_id integer NOT NULL,
    covercode character varying(10) NOT NULL,
    upperlimit double precision,
    lowerlimit double precision,
    coverpercent double precision NOT NULL,
    indexdescription text
);


ALTER TABLE public.coverindex OWNER TO bien;

--
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.coverindex_coverindex_id_seq OWNER TO bien;

--
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE coverindex_coverindex_id_seq OWNED BY coverindex.coverindex_id;


--
-- Name: covermethod; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE covermethod (
    covermethod_id integer NOT NULL,
    reference_id integer,
    covertype character varying(30) NOT NULL,
    coverestimationmethod character varying(80),
    accessioncode character varying(255)
);


ALTER TABLE public.covermethod OWNER TO bien;

--
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.covermethod_covermethod_id_seq OWNER TO bien;

--
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE covermethod_covermethod_id_seq OWNED BY covermethod.covermethod_id;


--
-- Name: dba_confidentialitystatus; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_confidentialitystatus (
    confidentialitystatus integer NOT NULL,
    confidentialitytext character varying(100),
    confidentialityshorttext character varying(100)
);


ALTER TABLE public.dba_confidentialitystatus OWNER TO bien;

--
-- Name: dba_cookie; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_cookie (
    cookie_id integer NOT NULL,
    cookiename character varying(75) NOT NULL,
    defaultvalue character varying(75) NOT NULL,
    viewname character varying(25) NOT NULL,
    description text,
    examplepk integer NOT NULL,
    sortorder integer,
    startgroup boolean,
    prefixhtml text,
    suffixhtml text
);


ALTER TABLE public.dba_cookie OWNER TO bien;

--
-- Name: dba_cookie_cookie_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_cookie_cookie_id_seq OWNER TO bien;

--
-- Name: dba_cookie_cookie_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_cookie_cookie_id_seq OWNED BY dba_cookie.cookie_id;


--
-- Name: dba_cookielabels; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_cookielabels (
    cookielabel_id integer NOT NULL,
    vieworcookie character varying(50) NOT NULL,
    description text
);


ALTER TABLE public.dba_cookielabels OWNER TO bien;

--
-- Name: dba_cookielabels_cookielabel_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_cookielabels_cookielabel_id_seq OWNER TO bien;

--
-- Name: dba_cookielabels_cookielabel_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_cookielabels_cookielabel_id_seq OWNED BY dba_cookielabels.cookielabel_id;


SET default_with_oids = false;

--
-- Name: dba_datacache; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_datacache (
    dba_datacache_id integer NOT NULL,
    cache_key character varying(200) NOT NULL,
    cache_label character varying(200),
    cache_order double precision,
    data1 character varying(255),
    data2 character varying(255),
    data3 character varying(255),
    data4 character varying(255),
    data5 character varying(255),
    data6 character varying(255),
    data7 character varying(255),
    data8 character varying(255),
    data9 character varying(255),
    data10 character varying(255)
);


ALTER TABLE public.dba_datacache OWNER TO bien;

--
-- Name: dba_datacache_dba_datacache_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_datacache_dba_datacache_id_seq OWNER TO bien;

--
-- Name: dba_datacache_dba_datacache_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_datacache_dba_datacache_id_seq OWNED BY dba_datacache.dba_datacache_id;


--
-- Name: dba_datamodelversion; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_datamodelversion (
    dba_datamodelversion_id integer NOT NULL,
    versiontext character varying(20) NOT NULL,
    versionimplemented timestamp with time zone DEFAULT now()
);


ALTER TABLE public.dba_datamodelversion OWNER TO bien;

--
-- Name: dba_datamodelversion_dba_datamodelversion_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_datamodelversion_dba_datamodelversion_id_seq OWNER TO bien;

--
-- Name: dba_datamodelversion_dba_datamodelversion_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_datamodelversion_dba_datamodelversion_id_seq OWNED BY dba_datamodelversion.dba_datamodelversion_id;


SET default_with_oids = true;

--
-- Name: dba_dbstatstime; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_dbstatstime (
    stat_id integer NOT NULL,
    statdate timestamp with time zone,
    statpkg integer,
    statname text,
    stattable character varying(100),
    minpk integer,
    maxpk integer,
    countrecs integer
);


ALTER TABLE public.dba_dbstatstime OWNER TO bien;

--
-- Name: dba_dbstatstime_stat_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_dbstatstime_stat_id_seq OWNER TO bien;

--
-- Name: dba_dbstatstime_stat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_dbstatstime_stat_id_seq OWNED BY dba_dbstatstime.stat_id;


SET default_with_oids = false;

--
-- Name: dba_fielddescription; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_fielddescription (
    dba_fielddescription_id integer NOT NULL,
    tablename character varying(75),
    fieldname character varying(75),
    fieldlabel character varying(200),
    fieldmodel character varying(50),
    fieldnulls character varying(10),
    fieldtype character varying(30),
    fieldkey character varying(10),
    fieldreferences character varying(200),
    fieldlist character varying(50),
    fieldnotes text,
    fielddefinition text,
    fieldkeywords text
);


ALTER TABLE public.dba_fielddescription OWNER TO bien;

--
-- Name: dba_fielddescription_dba_fielddescription_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_fielddescription_dba_fielddescription_id_seq OWNER TO bien;

--
-- Name: dba_fielddescription_dba_fielddescription_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_fielddescription_dba_fielddescription_id_seq OWNED BY dba_fielddescription.dba_fielddescription_id;


--
-- Name: dba_fieldlist; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_fieldlist (
    dba_fieldlist_id integer NOT NULL,
    tablename character varying(75),
    fieldname character varying(75),
    listvalue character varying(255),
    listvaluedescription text,
    listvaluesortorder double precision
);


ALTER TABLE public.dba_fieldlist OWNER TO bien;

--
-- Name: dba_fieldlist_dba_fieldlist_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_fieldlist_dba_fieldlist_id_seq OWNER TO bien;

--
-- Name: dba_fieldlist_dba_fieldlist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_fieldlist_dba_fieldlist_id_seq OWNED BY dba_fieldlist.dba_fieldlist_id;


--
-- Name: dba_onerow; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_onerow (
    dba_onerow_id integer NOT NULL
);


ALTER TABLE public.dba_onerow OWNER TO bien;

--
-- Name: dba_onerow_dba_onerow_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_onerow_dba_onerow_id_seq OWNER TO bien;

--
-- Name: dba_onerow_dba_onerow_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_onerow_dba_onerow_id_seq OWNED BY dba_onerow.dba_onerow_id;


--
-- Name: dba_preassignacccode; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_preassignacccode (
    dba_preassignacccode_id integer NOT NULL,
    dba_requestnumber integer NOT NULL,
    databasekey character varying(20) NOT NULL,
    tableabbrev character varying(10) NOT NULL,
    confirmcode character varying(70) DEFAULT ((replace(replace(replace(replace((now())::text, ' '::text, 'T'::text), '-'::text, ''::text), ':'::text, ''::text), '.'::text, 'd'::text) || 'R'::text) || (floor((random() * (1000000)::double precision)))::text) NOT NULL,
    codeisused boolean,
    accessioncode character varying(255)
);


ALTER TABLE public.dba_preassignacccode OWNER TO bien;

--
-- Name: dba_preassignacccode_dba_preassignacccode_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_preassignacccode_dba_preassignacccode_id_seq OWNER TO bien;

--
-- Name: dba_preassignacccode_dba_preassignacccode_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_preassignacccode_dba_preassignacccode_id_seq OWNED BY dba_preassignacccode.dba_preassignacccode_id;


--
-- Name: dba_preassignacccode_dba_requestnumber_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_preassignacccode_dba_requestnumber_seq OWNER TO bien;

--
-- Name: dba_tabledescription; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_tabledescription (
    dba_tabledescription_id integer NOT NULL,
    tablename character varying(75),
    tablelabel character varying(200),
    tablenotes text,
    tabledescription text,
    tablekeywords text
);


ALTER TABLE public.dba_tabledescription OWNER TO bien;

--
-- Name: dba_tabledescription_dba_tabledescription_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.dba_tabledescription_dba_tabledescription_id_seq OWNER TO bien;

--
-- Name: dba_tabledescription_dba_tabledescription_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE dba_tabledescription_dba_tabledescription_id_seq OWNED BY dba_tabledescription.dba_tabledescription_id;


--
-- Name: dba_xmlcache; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE dba_xmlcache (
    xml bytea,
    accessioncode character varying(255)
);


ALTER TABLE public.dba_xmlcache OWNER TO bien;

SET default_with_oids = true;

--
-- Name: definedvalue; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE definedvalue (
    definedvalue_id integer NOT NULL,
    userdefined_id integer NOT NULL,
    tablerecord_id integer NOT NULL,
    definedvalue text NOT NULL
);


ALTER TABLE public.definedvalue OWNER TO bien;

--
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.definedvalue_definedvalue_id_seq OWNER TO bien;

--
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE definedvalue_definedvalue_id_seq OWNED BY definedvalue.definedvalue_id;


--
-- Name: disturbanceobs; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE disturbanceobs (
    disturbanceobs_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    disturbancetype character varying(30) NOT NULL,
    disturbanceintensity character varying(30),
    disturbanceage double precision,
    disturbanceextent double precision,
    disturbancecomment text,
    emb_disturbanceobs integer
);


ALTER TABLE public.disturbanceobs OWNER TO bien;

--
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.disturbanceobs_disturbanceobs_id_seq OWNER TO bien;

--
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE disturbanceobs_disturbanceobs_id_seq OWNED BY disturbanceobs.disturbanceobs_id;


--
-- Name: embargo; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE embargo (
    embargo_id integer NOT NULL,
    plot_id integer NOT NULL,
    embargoreason text NOT NULL,
    defaultstatus integer NOT NULL,
    embargostart timestamp with time zone NOT NULL,
    embargostop timestamp with time zone NOT NULL
);


ALTER TABLE public.embargo OWNER TO bien;

--
-- Name: embargo_embargo_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.embargo_embargo_id_seq OWNER TO bien;

--
-- Name: embargo_embargo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE embargo_embargo_id_seq OWNED BY embargo.embargo_id;


--
-- Name: graphic; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE graphic (
    graphic_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    graphicname character varying(30),
    graphiclocation text,
    graphicdescription text,
    graphictype character varying(20),
    graphicdata oid,
    graphicdate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.graphic OWNER TO bien;

--
-- Name: graphic_graphic_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.graphic_graphic_id_seq OWNER TO bien;

--
-- Name: graphic_graphic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE graphic_graphic_id_seq OWNED BY graphic.graphic_id;


--
-- Name: keywords; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE keywords (
    table_id integer NOT NULL,
    entity text NOT NULL,
    keywords text
);


ALTER TABLE public.keywords OWNER TO bien;

--
-- Name: keywords_extra; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE keywords_extra (
    table_id integer NOT NULL,
    entity text NOT NULL,
    keywords text
);


ALTER TABLE public.keywords_extra OWNER TO bien;

--
-- Name: namedplace; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE namedplace (
    namedplace_id integer NOT NULL,
    placesystem character varying(50),
    placename character varying(100) NOT NULL,
    placedescription text,
    placecode character varying(15),
    owner character varying(100),
    reference_id integer,
    d_obscount integer,
    accessioncode character varying(255)
);


ALTER TABLE public.namedplace OWNER TO bien;

--
-- Name: namedplace_namedplace_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.namedplace_namedplace_id_seq OWNER TO bien;

--
-- Name: namedplace_namedplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE namedplace_namedplace_id_seq OWNED BY namedplace.namedplace_id;


--
-- Name: namedplacecorrelation; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE namedplacecorrelation (
    namedplacecorrelation_id integer NOT NULL,
    parentplace_id integer NOT NULL,
    childplace_id integer NOT NULL,
    placeconvergence character varying(20) NOT NULL
);


ALTER TABLE public.namedplacecorrelation OWNER TO bien;

--
-- Name: namedplacecorrelation_namedplacecorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.namedplacecorrelation_namedplacecorrelation_id_seq OWNER TO bien;

--
-- Name: namedplacecorrelation_namedplacecorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE namedplacecorrelation_namedplacecorrelation_id_seq OWNED BY namedplacecorrelation.namedplacecorrelation_id;


--
-- Name: note; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE note (
    note_id integer NOT NULL,
    notelink_id integer NOT NULL,
    party_id integer NOT NULL,
    role_id integer NOT NULL,
    notetype character varying(20) NOT NULL,
    notetext text NOT NULL,
    notedate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.note OWNER TO bien;

--
-- Name: note_note_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.note_note_id_seq OWNER TO bien;

--
-- Name: note_note_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE note_note_id_seq OWNED BY note.note_id;


--
-- Name: notelink; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE notelink (
    notelink_id integer NOT NULL,
    tablename character varying(50) NOT NULL,
    attributename character varying(50),
    tablerecord integer NOT NULL
);


ALTER TABLE public.notelink OWNER TO bien;

--
-- Name: notelink_notelink_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.notelink_notelink_id_seq OWNER TO bien;

--
-- Name: notelink_notelink_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE notelink_notelink_id_seq OWNED BY notelink.notelink_id;


--
-- Name: plotevent; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plotevent (
    plotevent_id integer NOT NULL,
    previousobs_id integer,
    plot_id integer NOT NULL,
    project_id integer,
    authorobscode character varying(30),
    dateaccuracy character varying(30),
    covermethod_id integer,
    coverdispersion character varying(30),
    autotaxoncover boolean,
    stratummethod_id integer,
    methodnarrative text,
    taxonobservationarea double precision,
    stemsizelimit double precision,
    stemobservationarea double precision,
    stemsamplemethod character varying(30),
    originaldata text,
    effortlevel character varying(30),
    plotvalidationlevel integer,
    floristicquality character varying(30),
    bryophytequality character varying(30),
    lichenquality character varying(30),
    observationnarrative text,
    landscapenarrative text,
    homogeneity character varying(50),
    phenologicaspect character varying(30),
    representativeness character varying(255),
    standmaturity character varying(50),
    successionalstatus text,
    basalarea double precision,
    hydrologicregime character varying(30),
    soilmoistureregime character varying(30),
    soildrainage character varying(30),
    watersalinity character varying(30),
    waterdepth double precision,
    shoredistance double precision,
    soildepth double precision,
    organicdepth double precision,
    soiltaxon_id integer,
    soiltaxonsrc character varying(200),
    percentbedrock double precision,
    percentrockgravel double precision,
    percentwood double precision,
    percentlitter double precision,
    percentbaresoil double precision,
    percentwater double precision,
    percentother double precision,
    nameother character varying(30),
    treeht double precision,
    shrubht double precision,
    fieldht double precision,
    nonvascularht double precision,
    submergedht double precision,
    treecover double precision,
    shrubcover double precision,
    fieldcover double precision,
    nonvascularcover double precision,
    floatingcover double precision,
    submergedcover double precision,
    dominantstratum character varying(40),
    growthform1type character varying(40),
    growthform2type character varying(40),
    growthform3type character varying(40),
    growthform1cover double precision,
    growthform2cover double precision,
    growthform3cover double precision,
    totalcover double precision,
    notespublic boolean,
    notesmgt boolean,
    revisions boolean,
    obsstartdate timestamp with time zone,
    obsenddate timestamp with time zone,
    dateentered timestamp with time zone DEFAULT now(),
    emb_observation integer,
    interp_orig_ci_id integer,
    interp_orig_cc_id integer,
    interp_orig_sciname text,
    interp_orig_code text,
    interp_orig_party_id integer,
    interp_orig_partyname text,
    interp_current_ci_id integer,
    interp_current_cc_id integer,
    interp_current_sciname text,
    interp_current_code text,
    interp_current_party_id integer,
    interp_current_partyname text,
    interp_bestfit_ci_id integer,
    interp_bestfit_cc_id integer,
    interp_bestfit_sciname text,
    interp_bestfit_code text,
    interp_bestfit_party_id integer,
    interp_bestfit_partyname text,
    toptaxon1name character varying(255),
    toptaxon2name character varying(255),
    toptaxon3name character varying(255),
    toptaxon4name character varying(255),
    toptaxon5name character varying(255),
    numberoftaxa integer,
    accessioncode character varying(255)
);


ALTER TABLE public.plotevent OWNER TO bien;

--
-- Name: observation_observation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.observation_observation_id_seq OWNER TO bien;

--
-- Name: observation_observation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE observation_observation_id_seq OWNED BY plotevent.plotevent_id;


--
-- Name: observationcontributor; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE observationcontributor (
    observationcontributor_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    party_id integer NOT NULL,
    role_id integer NOT NULL,
    contributiondate timestamp with time zone
);


ALTER TABLE public.observationcontributor OWNER TO bien;

--
-- Name: observationcontributor_observationcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.observationcontributor_observationcontributor_id_seq OWNER TO bien;

--
-- Name: observationcontributor_observationcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE observationcontributor_observationcontributor_id_seq OWNED BY observationcontributor.observationcontributor_id;


--
-- Name: observationsynonym; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE observationsynonym (
    observationsynonym_id integer NOT NULL,
    synonymobservation_id integer NOT NULL,
    primaryobservation_id integer NOT NULL,
    party_id integer NOT NULL,
    role_id integer NOT NULL,
    synonymcomment text,
    classstartdate timestamp with time zone DEFAULT now() NOT NULL,
    classstopdate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.observationsynonym OWNER TO bien;

--
-- Name: observationsynonym_observationsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.observationsynonym_observationsynonym_id_seq OWNER TO bien;

--
-- Name: observationsynonym_observationsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE observationsynonym_observationsynonym_id_seq OWNED BY observationsynonym.observationsynonym_id;


--
-- Name: party; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE party (
    party_id integer NOT NULL,
    salutation character varying(20),
    givenname character varying(50),
    middlename character varying(50),
    surname character varying(50),
    organizationname character varying(100),
    currentname_id integer,
    contactinstructions text,
    email character varying(120),
    partytype character varying(40),
    partypublic boolean DEFAULT true,
    d_obscount integer,
    accessioncode character varying(255)
);


ALTER TABLE public.party OWNER TO bien;

--
-- Name: party_party_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.party_party_id_seq OWNER TO bien;

--
-- Name: party_party_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE party_party_id_seq OWNED BY party.party_id;


--
-- Name: partymember; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE partymember (
    partymember_id integer NOT NULL,
    parentparty_id integer NOT NULL,
    childparty_id integer NOT NULL,
    role_id integer,
    memberstart timestamp with time zone DEFAULT now() NOT NULL,
    memberstop timestamp with time zone
);


ALTER TABLE public.partymember OWNER TO bien;

--
-- Name: partymember_partymember_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.partymember_partymember_id_seq OWNER TO bien;

--
-- Name: partymember_partymember_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE partymember_partymember_id_seq OWNED BY partymember.partymember_id;


--
-- Name: place; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE place (
    plotplace_id integer NOT NULL,
    plot_id integer NOT NULL,
    calculated boolean,
    namedplace_id integer NOT NULL
);


ALTER TABLE public.place OWNER TO bien;

--
-- Name: place_plotplace_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.place_plotplace_id_seq OWNER TO bien;

--
-- Name: place_plotplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE place_plotplace_id_seq OWNED BY place.plotplace_id;


--
-- Name: plantconcept; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantconcept (
    plantconcept_id integer NOT NULL,
    plantname_id integer NOT NULL,
    reference_id integer NOT NULL,
    plantname character varying(200),
    plantcode character varying(23),
    plantdescription text,
    d_obscount integer,
    d_currentaccepted boolean,
    accessioncode character varying(255)
);


ALTER TABLE public.plantconcept OWNER TO bien;

--
-- Name: plantconcept_plantconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantconcept_plantconcept_id_seq OWNER TO bien;

--
-- Name: plantconcept_plantconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantconcept_plantconcept_id_seq OWNED BY plantconcept.plantconcept_id;


--
-- Name: plantcorrelation; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantcorrelation (
    plantcorrelation_id integer NOT NULL,
    plantstatus_id integer NOT NULL,
    plantconcept_id integer NOT NULL,
    plantconvergence character varying(20) NOT NULL,
    correlationstart timestamp with time zone NOT NULL,
    correlationstop timestamp with time zone
);


ALTER TABLE public.plantcorrelation OWNER TO bien;

--
-- Name: plantcorrelation_plantcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantcorrelation_plantcorrelation_id_seq OWNER TO bien;

--
-- Name: plantcorrelation_plantcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantcorrelation_plantcorrelation_id_seq OWNED BY plantcorrelation.plantcorrelation_id;


--
-- Name: plantlineage; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantlineage (
    plantlineage_id integer NOT NULL,
    childplantstatus_id integer NOT NULL,
    parentplantstatus_id integer NOT NULL
);


ALTER TABLE public.plantlineage OWNER TO bien;

--
-- Name: plantlineage_plantlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantlineage_plantlineage_id_seq OWNER TO bien;

--
-- Name: plantlineage_plantlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantlineage_plantlineage_id_seq OWNED BY plantlineage.plantlineage_id;


--
-- Name: plantname; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantname (
    plantname_id integer NOT NULL,
    plantname character varying(255) NOT NULL,
    reference_id integer,
    dateentered timestamp with time zone DEFAULT now()
);


ALTER TABLE public.plantname OWNER TO bien;

--
-- Name: plantname_plantname_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantname_plantname_id_seq OWNER TO bien;

--
-- Name: plantname_plantname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantname_plantname_id_seq OWNED BY plantname.plantname_id;


--
-- Name: plantstatus; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantstatus (
    plantstatus_id integer NOT NULL,
    plantconcept_id integer NOT NULL,
    reference_id integer,
    plantconceptstatus character varying(20) NOT NULL,
    plantpartycomments text,
    plantparentname character varying(200),
    plantparentconcept_id integer,
    plantparent_id integer,
    plantlevel character varying(80),
    party_id integer NOT NULL,
    startdate timestamp with time zone NOT NULL,
    stopdate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.plantstatus OWNER TO bien;

--
-- Name: plantstatus_plantstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantstatus_plantstatus_id_seq OWNER TO bien;

--
-- Name: plantstatus_plantstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantstatus_plantstatus_id_seq OWNED BY plantstatus.plantstatus_id;


--
-- Name: plantusage; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plantusage (
    plantusage_id integer NOT NULL,
    plantname_id integer NOT NULL,
    plantconcept_id integer,
    plantnamestatus character varying(20),
    plantname character varying(220),
    classsystem character varying(50),
    acceptedsynonym character varying(220),
    party_id integer,
    plantstatus_id integer,
    usagestart timestamp with time zone,
    usagestop timestamp with time zone
);


ALTER TABLE public.plantusage OWNER TO bien;

--
-- Name: plantusage_plantusage_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plantusage_plantusage_id_seq OWNER TO bien;

--
-- Name: plantusage_plantusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plantusage_plantusage_id_seq OWNED BY plantusage.plantusage_id;


--
-- Name: plot; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE plot (
    plot_id integer NOT NULL,
    authorplotcode character varying(30) NOT NULL,
    reference_id integer,
    parent_id integer,
    reallatitude double precision,
    reallongitude double precision,
    locationaccuracy double precision,
    confidentialitystatus integer NOT NULL,
    confidentialityreason character varying(200),
    latitude double precision,
    longitude double precision,
    authore character varying(20),
    authorn character varying(20),
    authorzone character varying(20),
    authordatum character varying(20),
    authorlocation character varying(200),
    locationnarrative text,
    azimuth double precision,
    dsgpoly text,
    shape character varying(50),
    area double precision,
    standsize character varying(50),
    placementmethod character varying(50),
    permanence boolean,
    layoutnarrative text,
    elevation double precision,
    elevationaccuracy double precision,
    elevationrange double precision,
    slopeaspect double precision,
    minslopeaspect double precision,
    maxslopeaspect double precision,
    slopegradient double precision,
    minslopegradient double precision,
    maxslopegradient double precision,
    topoposition character varying(90),
    landform character varying(50),
    surficialdeposits character varying(90),
    rocktype character varying(90),
    stateprovince character varying(55),
    country character varying(100),
    submitter_surname character varying(100),
    submitter_givenname character varying(100),
    submitter_email character varying(100),
    notespublic boolean,
    notesmgt boolean,
    revisions boolean,
    dateentered timestamp with time zone DEFAULT now(),
    emb_plot integer,
    plotrationalenarrative text,
    accessioncode character varying(255)
);


ALTER TABLE public.plot OWNER TO bien;

--
-- Name: plot_plot_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.plot_plot_id_seq OWNER TO bien;

--
-- Name: plot_plot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE plot_plot_id_seq OWNED BY plot.plot_id;


--
-- Name: project; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE project (
    project_id integer NOT NULL,
    projectname character varying(150) NOT NULL,
    projectdescription text,
    startdate timestamp with time zone,
    stopdate timestamp with time zone,
    d_obscount integer,
    d_lastplotaddeddate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.project OWNER TO bien;

--
-- Name: project_project_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.project_project_id_seq OWNER TO bien;

--
-- Name: project_project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE project_project_id_seq OWNED BY project.project_id;


--
-- Name: projectcontributor; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE projectcontributor (
    projectcontributor_id integer NOT NULL,
    project_id integer NOT NULL,
    party_id integer NOT NULL,
    role_id integer,
    surname character varying(50),
    cheatrole character varying(50)
);


ALTER TABLE public.projectcontributor OWNER TO bien;

--
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.projectcontributor_projectcontributor_id_seq OWNER TO bien;

--
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE projectcontributor_projectcontributor_id_seq OWNED BY projectcontributor.projectcontributor_id;


--
-- Name: reference; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE reference (
    reference_id integer NOT NULL,
    shortname character varying(250),
    fulltext text,
    referencetype character varying(250),
    title character varying(250),
    titlesuperior character varying(250),
    referencejournal_id integer,
    volume character varying(250),
    issue character varying(250),
    pagerange character varying(250),
    totalpages integer,
    publisher character varying(250),
    publicationplace character varying(250),
    isbn character varying(250),
    edition character varying(250),
    numberofvolumes integer,
    chapternumber integer,
    reportnumber integer,
    communicationtype character varying(250),
    degree character varying(250),
    url text,
    doi text,
    additionalinfo text,
    pubdate timestamp with time zone,
    accessdate timestamp with time zone,
    conferencedate timestamp with time zone,
    accessioncode character varying(255)
);


ALTER TABLE public.reference OWNER TO bien;

--
-- Name: reference_reference_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.reference_reference_id_seq OWNER TO bien;

--
-- Name: reference_reference_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE reference_reference_id_seq OWNED BY reference.reference_id;


--
-- Name: referencealtident; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE referencealtident (
    referencealtident_id integer NOT NULL,
    reference_id integer NOT NULL,
    system character varying(250),
    identifier character varying(250) NOT NULL
);


ALTER TABLE public.referencealtident OWNER TO bien;

--
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.referencealtident_referencealtident_id_seq OWNER TO bien;

--
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE referencealtident_referencealtident_id_seq OWNED BY referencealtident.referencealtident_id;


--
-- Name: referencecontributor; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE referencecontributor (
    referencecontributor_id integer NOT NULL,
    reference_id integer NOT NULL,
    referenceparty_id integer NOT NULL,
    roletype character varying(250),
    "position" integer
);


ALTER TABLE public.referencecontributor OWNER TO bien;

--
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.referencecontributor_referencecontributor_id_seq OWNER TO bien;

--
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE referencecontributor_referencecontributor_id_seq OWNED BY referencecontributor.referencecontributor_id;


--
-- Name: referencejournal; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE referencejournal (
    referencejournal_id integer NOT NULL,
    journal character varying(250) NOT NULL,
    issn character varying(250),
    abbreviation character varying(250),
    accessioncode character varying(255)
);


ALTER TABLE public.referencejournal OWNER TO bien;

--
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.referencejournal_referencejournal_id_seq OWNER TO bien;

--
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE referencejournal_referencejournal_id_seq OWNED BY referencejournal.referencejournal_id;


--
-- Name: referenceparty; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE referenceparty (
    referenceparty_id integer NOT NULL,
    type character varying(250),
    positionname character varying(250),
    salutation character varying(250),
    givenname character varying(250),
    surname character varying(250),
    suffix character varying(250),
    organizationname character varying(250),
    currentparty_id integer,
    accessioncode character varying(255)
);


ALTER TABLE public.referenceparty OWNER TO bien;

--
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.referenceparty_referenceparty_id_seq OWNER TO bien;

--
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE referenceparty_referenceparty_id_seq OWNED BY referenceparty.referenceparty_id;


--
-- Name: revision; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE revision (
    revision_id integer NOT NULL,
    tablename character varying(50) NOT NULL,
    tableattribute character varying(50) NOT NULL,
    tablerecord integer NOT NULL,
    previousvaluetext text NOT NULL,
    previousvaluetype character varying(20) NOT NULL,
    previousrevision_id integer,
    revisiondate timestamp with time zone NOT NULL
);


ALTER TABLE public.revision OWNER TO bien;

--
-- Name: revision_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.revision_revision_id_seq OWNER TO bien;

--
-- Name: revision_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE revision_revision_id_seq OWNED BY revision.revision_id;


--
-- Name: soilobs; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE soilobs (
    soilobs_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    soilhorizon character varying(15) NOT NULL,
    soildepthtop double precision,
    soildepthbottom double precision,
    soilcolor character varying(30),
    soilorganic double precision,
    soiltexture character varying(50),
    soilsand double precision,
    soilsilt double precision,
    soilclay double precision,
    soilcoarse double precision,
    soilph double precision,
    exchangecapacity double precision,
    basesaturation double precision,
    soildescription text,
    emb_soilobs integer
);


ALTER TABLE public.soilobs OWNER TO bien;

--
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.soilobs_soilobs_id_seq OWNER TO bien;

--
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE soilobs_soilobs_id_seq OWNED BY soilobs.soilobs_id;


--
-- Name: soiltaxon; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE soiltaxon (
    soiltaxon_id integer NOT NULL,
    soilcode character varying(15),
    soilname character varying(100),
    soillevel integer,
    soilparent_id integer,
    soilframework character varying(33),
    accessioncode character varying(255)
);


ALTER TABLE public.soiltaxon OWNER TO bien;

--
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.soiltaxon_soiltaxon_id_seq OWNER TO bien;

--
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE soiltaxon_soiltaxon_id_seq OWNED BY soiltaxon.soiltaxon_id;


--
-- Name: stemcount; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE stemcount (
    stemcount_id integer NOT NULL,
    collectiveobs_id integer NOT NULL,
    stemdiameter double precision,
    stemdiameteraccuracy double precision,
    stemheight double precision,
    stemheightaccuracy double precision,
    stemcount integer NOT NULL,
    stemtaxonarea double precision,
    emb_stemcount integer
);


ALTER TABLE public.stemcount OWNER TO bien;

--
-- Name: stemcount_stemcount_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.stemcount_stemcount_id_seq OWNER TO bien;

--
-- Name: stemcount_stemcount_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE stemcount_stemcount_id_seq OWNED BY stemcount.stemcount_id;


--
-- Name: individual; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE individual (
    individual_id integer NOT NULL,
    stemcount_id integer NOT NULL,
    stemcode character varying(20),
    stemxposition double precision,
    stemyposition double precision,
    stemhealth character varying(50),
    emb_stemlocation integer
);


ALTER TABLE public.individual OWNER TO bien;

--
-- Name: stemlocation_stemlocation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.stemlocation_stemlocation_id_seq OWNER TO bien;

--
-- Name: stemlocation_stemlocation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE stemlocation_stemlocation_id_seq OWNED BY individual.individual_id;


--
-- Name: taxonbin; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE taxonbin (
    taxonbin_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    stratumtype_id integer NOT NULL,
    stratummethod_id integer,
    stratumname character varying(30),
    stratumheight double precision,
    stratumbase double precision,
    stratumcover double precision,
    stratumdescription character varying(200)
);


ALTER TABLE public.taxonbin OWNER TO bien;

--
-- Name: stratum_stratum_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.stratum_stratum_id_seq OWNER TO bien;

--
-- Name: stratum_stratum_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE stratum_stratum_id_seq OWNED BY taxonbin.taxonbin_id;


--
-- Name: stratummethod; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE stratummethod (
    stratummethod_id integer NOT NULL,
    reference_id integer,
    stratummethodname character varying(30) NOT NULL,
    stratummethoddescription text,
    stratumassignment character varying(50),
    accessioncode character varying(255)
);


ALTER TABLE public.stratummethod OWNER TO bien;

--
-- Name: stratummethod_stratummethod_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.stratummethod_stratummethod_id_seq OWNER TO bien;

--
-- Name: stratummethod_stratummethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE stratummethod_stratummethod_id_seq OWNED BY stratummethod.stratummethod_id;


--
-- Name: stratumtype; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE stratumtype (
    stratumtype_id integer NOT NULL,
    stratummethod_id integer NOT NULL,
    stratumindex character varying(10),
    stratumname character varying(30),
    stratumdescription text
);


ALTER TABLE public.stratumtype OWNER TO bien;

--
-- Name: stratumtype_stratumtype_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.stratumtype_stratumtype_id_seq OWNER TO bien;

--
-- Name: stratumtype_stratumtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE stratumtype_stratumtype_id_seq OWNED BY stratumtype.stratumtype_id;


--
-- Name: taxonalt; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE taxonalt (
    taxonalt_id integer NOT NULL,
    taxondetermination_id integer NOT NULL,
    plantconcept_id integer NOT NULL,
    taxonaltfit character varying(50),
    taxonaltconfidence character varying(50),
    taxonaltnotes text,
    emb_taxonalt integer
);


ALTER TABLE public.taxonalt OWNER TO bien;

--
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.taxonalt_taxonalt_id_seq OWNER TO bien;

--
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE taxonalt_taxonalt_id_seq OWNED BY taxonalt.taxonalt_id;


--
-- Name: collectiveobs; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE collectiveobs (
    collectiveobs_id integer NOT NULL,
    taxonoccurrence_id integer NOT NULL,
    taxonbin_id integer,
    cover double precision,
    basalarea double precision,
    biomass double precision,
    inferencearea double precision,
    stratumbase double precision,
    stratumheight double precision,
    emb_taxonimportance integer,
    covercode character varying(10)
);


ALTER TABLE public.collectiveobs OWNER TO bien;

--
-- Name: taxonimportance_taxonimportance_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.taxonimportance_taxonimportance_id_seq OWNER TO bien;

--
-- Name: taxonimportance_taxonimportance_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE taxonimportance_taxonimportance_id_seq OWNED BY collectiveobs.collectiveobs_id;


--
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE taxondetermination (
    taxondetermination_id integer NOT NULL,
    taxonoccurrence_id integer NOT NULL,
    individual_id integer,
    plantconcept_id integer NOT NULL,
    plantname_id integer,
    party_id integer NOT NULL,
    role_id integer NOT NULL,
    interpretationtype character varying(30),
    reference_id integer,
    originalinterpretation boolean NOT NULL,
    currentinterpretation boolean NOT NULL,
    taxonfit character varying(50),
    taxonconfidence character varying(50),
    collector_id integer,
    collectionnumber character varying(100),
    museum_id integer,
    museumaccessionnumber character varying(100),
    grouptype character varying(20),
    notes text,
    notespublic boolean,
    notesmgt boolean,
    revisions boolean,
    interpretationdate timestamp with time zone NOT NULL,
    collectiondate timestamp with time zone,
    emb_taxoninterpretation integer,
    accessioncode character varying(255)
);


ALTER TABLE public.taxondetermination OWNER TO bien;

--
-- Name: taxoninterpretation_taxoninterpretation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.taxoninterpretation_taxoninterpretation_id_seq OWNER TO bien;

--
-- Name: taxoninterpretation_taxoninterpretation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE taxoninterpretation_taxoninterpretation_id_seq OWNED BY taxondetermination.taxondetermination_id;


--
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE taxonoccurrence (
    taxonoccurrence_id integer NOT NULL,
    plotevent_id integer NOT NULL,
    authorplantname character varying(255),
    reference_id integer,
    taxoninferencearea double precision,
    emb_taxonobservation integer,
    int_origplantconcept_id integer,
    int_origplantscifull character varying(255),
    int_origplantscinamenoauth character varying(255),
    int_origplantcommon character varying(255),
    int_origplantcode character varying(255),
    int_currplantconcept_id integer,
    int_currplantscifull character varying(255),
    int_currplantscinamenoauth character varying(255),
    int_currplantcommon character varying(255),
    int_currplantcode character varying(255),
    accessioncode character varying(255)
);


ALTER TABLE public.taxonoccurrence OWNER TO bien;

--
-- Name: taxonobservation_taxonobservation_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.taxonobservation_taxonobservation_id_seq OWNER TO bien;

--
-- Name: taxonobservation_taxonobservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE taxonobservation_taxonobservation_id_seq OWNED BY taxonoccurrence.taxonoccurrence_id;


--
-- Name: telephone; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE telephone (
    telephone_id integer NOT NULL,
    party_id integer NOT NULL,
    phonenumber character varying(30) NOT NULL,
    phonetype character varying(20) NOT NULL
);


ALTER TABLE public.telephone OWNER TO bien;

--
-- Name: telephone_telephone_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.telephone_telephone_id_seq OWNER TO bien;

--
-- Name: telephone_telephone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE telephone_telephone_id_seq OWNED BY telephone.telephone_id;


--
-- Name: temp_rkp_plotrichness; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW temp_rkp_plotrichness AS
    SELECT ob.plotevent_id, ob.project_id, count(1) AS spprichness, pr.projectname AS toptaxon1name, ob.toptaxon2name, ob.toptaxon3name FROM taxonoccurrence tob, plotevent ob, project pr WHERE (((tob.plotevent_id = ob.plotevent_id) AND (ob.project_id >= 10507)) AND (ob.project_id = pr.project_id)) GROUP BY ob.plotevent_id, ob.project_id, pr.projectname, ob.toptaxon1name, ob.toptaxon2name, ob.toptaxon3name;


ALTER TABLE public.temp_rkp_plotrichness OWNER TO bien;

--
-- Name: temptbl_std_commnames; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE temptbl_std_commnames (
    commconcept_id integer NOT NULL,
    sciname character varying(255),
    translated character varying(255),
    code character varying(255),
    common character varying(255)
);


ALTER TABLE public.temptbl_std_commnames OWNER TO bien;

--
-- Name: temptbl_std_commnames_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.temptbl_std_commnames_commconcept_id_seq OWNER TO bien;

--
-- Name: temptbl_std_commnames_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE temptbl_std_commnames_commconcept_id_seq OWNED BY temptbl_std_commnames.commconcept_id;


--
-- Name: temptbl_std_plantnames; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE temptbl_std_plantnames (
    plantconcept_id integer NOT NULL,
    plantname character varying(255),
    sciname character varying(255),
    scinamenoauth character varying(255),
    code character varying(255),
    common character varying(255)
);


ALTER TABLE public.temptbl_std_plantnames OWNER TO bien;

--
-- Name: temptbl_std_plantnames_plantconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.temptbl_std_plantnames_plantconcept_id_seq OWNER TO bien;

--
-- Name: temptbl_std_plantnames_plantconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE temptbl_std_plantnames_plantconcept_id_seq OWNED BY temptbl_std_plantnames.plantconcept_id;


--
-- Name: usercertification; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE usercertification (
    usercertification_id integer NOT NULL,
    usr_id integer NOT NULL,
    current_cert_level integer NOT NULL,
    requested_cert_level integer NOT NULL,
    highest_degree character varying(50),
    degree_year character varying(50),
    degree_institution character varying(50),
    current_org character varying(50),
    current_pos character varying(200),
    esa_member boolean,
    prof_exp text,
    relevant_pubs text,
    veg_sampling_exp text,
    veg_analysis_exp text,
    usnvc_exp text,
    vb_exp text,
    vb_intention text,
    tools_exp text,
    esa_sponsor_name_a character varying(120),
    esa_sponsor_email_a character varying(120),
    esa_sponsor_name_b character varying(120),
    esa_sponsor_email_b character varying(120),
    peer_review boolean,
    addl_stmt text,
    certificationstatus character varying(30),
    certificationstatuscomments text,
    exp_region_a text,
    exp_region_b text,
    exp_region_c text,
    exp_region_a_veg text,
    exp_region_b_veg text,
    exp_region_c_veg text,
    exp_region_a_flor text,
    exp_region_b_flor text,
    exp_region_c_flor text,
    exp_region_a_nvc text,
    exp_region_b_nvc text,
    exp_region_c_nvc text
);


ALTER TABLE public.usercertification OWNER TO bien;

--
-- Name: usercertification_usercertification_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.usercertification_usercertification_id_seq OWNER TO bien;

--
-- Name: usercertification_usercertification_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE usercertification_usercertification_id_seq OWNED BY usercertification.usercertification_id;


--
-- Name: userdataset; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userdataset (
    userdataset_id integer NOT NULL,
    usr_id integer,
    datasetname character varying(100) NOT NULL,
    datasetdescription text,
    datasettype character varying(50),
    datasetsharing character varying(30),
    datasetpassword character varying(50),
    datasetstop timestamp with time zone,
    datasetstart timestamp with time zone DEFAULT now(),
    accessioncode character varying(255)
);


ALTER TABLE public.userdataset OWNER TO bien;

--
-- Name: userdataset_userdataset_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userdataset_userdataset_id_seq OWNER TO bien;

--
-- Name: userdataset_userdataset_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userdataset_userdataset_id_seq OWNED BY userdataset.userdataset_id;


--
-- Name: userdatasetitem; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userdatasetitem (
    userdatasetitem_id integer NOT NULL,
    userdataset_id integer NOT NULL,
    itemaccessioncode character varying(100) NOT NULL,
    itemtype character varying(50),
    notes text,
    itemstart timestamp with time zone DEFAULT now() NOT NULL,
    itemstop timestamp with time zone,
    externalaccessioncode character varying(100),
    itemdatabase character varying(50) NOT NULL,
    itemtable character varying(50) NOT NULL,
    itemrecord integer NOT NULL
);


ALTER TABLE public.userdatasetitem OWNER TO bien;

--
-- Name: userdatasetitem_userdatasetitem_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userdatasetitem_userdatasetitem_id_seq OWNER TO bien;

--
-- Name: userdatasetitem_userdatasetitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userdatasetitem_userdatasetitem_id_seq OWNED BY userdatasetitem.userdatasetitem_id;


--
-- Name: userdefined; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userdefined (
    userdefined_id integer NOT NULL,
    userdefinedname character varying(50),
    userdefinedmetadata text,
    userdefinedcategory character varying(30),
    userdefinedtype character varying(20) NOT NULL,
    tablename character varying(50) NOT NULL,
    accessioncode character varying(255)
);


ALTER TABLE public.userdefined OWNER TO bien;

--
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userdefined_userdefined_id_seq OWNER TO bien;

--
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userdefined_userdefined_id_seq OWNED BY userdefined.userdefined_id;


--
-- Name: usernotify; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE usernotify (
    usernotify_id integer NOT NULL,
    usr_id integer NOT NULL,
    notifyname character varying(100),
    notifydescription text,
    notifysql text,
    notifystart timestamp with time zone DEFAULT now(),
    notifystop timestamp with time zone,
    lastcheckdate timestamp with time zone
);


ALTER TABLE public.usernotify OWNER TO bien;

--
-- Name: usernotify_usernotify_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.usernotify_usernotify_id_seq OWNER TO bien;

--
-- Name: usernotify_usernotify_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE usernotify_usernotify_id_seq OWNED BY usernotify.usernotify_id;


--
-- Name: userpermission; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userpermission (
    userpermission_id integer NOT NULL,
    embargo_id integer NOT NULL,
    usr_id integer NOT NULL,
    permissionstatus integer NOT NULL,
    permissionnotes text,
    permissionstop timestamp with time zone,
    permissionstart timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.userpermission OWNER TO bien;

--
-- Name: userpermission_userpermission_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userpermission_userpermission_id_seq OWNER TO bien;

--
-- Name: userpermission_userpermission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userpermission_userpermission_id_seq OWNED BY userpermission.userpermission_id;


--
-- Name: userpreference; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userpreference (
    userpreference_id integer NOT NULL,
    usr_id integer NOT NULL,
    preferencename character varying(100),
    preferencevalue text,
    preferencepriority double precision,
    preferencestop timestamp with time zone,
    preferencestart timestamp with time zone DEFAULT now()
);


ALTER TABLE public.userpreference OWNER TO bien;

--
-- Name: userpreference_userpreference_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userpreference_userpreference_id_seq OWNER TO bien;

--
-- Name: userpreference_userpreference_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userpreference_userpreference_id_seq OWNED BY userpreference.userpreference_id;


--
-- Name: userquery; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userquery (
    userquery_id integer NOT NULL,
    usr_id integer NOT NULL,
    queryname character varying(100),
    querydescription text,
    querysql text,
    querytype character varying(50),
    querysharing character varying(30),
    querypassword character varying(50),
    querystop timestamp with time zone,
    querystart timestamp with time zone DEFAULT now(),
    accessioncode character varying(255)
);


ALTER TABLE public.userquery OWNER TO bien;

--
-- Name: userquery_userquery_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userquery_userquery_id_seq OWNER TO bien;

--
-- Name: userquery_userquery_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userquery_userquery_id_seq OWNED BY userquery.userquery_id;


--
-- Name: userrecordowner; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userrecordowner (
    userrecordowner_id integer NOT NULL,
    usr_id integer NOT NULL,
    tablename character varying(50) NOT NULL,
    tablerecord integer NOT NULL,
    ownertype character varying(30) NOT NULL,
    recordcreationdate timestamp with time zone NOT NULL,
    ownerstop timestamp with time zone,
    ownerstart timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.userrecordowner OWNER TO bien;

--
-- Name: userrecordowner_userrecordowner_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userrecordowner_userrecordowner_id_seq OWNER TO bien;

--
-- Name: userrecordowner_userrecordowner_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userrecordowner_userrecordowner_id_seq OWNED BY userrecordowner.userrecordowner_id;


--
-- Name: userregionalexp; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE userregionalexp (
    userregionalexp_id integer NOT NULL,
    usercertification_id integer NOT NULL,
    region character varying(50) NOT NULL,
    vegetation character varying(50),
    floristics character varying(50),
    nvc_ivc character varying(50)
);


ALTER TABLE public.userregionalexp OWNER TO bien;

--
-- Name: userregionalexp_userregionalexp_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.userregionalexp_userregionalexp_id_seq OWNER TO bien;

--
-- Name: userregionalexp_userregionalexp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE userregionalexp_userregionalexp_id_seq OWNED BY userregionalexp.userregionalexp_id;


--
-- Name: usr; Type: TABLE; Schema: public; Owner: bien; Tablespace: 
--

CREATE TABLE usr (
    usr_id integer NOT NULL,
    party_id integer NOT NULL,
    permission_type integer NOT NULL,
    ticket_count integer,
    email_address character varying(100) NOT NULL,
    preferred_name character varying(100),
    remote_address character varying(100),
    last_connect timestamp with time zone,
    begin_time timestamp with time zone,
    password character varying(512)
);


ALTER TABLE public.usr OWNER TO bien;

--
-- Name: usr_usr_id_seq; Type: SEQUENCE; Schema: public; Owner: bien
--

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


ALTER TABLE public.usr_usr_id_seq OWNER TO bien;

--
-- Name: usr_usr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bien
--

ALTER SEQUENCE usr_usr_id_seq OWNED BY usr.usr_id;


--
-- Name: view_all_commnames_code; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_commnames_code AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((commusage.classsystem)::text = 'Code'::text);


ALTER TABLE public.view_all_commnames_code OWNER TO bien;

--
-- Name: view_all_commnames_common; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_commnames_common AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((commusage.classsystem)::text = 'Common'::text);


ALTER TABLE public.view_all_commnames_common OWNER TO bien;

--
-- Name: view_all_commnames_sciname; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_commnames_sciname AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((commusage.classsystem)::text = 'Scientific'::text);


ALTER TABLE public.view_all_commnames_sciname OWNER TO bien;

--
-- Name: view_all_commnames_translated; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_commnames_translated AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((commusage.classsystem)::text = 'Translated'::text);


ALTER TABLE public.view_all_commnames_translated OWNER TO bien;

--
-- Name: view_all_plantnames_code; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_plantnames_code AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((plantusage.classsystem)::text = 'Code'::text);


ALTER TABLE public.view_all_plantnames_code OWNER TO bien;

--
-- Name: view_all_plantnames_common; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_plantnames_common AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((plantusage.classsystem)::text = 'English Common'::text);


ALTER TABLE public.view_all_plantnames_common OWNER TO bien;

--
-- Name: view_all_plantnames_sciname; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_plantnames_sciname AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((plantusage.classsystem)::text = 'Scientific'::text);


ALTER TABLE public.view_all_plantnames_sciname OWNER TO bien;

--
-- Name: view_all_plantnames_scinamenoauth; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_all_plantnames_scinamenoauth AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((plantusage.classsystem)::text = 'Scientific without authors'::text);


ALTER TABLE public.view_all_plantnames_scinamenoauth OWNER TO bien;

--
-- Name: view_notemb_observation; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_observation AS
    SELECT plotevent.plotevent_id, plotevent.previousobs_id, plotevent.plot_id, plotevent.project_id, plotevent.authorobscode, plotevent.dateaccuracy, plotevent.covermethod_id, plotevent.coverdispersion, plotevent.autotaxoncover, plotevent.stratummethod_id, plotevent.methodnarrative, plotevent.taxonobservationarea, plotevent.stemsizelimit, plotevent.stemobservationarea, plotevent.stemsamplemethod, plotevent.originaldata, plotevent.effortlevel, plotevent.plotvalidationlevel, plotevent.floristicquality, plotevent.bryophytequality, plotevent.lichenquality, plotevent.observationnarrative, plotevent.landscapenarrative, plotevent.homogeneity, plotevent.phenologicaspect, plotevent.representativeness, plotevent.standmaturity, plotevent.successionalstatus, plotevent.basalarea, plotevent.hydrologicregime, plotevent.soilmoistureregime, plotevent.soildrainage, plotevent.watersalinity, plotevent.waterdepth, plotevent.shoredistance, plotevent.soildepth, plotevent.organicdepth, plotevent.soiltaxon_id, plotevent.soiltaxonsrc, plotevent.percentbedrock, plotevent.percentrockgravel, plotevent.percentwood, plotevent.percentlitter, plotevent.percentbaresoil, plotevent.percentwater, plotevent.percentother, plotevent.nameother, plotevent.treeht, plotevent.shrubht, plotevent.fieldht, plotevent.nonvascularht, plotevent.submergedht, plotevent.treecover, plotevent.shrubcover, plotevent.fieldcover, plotevent.nonvascularcover, plotevent.floatingcover, plotevent.submergedcover, plotevent.dominantstratum, plotevent.growthform1type, plotevent.growthform2type, plotevent.growthform3type, plotevent.growthform1cover, plotevent.growthform2cover, plotevent.growthform3cover, plotevent.totalcover, plotevent.notespublic, plotevent.notesmgt, plotevent.revisions, plotevent.obsstartdate, plotevent.obsenddate, plotevent.dateentered, plotevent.emb_observation, plotevent.interp_orig_ci_id, plotevent.interp_orig_cc_id, plotevent.interp_orig_sciname, plotevent.interp_orig_code, plotevent.interp_orig_party_id, plotevent.interp_orig_partyname, plotevent.interp_current_ci_id, plotevent.interp_current_cc_id, plotevent.interp_current_sciname, plotevent.interp_current_code, plotevent.interp_current_party_id, plotevent.interp_current_partyname, plotevent.interp_bestfit_ci_id, plotevent.interp_bestfit_cc_id, plotevent.interp_bestfit_sciname, plotevent.interp_bestfit_code, plotevent.interp_bestfit_party_id, plotevent.interp_bestfit_partyname, plotevent.toptaxon1name, plotevent.toptaxon2name, plotevent.toptaxon3name, plotevent.toptaxon4name, plotevent.toptaxon5name, plotevent.numberoftaxa, plotevent.accessioncode FROM plotevent WHERE (plotevent.emb_observation < 6);


ALTER TABLE public.view_notemb_observation OWNER TO bien;

--
-- Name: view_browseparty_classcontrib; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_classcontrib AS
    SELECT observation_2.plotevent_id, classcontributor.party_id FROM (view_notemb_observation observation_2 JOIN (commclass JOIN classcontributor ON ((commclass.commclass_id = classcontributor.commclass_id))) ON ((observation_2.plotevent_id = commclass.plotevent_id))) GROUP BY observation_2.plotevent_id, classcontributor.party_id;


ALTER TABLE public.view_browseparty_classcontrib OWNER TO bien;

--
-- Name: view_browseparty_obscontrib; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_obscontrib AS
    SELECT observationcontributor.party_id, observationcontributor.plotevent_id FROM (view_notemb_observation plotevent JOIN observationcontributor ON ((plotevent.plotevent_id = observationcontributor.plotevent_id))) GROUP BY observationcontributor.party_id, observationcontributor.plotevent_id;


ALTER TABLE public.view_browseparty_obscontrib OWNER TO bien;

--
-- Name: view_browseparty_projectcontrib; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_projectcontrib AS
    SELECT observation_1.plotevent_id, projectcontributor.party_id FROM ((project JOIN view_notemb_observation observation_1 ON ((project.project_id = observation_1.project_id))) JOIN projectcontributor ON ((project.project_id = projectcontributor.project_id))) GROUP BY observation_1.plotevent_id, projectcontributor.party_id;


ALTER TABLE public.view_browseparty_projectcontrib OWNER TO bien;

--
-- Name: view_browseparty_all; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_all AS
    (SELECT view_browseparty_classcontrib.plotevent_id, view_browseparty_classcontrib.party_id FROM view_browseparty_classcontrib UNION SELECT view_browseparty_projectcontrib.plotevent_id, view_browseparty_projectcontrib.party_id FROM view_browseparty_projectcontrib) UNION SELECT view_browseparty_obscontrib.plotevent_id, view_browseparty_obscontrib.party_id FROM view_browseparty_obscontrib;


ALTER TABLE public.view_browseparty_all OWNER TO bien;

--
-- Name: view_browseparty_all_count; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_all_count AS
    SELECT count(1) AS countallcontrib, view_browseparty_all.party_id FROM view_browseparty_all GROUP BY view_browseparty_all.party_id;


ALTER TABLE public.view_browseparty_all_count OWNER TO bien;

--
-- Name: view_browseparty_classcontrib_count; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_classcontrib_count AS
    SELECT count(1) AS countclasscontrib, view_browseparty_classcontrib.party_id FROM view_browseparty_classcontrib GROUP BY view_browseparty_classcontrib.party_id;


ALTER TABLE public.view_browseparty_classcontrib_count OWNER TO bien;

--
-- Name: view_browseparty_obscontrib_count; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_obscontrib_count AS
    SELECT count(1) AS countobscontrib, view_browseparty_obscontrib.party_id FROM view_browseparty_obscontrib GROUP BY view_browseparty_obscontrib.party_id;


ALTER TABLE public.view_browseparty_obscontrib_count OWNER TO bien;

--
-- Name: view_browseparty_projectcontrib_count; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_projectcontrib_count AS
    SELECT count(1) AS countprojectcontrib, view_browseparty_projectcontrib.party_id FROM view_browseparty_projectcontrib GROUP BY view_browseparty_projectcontrib.party_id;


ALTER TABLE public.view_browseparty_projectcontrib_count OWNER TO bien;

--
-- Name: view_browseparty_all_count_combined; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_browseparty_all_count_combined AS
    SELECT view_browseparty_all_count.party_id, view_browseparty_all_count.countallcontrib, view_browseparty_classcontrib_count.countclasscontrib, view_browseparty_obscontrib_count.countobscontrib, view_browseparty_projectcontrib_count.countprojectcontrib FROM (((view_browseparty_all_count LEFT JOIN view_browseparty_classcontrib_count ON ((view_browseparty_all_count.party_id = view_browseparty_classcontrib_count.party_id))) LEFT JOIN view_browseparty_obscontrib_count ON ((view_browseparty_all_count.party_id = view_browseparty_obscontrib_count.party_id))) LEFT JOIN view_browseparty_projectcontrib_count ON ((view_browseparty_all_count.party_id = view_browseparty_projectcontrib_count.party_id))) ORDER BY view_browseparty_all_count.countallcontrib DESC;


ALTER TABLE public.view_browseparty_all_count_combined OWNER TO bien;

--
-- Name: view_busrule_duplcovercode; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_busrule_duplcovercode AS
    SELECT count(1) AS count, coverindex.covermethod_id, coverindex.covercode FROM coverindex GROUP BY coverindex.covermethod_id, coverindex.covercode HAVING (count(1) > 1);


ALTER TABLE public.view_busrule_duplcovercode OWNER TO bien;

--
-- Name: view_busrule_duplstratumtype; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_busrule_duplstratumtype AS
    SELECT count(1) AS count, stratumtype.stratummethod_id, stratumtype.stratumindex FROM stratumtype GROUP BY stratumtype.stratummethod_id, stratumtype.stratumindex HAVING (count(1) > 1);


ALTER TABLE public.view_busrule_duplstratumtype OWNER TO bien;

--
-- Name: view_busrule_plotsizeshape; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_busrule_plotsizeshape AS
    SELECT plotevent.project_id, (SELECT project.projectname FROM project WHERE (project.project_id = plotevent.project_id)) AS projectname, count(1) AS plotcount FROM (plot JOIN plotevent ON ((plot.plot_id = plotevent.plot_id))) WHERE ((plot.area IS NULL) AND ((plot.shape IS NULL) OR (((plot.shape)::text <> 'Plotless'::text) AND (upper((plot.shape)::text) !~~ 'RELEV%'::text)))) GROUP BY plotevent.project_id;


ALTER TABLE public.view_busrule_plotsizeshape OWNER TO bien;

--
-- Name: view_reference_transl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_reference_transl AS
    SELECT CASE WHEN (reference.shortname IS NULL) THEN CASE WHEN (reference.title IS NULL) THEN (CASE WHEN (reference.fulltext IS NULL) THEN '[poorly documented reference]'::text ELSE CASE WHEN (length(reference.fulltext) > 35) THEN (substr(reference.fulltext, 1, 32) || '...'::text) ELSE reference.fulltext END END)::character varying ELSE reference.title END ELSE reference.shortname END AS reference_id_transl, reference.reference_id FROM reference;


ALTER TABLE public.view_reference_transl OWNER TO bien;

--
-- Name: view_commconcept_transl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_commconcept_transl AS
    SELECT commconcept.commconcept_id, commconcept.commname_id, commconcept.commname, commconcept.reference_id, (((commconcept.commname || ' ['::text) || ((SELECT view_reference_transl.reference_id_transl FROM view_reference_transl WHERE (view_reference_transl.reference_id = commconcept.reference_id)))::text) || ']'::text) AS commconcept_id_transl FROM commconcept;


ALTER TABLE public.view_commconcept_transl OWNER TO bien;

--
-- Name: view_notemb_commclass; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_commclass AS
    SELECT commclass.commclass_id, commclass.plotevent_id, commclass.inspection, commclass.tableanalysis, commclass.multivariateanalysis, commclass.classpublication_id, commclass.classnotes, commclass.commname, commclass.commcode, commclass.commframework, commclass.commlevel, commclass.classstartdate, commclass.classstopdate, commclass.emb_commclass, commclass.expertsystem, commclass.accessioncode FROM commclass WHERE (commclass.emb_commclass < 6);


ALTER TABLE public.view_notemb_commclass OWNER TO bien;

--
-- Name: view_comminterp_more; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_comminterp_more AS
    SELECT commclass.plotevent_id, commclass.inspection, commclass.tableanalysis, commclass.multivariateanalysis, commclass.expertsystem, commclass.classpublication_id, commclass.classnotes, commclass.accessioncode, commclass.classstartdate, commclass.classstopdate, comminterpretation.comminterpretation_id, comminterpretation.commclass_id, comminterpretation.commconcept_id, comminterpretation.commcode, comminterpretation.commname, comminterpretation.classfit, comminterpretation.classconfidence, comminterpretation.commauthority_id, comminterpretation.notes, comminterpretation.type, comminterpretation.nomenclaturaltype, comminterpretation.emb_comminterpretation, CASE WHEN ((comminterpretation.classfit)::text = 'Absolutely wrong'::text) THEN 6 WHEN ((comminterpretation.classfit)::text = 'Understandable but wrong'::text) THEN 4 WHEN ((comminterpretation.classfit)::text = 'Reasonable or acceptable answer'::text) THEN 3 WHEN ((comminterpretation.classfit)::text = 'Good answer'::text) THEN 2 WHEN ((comminterpretation.classfit)::text = 'Absolutely correct'::text) THEN 1 ELSE 5 END AS classfitnum, CASE WHEN ((comminterpretation.classconfidence)::text = 'High'::text) THEN 1 WHEN ((comminterpretation.classconfidence)::text = 'Medium'::text) THEN 2 WHEN ((comminterpretation.classconfidence)::text = 'Low'::text) THEN 3 ELSE 4 END AS classconfidencenum FROM view_notemb_commclass commclass, comminterpretation WHERE (commclass.commclass_id = comminterpretation.commclass_id);


ALTER TABLE public.view_comminterp_more OWNER TO bien;

--
-- Name: view_csv_taxonimportance_pre; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_csv_taxonimportance_pre AS
    SELECT taxonoccurrence.plotevent_id, taxonoccurrence.authorplantname AS plant, CASE WHEN (collectiveobs.taxonbin_id IS NULL) THEN '-all-'::character varying ELSE (SELECT stratumtype.stratumname FROM stratumtype, taxonbin WHERE ((taxonbin.stratumtype_id = stratumtype.stratumtype_id) AND (taxonbin.taxonbin_id = collectiveobs.taxonbin_id))) END AS taxonbin, collectiveobs.cover, (SELECT min((coverindex.covercode)::text) AS min FROM coverindex WHERE (((coverindex.coverpercent = collectiveobs.cover) AND (coverindex.covermethod_id = plotevent.covermethod_id)) AND (plotevent.plotevent_id = taxonoccurrence.plotevent_id))) AS covercode_exact, (SELECT min((coverindex.covercode)::text) AS min FROM coverindex WHERE ((((coverindex.upperlimit >= collectiveobs.cover) AND (coverindex.lowerlimit <= collectiveobs.cover)) AND (coverindex.covermethod_id = plotevent.covermethod_id)) AND (plotevent.plotevent_id = taxonoccurrence.plotevent_id))) AS covercode_byrange, collectiveobs.basalarea, taxonoccurrence.accessioncode FROM taxonoccurrence, collectiveobs, view_notemb_observation plotevent WHERE ((taxonoccurrence.taxonoccurrence_id = collectiveobs.taxonoccurrence_id) AND (taxonoccurrence.plotevent_id = plotevent.plotevent_id));


ALTER TABLE public.view_csv_taxonimportance_pre OWNER TO bien;

--
-- Name: view_csv_taxonimportance; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_csv_taxonimportance AS
    SELECT view_csv_taxonimportance_pre.plotevent_id, view_csv_taxonimportance_pre.plant, view_csv_taxonimportance_pre.taxonbin, view_csv_taxonimportance_pre.cover, CASE WHEN (view_csv_taxonimportance_pre.covercode_exact IS NULL) THEN view_csv_taxonimportance_pre.covercode_byrange ELSE view_csv_taxonimportance_pre.covercode_exact END AS covercode, view_csv_taxonimportance_pre.basalarea, view_csv_taxonimportance_pre.accessioncode FROM view_csv_taxonimportance_pre;


ALTER TABLE public.view_csv_taxonimportance OWNER TO bien;

--
-- Name: view_dbafielddesc_notimpl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_dbafielddesc_notimpl AS
    SELECT dba_fielddescription.dba_fielddescription_id, dba_fielddescription.tablename, (SELECT dba_tabledescription.tablelabel FROM dba_tabledescription WHERE ((dba_fielddescription.tablename)::text = (dba_tabledescription.tablename)::text) LIMIT 1) AS tablename_transl, dba_fielddescription.fieldname, dba_fielddescription.fieldlabel, dba_fielddescription.fieldmodel, dba_fielddescription.fieldnulls, CASE WHEN ((dba_fielddescription.fieldnulls)::text = 'no'::text) THEN 'required'::text ELSE 'no'::text END AS fieldnulls_transl, dba_fielddescription.fieldtype, dba_fielddescription.fieldkey, CASE WHEN ((dba_fielddescription.fieldkey)::text = 'PK'::text) THEN dba_fielddescription.fieldkey WHEN ((dba_fielddescription.fieldkey)::text = 'FK'::text) THEN dba_fielddescription.fieldkey WHEN ((dba_fielddescription.fieldmodel)::text = 'denorm'::text) THEN dba_fielddescription.fieldmodel WHEN ((dba_fielddescription.fieldmodel)::text = 'implementation'::text) THEN dba_fielddescription.fieldmodel ELSE 'n/a'::character varying END AS fieldkey_transl, dba_fielddescription.fieldreferences, dba_fielddescription.fieldlist, dba_fielddescription.fieldnotes, dba_fielddescription.fielddefinition, dba_fielddescription.fieldkeywords FROM dba_fielddescription WHERE ((lower((dba_fielddescription.fieldmodel)::text) <> 'implementation'::text) AND (lower((dba_fielddescription.fieldmodel)::text) <> 'denorm'::text)) ORDER BY dba_fielddescription.dba_fielddescription_id;


ALTER TABLE public.view_dbafielddesc_notimpl OWNER TO bien;

--
-- Name: view_emb_embargo_currentfullonly; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_emb_embargo_currentfullonly AS
    SELECT embargo.embargo_id, embargo.plot_id, embargo.embargoreason, embargo.defaultstatus, embargo.embargostart, embargo.embargostop FROM embargo WHERE (((embargo.defaultstatus = 6) AND (embargo.embargostart < now())) AND (embargo.embargostop > now()));


ALTER TABLE public.view_emb_embargo_currentfullonly OWNER TO bien;

--
-- Name: view_emb_embargo_complete; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_emb_embargo_complete AS
    SELECT COALESCE(emb.defaultstatus, 0) AS currentemb, plot.plot_id FROM (plot LEFT JOIN view_emb_embargo_currentfullonly emb ON ((plot.plot_id = emb.plot_id)));


ALTER TABLE public.view_emb_embargo_complete OWNER TO bien;

--
-- Name: view_keywprojplaces; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_keywprojplaces AS
    SELECT project.project_id, plot.stateprovince FROM plot, project, plotevent WHERE ((plot.plot_id = plotevent.plot_id) AND (project.project_id = plotevent.project_id)) GROUP BY project.project_id, plot.stateprovince;


ALTER TABLE public.view_keywprojplaces OWNER TO bien;

--
-- Name: view_kwhelper_projcontrib; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_kwhelper_projcontrib AS
    SELECT project.project_id, concat((((' '::text || (COALESCE(party.givenname, ''::character varying))::text) || ' '::text) || (COALESCE(party.surname, ''::character varying))::text)) AS kw FROM party, project, projectcontributor WHERE ((party.party_id = projectcontributor.party_id) AND (project.project_id = projectcontributor.project_id)) GROUP BY project.project_id;


ALTER TABLE public.view_kwhelper_projcontrib OWNER TO bien;

--
-- Name: view_kwhelper_refjournal; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_kwhelper_refjournal AS
    SELECT reference.reference_id, (((((COALESCE(referencejournal.journal, ''::character varying))::text || ' '::text) || (COALESCE(referencejournal.issn, ''::character varying))::text) || ' '::text) || (COALESCE(referencejournal.abbreviation, ''::character varying))::text) AS kw FROM reference, referencejournal WHERE (reference.referencejournal_id = referencejournal.referencejournal_id) GROUP BY reference.reference_id, referencejournal.journal, referencejournal.issn, referencejournal.abbreviation;


ALTER TABLE public.view_kwhelper_refjournal OWNER TO bien;

--
-- Name: view_kwhelper_refparty; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_kwhelper_refparty AS
    SELECT reference.reference_id, concat((((((((' '::text || (COALESCE(referenceparty.givenname, ''::character varying))::text) || ' '::text) || (COALESCE(referenceparty.surname, ''::character varying))::text) || ' '::text) || (COALESCE(referenceparty.suffix, ''::character varying))::text) || ' '::text) || (COALESCE(referenceparty.organizationname, ''::character varying))::text)) AS kw FROM referenceparty, reference, referencecontributor WHERE ((referencecontributor.referenceparty_id = referenceparty.referenceparty_id) AND (reference.reference_id = referencecontributor.reference_id)) GROUP BY reference.reference_id;


ALTER TABLE public.view_kwhelper_refparty OWNER TO bien;

--
-- Name: view_notemb_classcontributor; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_classcontributor AS
    SELECT classcontributor.classcontributor_id, classcontributor.commclass_id, classcontributor.party_id, classcontributor.role_id, classcontributor.emb_classcontributor FROM classcontributor WHERE (classcontributor.emb_classcontributor < 6);


ALTER TABLE public.view_notemb_classcontributor OWNER TO bien;

--
-- Name: view_notemb_comminterpretation; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_comminterpretation AS
    SELECT comminterpretation.comminterpretation_id, comminterpretation.commclass_id, comminterpretation.commconcept_id, comminterpretation.commcode, comminterpretation.commname, comminterpretation.classfit, comminterpretation.classconfidence, comminterpretation.commauthority_id, comminterpretation.notes, comminterpretation.type, comminterpretation.nomenclaturaltype, comminterpretation.emb_comminterpretation FROM comminterpretation WHERE (comminterpretation.emb_comminterpretation < 6);


ALTER TABLE public.view_notemb_comminterpretation OWNER TO bien;

--
-- Name: view_notemb_disturbanceobs; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_disturbanceobs AS
    SELECT disturbanceobs.disturbanceobs_id, disturbanceobs.plotevent_id, disturbanceobs.disturbancetype, disturbanceobs.disturbanceintensity, disturbanceobs.disturbanceage, disturbanceobs.disturbanceextent, disturbanceobs.disturbancecomment, disturbanceobs.emb_disturbanceobs FROM disturbanceobs WHERE (disturbanceobs.emb_disturbanceobs < 6);


ALTER TABLE public.view_notemb_disturbanceobs OWNER TO bien;

--
-- Name: view_notemb_plot; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_plot AS
    SELECT plot.plot_id, plot.authorplotcode, plot.reference_id, plot.parent_id, plot.reallatitude, plot.reallongitude, plot.locationaccuracy, plot.confidentialitystatus, plot.confidentialityreason, plot.latitude, plot.longitude, plot.authore, plot.authorn, plot.authorzone, plot.authordatum, plot.authorlocation, plot.locationnarrative, plot.azimuth, plot.dsgpoly, plot.shape, plot.area, plot.standsize, plot.placementmethod, plot.permanence, plot.layoutnarrative, plot.elevation, plot.elevationaccuracy, plot.elevationrange, plot.slopeaspect, plot.minslopeaspect, plot.maxslopeaspect, plot.slopegradient, plot.minslopegradient, plot.maxslopegradient, plot.topoposition, plot.landform, plot.surficialdeposits, plot.rocktype, plot.stateprovince, plot.country, plot.submitter_surname, plot.submitter_givenname, plot.submitter_email, plot.notespublic, plot.notesmgt, plot.revisions, plot.dateentered, plot.emb_plot, plot.plotrationalenarrative, plot.accessioncode FROM plot WHERE (plot.emb_plot < 6);


ALTER TABLE public.view_notemb_plot OWNER TO bien;

--
-- Name: view_notemb_soilobs; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_soilobs AS
    SELECT soilobs.soilobs_id, soilobs.plotevent_id, soilobs.soilhorizon, soilobs.soildepthtop, soilobs.soildepthbottom, soilobs.soilcolor, soilobs.soilorganic, soilobs.soiltexture, soilobs.soilsand, soilobs.soilsilt, soilobs.soilclay, soilobs.soilcoarse, soilobs.soilph, soilobs.exchangecapacity, soilobs.basesaturation, soilobs.soildescription, soilobs.emb_soilobs FROM soilobs WHERE (soilobs.emb_soilobs < 6);


ALTER TABLE public.view_notemb_soilobs OWNER TO bien;

--
-- Name: view_notemb_stemcount; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_stemcount AS
    SELECT stemcount.stemcount_id, stemcount.collectiveobs_id, stemcount.stemdiameter, stemcount.stemdiameteraccuracy, stemcount.stemheight, stemcount.stemheightaccuracy, stemcount.stemcount, stemcount.stemtaxonarea, stemcount.emb_stemcount FROM stemcount WHERE (stemcount.emb_stemcount < 6);


ALTER TABLE public.view_notemb_stemcount OWNER TO bien;

--
-- Name: view_notemb_stemlocation; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_stemlocation AS
    SELECT individual.individual_id, individual.stemcount_id, individual.stemcode, individual.stemxposition, individual.stemyposition, individual.stemhealth, individual.emb_stemlocation FROM individual WHERE (individual.emb_stemlocation < 6);


ALTER TABLE public.view_notemb_stemlocation OWNER TO bien;

--
-- Name: view_notemb_taxonalt; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_taxonalt AS
    SELECT taxonalt.taxonalt_id, taxonalt.taxondetermination_id, taxonalt.plantconcept_id, taxonalt.taxonaltfit, taxonalt.taxonaltconfidence, taxonalt.taxonaltnotes, taxonalt.emb_taxonalt FROM taxonalt WHERE (taxonalt.emb_taxonalt < 6);


ALTER TABLE public.view_notemb_taxonalt OWNER TO bien;

--
-- Name: view_notemb_taxonimportance; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_taxonimportance AS
    SELECT collectiveobs.collectiveobs_id, collectiveobs.taxonoccurrence_id, collectiveobs.taxonbin_id, collectiveobs.cover, collectiveobs.basalarea, collectiveobs.biomass, collectiveobs.inferencearea, collectiveobs.stratumbase, collectiveobs.stratumheight, collectiveobs.emb_taxonimportance, collectiveobs.covercode FROM collectiveobs WHERE (collectiveobs.emb_taxonimportance < 6);


ALTER TABLE public.view_notemb_taxonimportance OWNER TO bien;

--
-- Name: view_notemb_taxoninterpretation; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_taxoninterpretation AS
    SELECT taxondetermination.taxondetermination_id, taxondetermination.taxonoccurrence_id, taxondetermination.individual_id, taxondetermination.plantconcept_id, taxondetermination.plantname_id, taxondetermination.party_id, taxondetermination.role_id, taxondetermination.interpretationtype, taxondetermination.reference_id, taxondetermination.originalinterpretation, taxondetermination.currentinterpretation, taxondetermination.taxonfit, taxondetermination.taxonconfidence, taxondetermination.collector_id, taxondetermination.collectionnumber, taxondetermination.museum_id, taxondetermination.museumaccessionnumber, taxondetermination.grouptype, taxondetermination.notes, taxondetermination.notespublic, taxondetermination.notesmgt, taxondetermination.revisions, taxondetermination.interpretationdate, taxondetermination.collectiondate, taxondetermination.emb_taxoninterpretation, taxondetermination.accessioncode FROM taxondetermination WHERE (taxondetermination.emb_taxoninterpretation < 6);


ALTER TABLE public.view_notemb_taxoninterpretation OWNER TO bien;

--
-- Name: view_notemb_taxonobservation; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_notemb_taxonobservation AS
    SELECT taxonoccurrence.taxonoccurrence_id, taxonoccurrence.plotevent_id, taxonoccurrence.authorplantname, taxonoccurrence.reference_id, taxonoccurrence.taxoninferencearea, taxonoccurrence.emb_taxonobservation, taxonoccurrence.int_origplantconcept_id, taxonoccurrence.int_origplantscifull, taxonoccurrence.int_origplantscinamenoauth, taxonoccurrence.int_origplantcommon, taxonoccurrence.int_origplantcode, taxonoccurrence.int_currplantconcept_id, taxonoccurrence.int_currplantscifull, taxonoccurrence.int_currplantscinamenoauth, taxonoccurrence.int_currplantcommon, taxonoccurrence.int_currplantcode, taxonoccurrence.accessioncode FROM taxonoccurrence WHERE (taxonoccurrence.emb_taxonobservation < 6);


ALTER TABLE public.view_notemb_taxonobservation OWNER TO bien;

--
-- Name: view_observation_transl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_observation_transl AS
    SELECT plotevent.plotevent_id, COALESCE(plotevent.authorobscode, plot.authorplotcode) AS observation_id_transl FROM view_notemb_observation plotevent, plot WHERE (plotevent.plot_id = plot.plot_id);


ALTER TABLE public.view_observation_transl OWNER TO bien;

--
-- Name: view_party_public; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_party_public AS
    SELECT party.party_id, party.accessioncode, party.salutation, party.surname, party.givenname, party.middlename, party.organizationname, party.contactinstructions, party.email FROM (party LEFT JOIN usr ON ((party.party_id = usr.party_id))) WHERE ((usr.usr_id IS NULL) OR (usr.permission_type > 1));


ALTER TABLE public.view_party_public OWNER TO bien;

--
-- Name: view_party_transl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_party_transl AS
    SELECT CASE WHEN (party.surname IS NULL) THEN CASE WHEN (party.organizationname IS NULL) THEN '[poorly documented party]'::text ELSE ((party.organizationname)::text || ' (organization)'::text) END ELSE ((party.surname)::text || CASE WHEN (party.givenname IS NULL) THEN ''::text ELSE (', '::text || (COALESCE(party.givenname, ''::character varying))::text) END) END AS party_id_transl, party.party_id FROM party;


ALTER TABLE public.view_party_transl OWNER TO bien;

--
-- Name: view_plantconcept_transl; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_plantconcept_transl AS
    SELECT plantconcept.plantconcept_id, plantconcept.plantname_id, plantconcept.plantname, plantconcept.reference_id, ((((plantconcept.plantname)::text || ' ['::text) || ((SELECT view_reference_transl.reference_id_transl FROM view_reference_transl WHERE (view_reference_transl.reference_id = plantconcept.reference_id)))::text) || ']'::text) AS plantconcept_id_transl FROM plantconcept;


ALTER TABLE public.view_plantconcept_transl OWNER TO bien;

--
-- Name: view_plotall_withembargo; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_plotall_withembargo AS
    SELECT plot.plot_id, plot.authorplotcode, plot.reference_id, plot.parent_id, plot.reallatitude, plot.reallongitude, plot.locationaccuracy, plot.confidentialitystatus, plot.confidentialityreason, plot.latitude, plot.longitude, plot.authore, plot.authorn, plot.authorzone, plot.authordatum, plot.authorlocation, plot.locationnarrative, plot.azimuth, plot.dsgpoly, plot.shape, plot.area, plot.standsize, plot.placementmethod, plot.permanence, plot.layoutnarrative, plot.elevation, plot.elevationaccuracy, plot.elevationrange, plot.slopeaspect, plot.minslopeaspect, plot.maxslopeaspect, plot.slopegradient, plot.minslopegradient, plot.maxslopegradient, plot.topoposition, plot.landform, plot.surficialdeposits, plot.rocktype, plot.stateprovince, plot.country, plot.submitter_surname, plot.submitter_givenname, plot.submitter_email, plot.notespublic, plot.notesmgt, plot.revisions, plot.dateentered, plot.emb_plot, plot.plotrationalenarrative, plot.accessioncode, embargo.embargo_id, embargo.embargoreason, embargo.defaultstatus, embargo.embargostart, embargo.embargostop, (embargo.defaultstatus + CASE WHEN (embargo.embargostop < now()) THEN 100 ELSE 0 END) AS embstatusinclexpired FROM (plot LEFT JOIN embargo ON ((plot.plot_id = embargo.plot_id)));


ALTER TABLE public.view_plotall_withembargo OWNER TO bien;

--
-- Name: view_std_commnames_code; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_commnames_code AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((((commusage.classsystem)::text = 'Code'::text) AND (commusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.512.NATURESERVE'::text)))) AND (commusage.usagestop IS NULL));


ALTER TABLE public.view_std_commnames_code OWNER TO bien;

--
-- Name: view_std_commnames_common; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_commnames_common AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((((commusage.classsystem)::text = 'Common'::text) AND (commusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.512.NATURESERVE'::text)))) AND (commusage.usagestop IS NULL));


ALTER TABLE public.view_std_commnames_common OWNER TO bien;

--
-- Name: view_std_commnames_sciname; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_commnames_sciname AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((((commusage.classsystem)::text = 'Scientific'::text) AND (commusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.512.NATURESERVE'::text)))) AND (commusage.usagestop IS NULL));


ALTER TABLE public.view_std_commnames_sciname OWNER TO bien;

--
-- Name: view_std_commnames_translated; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_commnames_translated AS
    SELECT commusage.commconcept_id, commusage.commname FROM commusage WHERE ((((commusage.classsystem)::text = 'Translated'::text) AND (commusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.512.NATURESERVE'::text)))) AND (commusage.usagestop IS NULL));


ALTER TABLE public.view_std_commnames_translated OWNER TO bien;

--
-- Name: view_std_plantnames_code; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_plantnames_code AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((((plantusage.classsystem)::text = 'Code'::text) AND (plantusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.511.USDANRCSPLANTS2'::text)))) AND (plantusage.usagestop IS NULL));


ALTER TABLE public.view_std_plantnames_code OWNER TO bien;

--
-- Name: view_std_plantnames_common; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_plantnames_common AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((((plantusage.classsystem)::text = 'English Common'::text) AND (plantusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.511.USDANRCSPLANTS2'::text)))) AND (plantusage.usagestop IS NULL));


ALTER TABLE public.view_std_plantnames_common OWNER TO bien;

--
-- Name: view_std_plantnames_sciname; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_plantnames_sciname AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((((plantusage.classsystem)::text = 'Scientific'::text) AND (plantusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.511.USDANRCSPLANTS2'::text)))) AND (plantusage.usagestop IS NULL));


ALTER TABLE public.view_std_plantnames_sciname OWNER TO bien;

--
-- Name: view_std_plantnames_scinamenoauth; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_std_plantnames_scinamenoauth AS
    SELECT plantusage.plantconcept_id, plantusage.plantname FROM plantusage WHERE ((((plantusage.classsystem)::text = 'Scientific without authors'::text) AND (plantusage.party_id = (SELECT party.party_id FROM party WHERE ((party.accessioncode)::text = 'VB.Py.511.USDANRCSPLANTS2'::text)))) AND (plantusage.usagestop IS NULL));


ALTER TABLE public.view_std_plantnames_scinamenoauth OWNER TO bien;

--
-- Name: view_taxoninterp_more; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_taxoninterp_more AS
    SELECT taxondetermination.taxondetermination_id, taxondetermination.taxonoccurrence_id, taxondetermination.individual_id, taxondetermination.plantconcept_id, taxondetermination.plantname_id, taxondetermination.party_id, taxondetermination.role_id, taxondetermination.interpretationtype, taxondetermination.reference_id, taxondetermination.originalinterpretation, taxondetermination.currentinterpretation, taxondetermination.taxonfit, taxondetermination.taxonconfidence, taxondetermination.collector_id, taxondetermination.collectionnumber, taxondetermination.museum_id, taxondetermination.museumaccessionnumber, taxondetermination.grouptype, taxondetermination.notes, taxondetermination.notespublic, taxondetermination.notesmgt, taxondetermination.revisions, taxondetermination.interpretationdate, taxondetermination.collectiondate, taxondetermination.emb_taxoninterpretation, taxondetermination.accessioncode, plantconcept.accessioncode AS pc_accessioncode, plantconcept.plantname AS pc_plantname, taxonoccurrence.plotevent_id FROM view_notemb_taxoninterpretation taxondetermination, taxonoccurrence, plantconcept WHERE ((taxonoccurrence.taxonoccurrence_id = taxondetermination.taxonoccurrence_id) AND (plantconcept.plantconcept_id = taxondetermination.plantconcept_id));


ALTER TABLE public.view_taxoninterp_more OWNER TO bien;

--
-- Name: view_taxonobs_withmaxcover; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_taxonobs_withmaxcover AS
    SELECT taxonoccurrence.taxonoccurrence_id, taxonoccurrence.plotevent_id, taxonoccurrence.authorplantname, taxonoccurrence.reference_id, taxonoccurrence.taxoninferencearea, taxonoccurrence.emb_taxonobservation, taxonoccurrence.int_origplantconcept_id, taxonoccurrence.int_origplantscifull, taxonoccurrence.int_origplantscinamenoauth, taxonoccurrence.int_origplantcommon, taxonoccurrence.int_origplantcode, taxonoccurrence.int_currplantconcept_id, taxonoccurrence.int_currplantscifull, taxonoccurrence.int_currplantscinamenoauth, taxonoccurrence.int_currplantcommon, taxonoccurrence.int_currplantcode, taxonoccurrence.accessioncode, (SELECT max(collectiveobs.cover) AS max FROM collectiveobs WHERE (collectiveobs.taxonoccurrence_id = taxonoccurrence.taxonoccurrence_id)) AS maxcover FROM view_notemb_taxonobservation taxonoccurrence;


ALTER TABLE public.view_taxonobs_withmaxcover OWNER TO bien;

--
-- Name: view_taxonobs_distinctid_curr; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_taxonobs_distinctid_curr AS
    SELECT userdatasetitem.userdataset_id, taxonoccurrence.plotevent_id, taxonoccurrence.int_currplantconcept_id AS plantconcept_id, max(taxonoccurrence.maxcover) AS maxplantcover FROM view_taxonobs_withmaxcover taxonoccurrence, userdatasetitem WHERE ((taxonoccurrence.plotevent_id = userdatasetitem.itemrecord) AND ((userdatasetitem.itemtable)::text = 'plotevent'::text)) GROUP BY taxonoccurrence.int_currplantconcept_id, userdatasetitem.userdataset_id, taxonoccurrence.plotevent_id;


ALTER TABLE public.view_taxonobs_distinctid_curr OWNER TO bien;

--
-- Name: view_taxonobs_distinctid_curr_counts; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_taxonobs_distinctid_curr_counts AS
    SELECT view_taxonobs_distinctid_curr.userdataset_id, view_taxonobs_distinctid_curr.plantconcept_id, count(1) AS countobs, avg(view_taxonobs_distinctid_curr.maxplantcover) AS avgcovernoround, min(view_taxonobs_distinctid_curr.maxplantcover) AS mincovernoround, max(view_taxonobs_distinctid_curr.maxplantcover) AS maxcovernoround FROM view_taxonobs_distinctid_curr GROUP BY view_taxonobs_distinctid_curr.userdataset_id, view_taxonobs_distinctid_curr.plantconcept_id;


ALTER TABLE public.view_taxonobs_distinctid_curr_counts OWNER TO bien;

--
-- Name: view_taxonobs_distinctid_curr_counts_plants; Type: VIEW; Schema: public; Owner: bien
--

CREATE VIEW view_taxonobs_distinctid_curr_counts_plants AS
    SELECT view_taxonobs_distinctid_curr_counts.userdataset_id, view_taxonobs_distinctid_curr_counts.plantconcept_id, view_taxonobs_distinctid_curr_counts.countobs, view_taxonobs_distinctid_curr_counts.avgcovernoround, view_taxonobs_distinctid_curr_counts.mincovernoround, view_taxonobs_distinctid_curr_counts.maxcovernoround, round((view_taxonobs_distinctid_curr_counts.avgcovernoround)::numeric, 3) AS avgcover, round((view_taxonobs_distinctid_curr_counts.mincovernoround)::numeric, 3) AS mincover, round((view_taxonobs_distinctid_curr_counts.maxcovernoround)::numeric, 3) AS maxcover, temptbl_std_plantnames.plantname, temptbl_std_plantnames.sciname, temptbl_std_plantnames.scinamenoauth, temptbl_std_plantnames.code, temptbl_std_plantnames.common FROM temptbl_std_plantnames, view_taxonobs_distinctid_curr_counts WHERE (view_taxonobs_distinctid_curr_counts.plantconcept_id = temptbl_std_plantnames.plantconcept_id);


ALTER TABLE public.view_taxonobs_distinctid_curr_counts_plants OWNER TO bien;

--
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE address ALTER COLUMN address_id SET DEFAULT nextval('address_address_id_seq'::regclass);


--
-- Name: role_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE aux_role ALTER COLUMN role_id SET DEFAULT nextval('aux_role_role_id_seq'::regclass);


--
-- Name: classcontributor_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE classcontributor ALTER COLUMN classcontributor_id SET DEFAULT nextval('classcontributor_classcontributor_id_seq'::regclass);


--
-- Name: commclass_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commclass ALTER COLUMN commclass_id SET DEFAULT nextval('commclass_commclass_id_seq'::regclass);


--
-- Name: commconcept_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commconcept ALTER COLUMN commconcept_id SET DEFAULT nextval('commconcept_commconcept_id_seq'::regclass);


--
-- Name: commcorrelation_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commcorrelation ALTER COLUMN commcorrelation_id SET DEFAULT nextval('commcorrelation_commcorrelation_id_seq'::regclass);


--
-- Name: comminterpretation_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE comminterpretation ALTER COLUMN comminterpretation_id SET DEFAULT nextval('comminterpretation_comminterpretation_id_seq'::regclass);


--
-- Name: commlineage_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commlineage ALTER COLUMN commlineage_id SET DEFAULT nextval('commlineage_commlineage_id_seq'::regclass);


--
-- Name: commname_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commname ALTER COLUMN commname_id SET DEFAULT nextval('commname_commname_id_seq'::regclass);


--
-- Name: commstatus_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commstatus ALTER COLUMN commstatus_id SET DEFAULT nextval('commstatus_commstatus_id_seq'::regclass);


--
-- Name: commusage_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE commusage ALTER COLUMN commusage_id SET DEFAULT nextval('commusage_commusage_id_seq'::regclass);


--
-- Name: coverindex_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE coverindex ALTER COLUMN coverindex_id SET DEFAULT nextval('coverindex_coverindex_id_seq'::regclass);


--
-- Name: covermethod_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE covermethod ALTER COLUMN covermethod_id SET DEFAULT nextval('covermethod_covermethod_id_seq'::regclass);


--
-- Name: cookie_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_cookie ALTER COLUMN cookie_id SET DEFAULT nextval('dba_cookie_cookie_id_seq'::regclass);


--
-- Name: cookielabel_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_cookielabels ALTER COLUMN cookielabel_id SET DEFAULT nextval('dba_cookielabels_cookielabel_id_seq'::regclass);


--
-- Name: dba_datacache_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_datacache ALTER COLUMN dba_datacache_id SET DEFAULT nextval('dba_datacache_dba_datacache_id_seq'::regclass);


--
-- Name: dba_datamodelversion_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_datamodelversion ALTER COLUMN dba_datamodelversion_id SET DEFAULT nextval('dba_datamodelversion_dba_datamodelversion_id_seq'::regclass);


--
-- Name: stat_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_dbstatstime ALTER COLUMN stat_id SET DEFAULT nextval('dba_dbstatstime_stat_id_seq'::regclass);


--
-- Name: dba_fielddescription_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_fielddescription ALTER COLUMN dba_fielddescription_id SET DEFAULT nextval('dba_fielddescription_dba_fielddescription_id_seq'::regclass);


--
-- Name: dba_fieldlist_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_fieldlist ALTER COLUMN dba_fieldlist_id SET DEFAULT nextval('dba_fieldlist_dba_fieldlist_id_seq'::regclass);


--
-- Name: dba_onerow_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_onerow ALTER COLUMN dba_onerow_id SET DEFAULT nextval('dba_onerow_dba_onerow_id_seq'::regclass);


--
-- Name: dba_preassignacccode_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_preassignacccode ALTER COLUMN dba_preassignacccode_id SET DEFAULT nextval('dba_preassignacccode_dba_preassignacccode_id_seq'::regclass);


--
-- Name: dba_tabledescription_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE dba_tabledescription ALTER COLUMN dba_tabledescription_id SET DEFAULT nextval('dba_tabledescription_dba_tabledescription_id_seq'::regclass);


--
-- Name: definedvalue_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE definedvalue ALTER COLUMN definedvalue_id SET DEFAULT nextval('definedvalue_definedvalue_id_seq'::regclass);


--
-- Name: disturbanceobs_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE disturbanceobs ALTER COLUMN disturbanceobs_id SET DEFAULT nextval('disturbanceobs_disturbanceobs_id_seq'::regclass);


--
-- Name: embargo_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE embargo ALTER COLUMN embargo_id SET DEFAULT nextval('embargo_embargo_id_seq'::regclass);


--
-- Name: graphic_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE graphic ALTER COLUMN graphic_id SET DEFAULT nextval('graphic_graphic_id_seq'::regclass);


--
-- Name: namedplace_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE namedplace ALTER COLUMN namedplace_id SET DEFAULT nextval('namedplace_namedplace_id_seq'::regclass);


--
-- Name: namedplacecorrelation_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE namedplacecorrelation ALTER COLUMN namedplacecorrelation_id SET DEFAULT nextval('namedplacecorrelation_namedplacecorrelation_id_seq'::regclass);


--
-- Name: note_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE note ALTER COLUMN note_id SET DEFAULT nextval('note_note_id_seq'::regclass);


--
-- Name: notelink_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE notelink ALTER COLUMN notelink_id SET DEFAULT nextval('notelink_notelink_id_seq'::regclass);


--
-- Name: plotevent_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plotevent ALTER COLUMN plotevent_id SET DEFAULT nextval('observation_observation_id_seq'::regclass);


--
-- Name: observationcontributor_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE observationcontributor ALTER COLUMN observationcontributor_id SET DEFAULT nextval('observationcontributor_observationcontributor_id_seq'::regclass);


--
-- Name: observationsynonym_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE observationsynonym ALTER COLUMN observationsynonym_id SET DEFAULT nextval('observationsynonym_observationsynonym_id_seq'::regclass);


--
-- Name: party_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE party ALTER COLUMN party_id SET DEFAULT nextval('party_party_id_seq'::regclass);


--
-- Name: partymember_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE partymember ALTER COLUMN partymember_id SET DEFAULT nextval('partymember_partymember_id_seq'::regclass);


--
-- Name: plotplace_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE place ALTER COLUMN plotplace_id SET DEFAULT nextval('place_plotplace_id_seq'::regclass);


--
-- Name: plantconcept_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantconcept ALTER COLUMN plantconcept_id SET DEFAULT nextval('plantconcept_plantconcept_id_seq'::regclass);


--
-- Name: plantcorrelation_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantcorrelation ALTER COLUMN plantcorrelation_id SET DEFAULT nextval('plantcorrelation_plantcorrelation_id_seq'::regclass);


--
-- Name: plantlineage_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantlineage ALTER COLUMN plantlineage_id SET DEFAULT nextval('plantlineage_plantlineage_id_seq'::regclass);


--
-- Name: plantname_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantname ALTER COLUMN plantname_id SET DEFAULT nextval('plantname_plantname_id_seq'::regclass);


--
-- Name: plantstatus_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantstatus ALTER COLUMN plantstatus_id SET DEFAULT nextval('plantstatus_plantstatus_id_seq'::regclass);


--
-- Name: plantusage_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plantusage ALTER COLUMN plantusage_id SET DEFAULT nextval('plantusage_plantusage_id_seq'::regclass);


--
-- Name: plot_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE plot ALTER COLUMN plot_id SET DEFAULT nextval('plot_plot_id_seq'::regclass);


--
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE project ALTER COLUMN project_id SET DEFAULT nextval('project_project_id_seq'::regclass);


--
-- Name: projectcontributor_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE projectcontributor ALTER COLUMN projectcontributor_id SET DEFAULT nextval('projectcontributor_projectcontributor_id_seq'::regclass);


--
-- Name: reference_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE reference ALTER COLUMN reference_id SET DEFAULT nextval('reference_reference_id_seq'::regclass);


--
-- Name: referencealtident_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE referencealtident ALTER COLUMN referencealtident_id SET DEFAULT nextval('referencealtident_referencealtident_id_seq'::regclass);


--
-- Name: referencecontributor_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE referencecontributor ALTER COLUMN referencecontributor_id SET DEFAULT nextval('referencecontributor_referencecontributor_id_seq'::regclass);


--
-- Name: referencejournal_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE referencejournal ALTER COLUMN referencejournal_id SET DEFAULT nextval('referencejournal_referencejournal_id_seq'::regclass);


--
-- Name: referenceparty_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE referenceparty ALTER COLUMN referenceparty_id SET DEFAULT nextval('referenceparty_referenceparty_id_seq'::regclass);


--
-- Name: revision_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE revision ALTER COLUMN revision_id SET DEFAULT nextval('revision_revision_id_seq'::regclass);


--
-- Name: soilobs_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE soilobs ALTER COLUMN soilobs_id SET DEFAULT nextval('soilobs_soilobs_id_seq'::regclass);


--
-- Name: soiltaxon_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE soiltaxon ALTER COLUMN soiltaxon_id SET DEFAULT nextval('soiltaxon_soiltaxon_id_seq'::regclass);


--
-- Name: stemcount_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE stemcount ALTER COLUMN stemcount_id SET DEFAULT nextval('stemcount_stemcount_id_seq'::regclass);


--
-- Name: individual_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE individual ALTER COLUMN individual_id SET DEFAULT nextval('stemlocation_stemlocation_id_seq'::regclass);


--
-- Name: taxonbin_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE taxonbin ALTER COLUMN taxonbin_id SET DEFAULT nextval('stratum_stratum_id_seq'::regclass);


--
-- Name: stratummethod_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE stratummethod ALTER COLUMN stratummethod_id SET DEFAULT nextval('stratummethod_stratummethod_id_seq'::regclass);


--
-- Name: stratumtype_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE stratumtype ALTER COLUMN stratumtype_id SET DEFAULT nextval('stratumtype_stratumtype_id_seq'::regclass);


--
-- Name: taxonalt_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE taxonalt ALTER COLUMN taxonalt_id SET DEFAULT nextval('taxonalt_taxonalt_id_seq'::regclass);


--
-- Name: collectiveobs_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE collectiveobs ALTER COLUMN collectiveobs_id SET DEFAULT nextval('taxonimportance_taxonimportance_id_seq'::regclass);


--
-- Name: taxondetermination_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE taxondetermination ALTER COLUMN taxondetermination_id SET DEFAULT nextval('taxoninterpretation_taxoninterpretation_id_seq'::regclass);


--
-- Name: taxonoccurrence_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE taxonoccurrence ALTER COLUMN taxonoccurrence_id SET DEFAULT nextval('taxonobservation_taxonobservation_id_seq'::regclass);


--
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE telephone ALTER COLUMN telephone_id SET DEFAULT nextval('telephone_telephone_id_seq'::regclass);


--
-- Name: commconcept_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE temptbl_std_commnames ALTER COLUMN commconcept_id SET DEFAULT nextval('temptbl_std_commnames_commconcept_id_seq'::regclass);


--
-- Name: plantconcept_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE temptbl_std_plantnames ALTER COLUMN plantconcept_id SET DEFAULT nextval('temptbl_std_plantnames_plantconcept_id_seq'::regclass);


--
-- Name: usercertification_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE usercertification ALTER COLUMN usercertification_id SET DEFAULT nextval('usercertification_usercertification_id_seq'::regclass);


--
-- Name: userdataset_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userdataset ALTER COLUMN userdataset_id SET DEFAULT nextval('userdataset_userdataset_id_seq'::regclass);


--
-- Name: userdatasetitem_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userdatasetitem ALTER COLUMN userdatasetitem_id SET DEFAULT nextval('userdatasetitem_userdatasetitem_id_seq'::regclass);


--
-- Name: userdefined_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userdefined ALTER COLUMN userdefined_id SET DEFAULT nextval('userdefined_userdefined_id_seq'::regclass);


--
-- Name: usernotify_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE usernotify ALTER COLUMN usernotify_id SET DEFAULT nextval('usernotify_usernotify_id_seq'::regclass);


--
-- Name: userpermission_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userpermission ALTER COLUMN userpermission_id SET DEFAULT nextval('userpermission_userpermission_id_seq'::regclass);


--
-- Name: userpreference_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userpreference ALTER COLUMN userpreference_id SET DEFAULT nextval('userpreference_userpreference_id_seq'::regclass);


--
-- Name: userquery_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userquery ALTER COLUMN userquery_id SET DEFAULT nextval('userquery_userquery_id_seq'::regclass);


--
-- Name: userrecordowner_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userrecordowner ALTER COLUMN userrecordowner_id SET DEFAULT nextval('userrecordowner_userrecordowner_id_seq'::regclass);


--
-- Name: userregionalexp_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE userregionalexp ALTER COLUMN userregionalexp_id SET DEFAULT nextval('userregionalexp_userregionalexp_id_seq'::regclass);


--
-- Name: usr_id; Type: DEFAULT; Schema: public; Owner: bien
--

ALTER TABLE usr ALTER COLUMN usr_id SET DEFAULT nextval('usr_usr_id_seq'::regclass);


--
-- Name: address_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY address
    ADD CONSTRAINT address_pkey PRIMARY KEY (address_id);


--
-- Name: aux_role_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY aux_role
    ADD CONSTRAINT aux_role_pkey PRIMARY KEY (role_id);


--
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY classcontributor
    ADD CONSTRAINT classcontributor_pkey PRIMARY KEY (classcontributor_id);


--
-- Name: commclass_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commclass
    ADD CONSTRAINT commclass_pkey PRIMARY KEY (commclass_id);


--
-- Name: commconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commconcept
    ADD CONSTRAINT commconcept_pkey PRIMARY KEY (commconcept_id);


--
-- Name: commcorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commcorrelation
    ADD CONSTRAINT commcorrelation_pkey PRIMARY KEY (commcorrelation_id);


--
-- Name: comminterpretation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY comminterpretation
    ADD CONSTRAINT comminterpretation_pkey PRIMARY KEY (comminterpretation_id);


--
-- Name: commlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commlineage
    ADD CONSTRAINT commlineage_pkey PRIMARY KEY (commlineage_id);


--
-- Name: commname_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commname
    ADD CONSTRAINT commname_pkey PRIMARY KEY (commname_id);


--
-- Name: commstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commstatus
    ADD CONSTRAINT commstatus_pkey PRIMARY KEY (commstatus_id);


--
-- Name: commusage_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY commusage
    ADD CONSTRAINT commusage_pkey PRIMARY KEY (commusage_id);


--
-- Name: coverindex_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY coverindex
    ADD CONSTRAINT coverindex_pkey PRIMARY KEY (coverindex_id);


--
-- Name: covermethod_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY covermethod
    ADD CONSTRAINT covermethod_pkey PRIMARY KEY (covermethod_id);


--
-- Name: dba_confidentialitystatus_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_confidentialitystatus
    ADD CONSTRAINT dba_confidentialitystatus_pkey PRIMARY KEY (confidentialitystatus);


--
-- Name: dba_cookie_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_cookie
    ADD CONSTRAINT dba_cookie_pkey PRIMARY KEY (cookie_id);


--
-- Name: dba_cookielabels_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_cookielabels
    ADD CONSTRAINT dba_cookielabels_pkey PRIMARY KEY (vieworcookie);


--
-- Name: dba_datacache_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_datacache
    ADD CONSTRAINT dba_datacache_pkey PRIMARY KEY (dba_datacache_id);


--
-- Name: dba_datamodelversion_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_datamodelversion
    ADD CONSTRAINT dba_datamodelversion_pkey PRIMARY KEY (dba_datamodelversion_id);


--
-- Name: dba_dbstatstime_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_dbstatstime
    ADD CONSTRAINT dba_dbstatstime_pkey PRIMARY KEY (stat_id);


--
-- Name: dba_fielddescription_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_fielddescription
    ADD CONSTRAINT dba_fielddescription_pkey PRIMARY KEY (dba_fielddescription_id);


--
-- Name: dba_fieldlist_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_fieldlist
    ADD CONSTRAINT dba_fieldlist_pkey PRIMARY KEY (dba_fieldlist_id);


--
-- Name: dba_onerow_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_onerow
    ADD CONSTRAINT dba_onerow_pkey PRIMARY KEY (dba_onerow_id);


--
-- Name: dba_preassignacccode_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_preassignacccode
    ADD CONSTRAINT dba_preassignacccode_pkey PRIMARY KEY (dba_preassignacccode_id);


--
-- Name: dba_tabledescription_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY dba_tabledescription
    ADD CONSTRAINT dba_tabledescription_pkey PRIMARY KEY (dba_tabledescription_id);


--
-- Name: definedvalue_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY definedvalue
    ADD CONSTRAINT definedvalue_pkey PRIMARY KEY (definedvalue_id);


--
-- Name: disturbanceobs_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY disturbanceobs
    ADD CONSTRAINT disturbanceobs_pkey PRIMARY KEY (disturbanceobs_id);


--
-- Name: embargo_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY embargo
    ADD CONSTRAINT embargo_pkey PRIMARY KEY (embargo_id);


--
-- Name: graphic_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY graphic
    ADD CONSTRAINT graphic_pkey PRIMARY KEY (graphic_id);


--
-- Name: namedplace_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY namedplace
    ADD CONSTRAINT namedplace_pkey PRIMARY KEY (namedplace_id);


--
-- Name: namedplacecorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY namedplacecorrelation
    ADD CONSTRAINT namedplacecorrelation_pkey PRIMARY KEY (namedplacecorrelation_id);


--
-- Name: note_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY note
    ADD CONSTRAINT note_pkey PRIMARY KEY (note_id);


--
-- Name: notelink_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY notelink
    ADD CONSTRAINT notelink_pkey PRIMARY KEY (notelink_id);


--
-- Name: observation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT observation_pkey PRIMARY KEY (plotevent_id);


--
-- Name: observationcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY observationcontributor
    ADD CONSTRAINT observationcontributor_pkey PRIMARY KEY (observationcontributor_id);


--
-- Name: observationsynonym_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY observationsynonym
    ADD CONSTRAINT observationsynonym_pkey PRIMARY KEY (observationsynonym_id);


--
-- Name: party_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY party
    ADD CONSTRAINT party_pkey PRIMARY KEY (party_id);


--
-- Name: partymember_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY partymember
    ADD CONSTRAINT partymember_pkey PRIMARY KEY (partymember_id);


--
-- Name: place_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY place
    ADD CONSTRAINT place_pkey PRIMARY KEY (plotplace_id);


--
-- Name: plantconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantconcept
    ADD CONSTRAINT plantconcept_pkey PRIMARY KEY (plantconcept_id);


--
-- Name: plantcorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantcorrelation
    ADD CONSTRAINT plantcorrelation_pkey PRIMARY KEY (plantcorrelation_id);


--
-- Name: plantlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantlineage
    ADD CONSTRAINT plantlineage_pkey PRIMARY KEY (plantlineage_id);


--
-- Name: plantname_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantname
    ADD CONSTRAINT plantname_pkey PRIMARY KEY (plantname_id);


--
-- Name: plantstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantstatus
    ADD CONSTRAINT plantstatus_pkey PRIMARY KEY (plantstatus_id);


--
-- Name: plantusage_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plantusage
    ADD CONSTRAINT plantusage_pkey PRIMARY KEY (plantusage_id);


--
-- Name: plot_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY plot
    ADD CONSTRAINT plot_pkey PRIMARY KEY (plot_id);


--
-- Name: project_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY project
    ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);


--
-- Name: projectcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY projectcontributor
    ADD CONSTRAINT projectcontributor_pkey PRIMARY KEY (projectcontributor_id);


--
-- Name: reference_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY reference
    ADD CONSTRAINT reference_pkey PRIMARY KEY (reference_id);


--
-- Name: referencealtident_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY referencealtident
    ADD CONSTRAINT referencealtident_pkey PRIMARY KEY (referencealtident_id);


--
-- Name: referencecontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY referencecontributor
    ADD CONSTRAINT referencecontributor_pkey PRIMARY KEY (referencecontributor_id);


--
-- Name: referencejournal_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY referencejournal
    ADD CONSTRAINT referencejournal_pkey PRIMARY KEY (referencejournal_id);


--
-- Name: referenceparty_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY referenceparty
    ADD CONSTRAINT referenceparty_pkey PRIMARY KEY (referenceparty_id);


--
-- Name: revision_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY revision
    ADD CONSTRAINT revision_pkey PRIMARY KEY (revision_id);


--
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY soilobs
    ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);


--
-- Name: soiltaxon_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY soiltaxon
    ADD CONSTRAINT soiltaxon_pkey PRIMARY KEY (soiltaxon_id);


--
-- Name: stemcount_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY stemcount
    ADD CONSTRAINT stemcount_pkey PRIMARY KEY (stemcount_id);


--
-- Name: stemlocation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY individual
    ADD CONSTRAINT stemlocation_pkey PRIMARY KEY (individual_id);


--
-- Name: stratum_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY taxonbin
    ADD CONSTRAINT stratum_pkey PRIMARY KEY (taxonbin_id);


--
-- Name: stratummethod_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY stratummethod
    ADD CONSTRAINT stratummethod_pkey PRIMARY KEY (stratummethod_id);


--
-- Name: stratumtype_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY stratumtype
    ADD CONSTRAINT stratumtype_pkey PRIMARY KEY (stratumtype_id);


--
-- Name: taxonalt_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY taxonalt
    ADD CONSTRAINT taxonalt_pkey PRIMARY KEY (taxonalt_id);


--
-- Name: taxonimportance_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY collectiveobs
    ADD CONSTRAINT taxonimportance_pkey PRIMARY KEY (collectiveobs_id);


--
-- Name: taxoninterpretation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT taxoninterpretation_pkey PRIMARY KEY (taxondetermination_id);


--
-- Name: taxonobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY taxonoccurrence
    ADD CONSTRAINT taxonobservation_pkey PRIMARY KEY (taxonoccurrence_id);


--
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY telephone
    ADD CONSTRAINT telephone_pkey PRIMARY KEY (telephone_id);


--
-- Name: temptbl_std_commnames_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY temptbl_std_commnames
    ADD CONSTRAINT temptbl_std_commnames_pkey PRIMARY KEY (commconcept_id);


--
-- Name: temptbl_std_plantnames_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY temptbl_std_plantnames
    ADD CONSTRAINT temptbl_std_plantnames_pkey PRIMARY KEY (plantconcept_id);


--
-- Name: usercertification_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY usercertification
    ADD CONSTRAINT usercertification_pkey PRIMARY KEY (usercertification_id);


--
-- Name: userdataset_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userdataset
    ADD CONSTRAINT userdataset_pkey PRIMARY KEY (userdataset_id);


--
-- Name: userdatasetitem_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userdatasetitem
    ADD CONSTRAINT userdatasetitem_pkey PRIMARY KEY (userdatasetitem_id);


--
-- Name: userdatasetitem_userdataset_id_key; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userdatasetitem
    ADD CONSTRAINT userdatasetitem_userdataset_id_key UNIQUE (userdataset_id, itemaccessioncode);


--
-- Name: userdefined_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userdefined
    ADD CONSTRAINT userdefined_pkey PRIMARY KEY (userdefined_id);


--
-- Name: usernotify_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY usernotify
    ADD CONSTRAINT usernotify_pkey PRIMARY KEY (usernotify_id);


--
-- Name: userpermission_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userpermission
    ADD CONSTRAINT userpermission_pkey PRIMARY KEY (userpermission_id);


--
-- Name: userpreference_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userpreference
    ADD CONSTRAINT userpreference_pkey PRIMARY KEY (userpreference_id);


--
-- Name: userquery_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userquery
    ADD CONSTRAINT userquery_pkey PRIMARY KEY (userquery_id);


--
-- Name: userrecordowner_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userrecordowner
    ADD CONSTRAINT userrecordowner_pkey PRIMARY KEY (userrecordowner_id);


--
-- Name: userregionalexp_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY userregionalexp
    ADD CONSTRAINT userregionalexp_pkey PRIMARY KEY (userregionalexp_id);


--
-- Name: usr_pkey; Type: CONSTRAINT; Schema: public; Owner: bien; Tablespace: 
--

ALTER TABLE ONLY usr
    ADD CONSTRAINT usr_pkey PRIMARY KEY (usr_id);


--
-- Name: address_organization_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX address_organization_id_x ON address USING btree (organization_id);


--
-- Name: address_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX address_party_id_x ON address USING btree (party_id);


--
-- Name: aux_role_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX aux_role_accessioncode_index ON aux_role USING btree (accessioncode);


--
-- Name: classcontributor_commclass_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX classcontributor_commclass_id_x ON classcontributor USING btree (commclass_id);


--
-- Name: classcontributor_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX classcontributor_party_id_x ON classcontributor USING btree (party_id);


--
-- Name: classcontributor_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX classcontributor_role_id_x ON classcontributor USING btree (role_id);


--
-- Name: commclass_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX commclass_accessioncode_index ON commclass USING btree (accessioncode);


--
-- Name: commclass_classpublication_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commclass_classpublication_id_x ON commclass USING btree (classpublication_id);


--
-- Name: commclass_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commclass_observation_id_x ON commclass USING btree (plotevent_id);


--
-- Name: commconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX commconcept_accessioncode_index ON commconcept USING btree (accessioncode);


--
-- Name: commconcept_commname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commconcept_commname_id_x ON commconcept USING btree (commname_id);


--
-- Name: commconcept_dobscount_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commconcept_dobscount_x ON commconcept USING btree (d_obscount);


--
-- Name: commconcept_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commconcept_reference_id_x ON commconcept USING btree (reference_id);


--
-- Name: commcorrelation_commconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commcorrelation_commconcept_id_x ON commcorrelation USING btree (commconcept_id);


--
-- Name: commcorrelation_commstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commcorrelation_commstatus_id_x ON commcorrelation USING btree (commstatus_id);


--
-- Name: comminterpretation_commauthority_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX comminterpretation_commauthority_id_x ON comminterpretation USING btree (commauthority_id);


--
-- Name: comminterpretation_commclass_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX comminterpretation_commclass_id_x ON comminterpretation USING btree (commclass_id);


--
-- Name: comminterpretation_commconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX comminterpretation_commconcept_id_x ON comminterpretation USING btree (commconcept_id);


--
-- Name: commlineage_childcommstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commlineage_childcommstatus_id_x ON commlineage USING btree (childcommstatus_id);


--
-- Name: commlineage_parentcommstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commlineage_parentcommstatus_id_x ON commlineage USING btree (parentcommstatus_id);


--
-- Name: commname_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commname_reference_id_x ON commname USING btree (reference_id);


--
-- Name: commstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX commstatus_accessioncode_index ON commstatus USING btree (accessioncode);


--
-- Name: commstatus_commconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commstatus_commconcept_id_x ON commstatus USING btree (commconcept_id);


--
-- Name: commstatus_commlevel_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commstatus_commlevel_x ON commstatus USING btree (commlevel);


--
-- Name: commstatus_commparent_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commstatus_commparent_id_x ON commstatus USING btree (commparent_id);


--
-- Name: commstatus_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commstatus_party_id_x ON commstatus USING btree (party_id);


--
-- Name: commstatus_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commstatus_reference_id_x ON commstatus USING btree (reference_id);


--
-- Name: commusage_classsystem_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_classsystem_x ON commusage USING btree (classsystem);


--
-- Name: commusage_commconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_commconcept_id_x ON commusage USING btree (commconcept_id);


--
-- Name: commusage_commname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_commname_id_x ON commusage USING btree (commname_id);


--
-- Name: commusage_commname_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_commname_x ON commusage USING btree (commname);


--
-- Name: commusage_commstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_commstatus_id_x ON commusage USING btree (commstatus_id);


--
-- Name: commusage_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX commusage_party_id_x ON commusage USING btree (party_id);


--
-- Name: coverindex_covermethod_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX coverindex_covermethod_id_x ON coverindex USING btree (covermethod_id);


--
-- Name: covermethod_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX covermethod_accessioncode_index ON covermethod USING btree (accessioncode);


--
-- Name: covermethod_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX covermethod_reference_id_x ON covermethod USING btree (reference_id);


--
-- Name: dba_datacache_key; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX dba_datacache_key ON dba_datacache USING btree (cache_key);


--
-- Name: definedvalue_userdefined_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX definedvalue_userdefined_id_x ON definedvalue USING btree (userdefined_id);


--
-- Name: disturbanceobs_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX disturbanceobs_observation_id_x ON disturbanceobs USING btree (plotevent_id);


--
-- Name: emb_classcontributor_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_classcontributor_idx ON classcontributor USING btree (emb_classcontributor);


--
-- Name: emb_commclass_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_commclass_idx ON commclass USING btree (emb_commclass);


--
-- Name: emb_comminterpretation_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_comminterpretation_idx ON comminterpretation USING btree (emb_comminterpretation);


--
-- Name: emb_disturbanceobs_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_disturbanceobs_idx ON disturbanceobs USING btree (emb_disturbanceobs);


--
-- Name: emb_observation_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_observation_idx ON plotevent USING btree (emb_observation);


--
-- Name: emb_plot_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_plot_idx ON plot USING btree (emb_plot);


--
-- Name: emb_soilobs_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_soilobs_idx ON soilobs USING btree (emb_soilobs);


--
-- Name: emb_stemcount_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_stemcount_idx ON stemcount USING btree (emb_stemcount);


--
-- Name: emb_stemlocation_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_stemlocation_idx ON individual USING btree (emb_stemlocation);


--
-- Name: emb_taxonalt_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_taxonalt_idx ON taxonalt USING btree (emb_taxonalt);


--
-- Name: emb_taxonimportance_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_taxonimportance_idx ON collectiveobs USING btree (emb_taxonimportance);


--
-- Name: emb_taxoninterpretation_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_taxoninterpretation_idx ON taxondetermination USING btree (emb_taxoninterpretation);


--
-- Name: emb_taxonobservation_idx; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX emb_taxonobservation_idx ON taxonoccurrence USING btree (emb_taxonobservation);


--
-- Name: embargo_plot_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX embargo_plot_id_x ON embargo USING btree (plot_id);


--
-- Name: graphic_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX graphic_accessioncode_index ON graphic USING btree (accessioncode);


--
-- Name: graphic_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX graphic_observation_id_x ON graphic USING btree (plotevent_id);


--
-- Name: keywords_table_id_entity_key; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX keywords_table_id_entity_key ON keywords USING btree (table_id, entity);


--
-- Name: namedplace_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX namedplace_accessioncode_index ON namedplace USING btree (accessioncode);


--
-- Name: namedplace_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX namedplace_reference_id_x ON namedplace USING btree (reference_id);


--
-- Name: note_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX note_accessioncode_index ON note USING btree (accessioncode);


--
-- Name: note_notelink_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX note_notelink_id_x ON note USING btree (notelink_id);


--
-- Name: note_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX note_party_id_x ON note USING btree (party_id);


--
-- Name: note_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX note_role_id_x ON note USING btree (role_id);


--
-- Name: observation_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX observation_accessioncode_index ON plotevent USING btree (accessioncode);


--
-- Name: observation_covermethod_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_covermethod_id_x ON plotevent USING btree (covermethod_id);


--
-- Name: observation_plot_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_plot_id_x ON plotevent USING btree (plot_id);


--
-- Name: observation_previousobs_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_previousobs_id_x ON plotevent USING btree (previousobs_id);


--
-- Name: observation_project_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_project_id_x ON plotevent USING btree (project_id);


--
-- Name: observation_soiltaxon_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_soiltaxon_id_x ON plotevent USING btree (soiltaxon_id);


--
-- Name: observation_stratummethod_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observation_stratummethod_id_x ON plotevent USING btree (stratummethod_id);


--
-- Name: observationcontributor_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationcontributor_observation_id_x ON observationcontributor USING btree (plotevent_id);


--
-- Name: observationcontributor_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationcontributor_party_id_x ON observationcontributor USING btree (party_id);


--
-- Name: observationcontributor_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationcontributor_role_id_x ON observationcontributor USING btree (role_id);


--
-- Name: observationsynonym_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX observationsynonym_accessioncode_index ON observationsynonym USING btree (accessioncode);


--
-- Name: observationsynonym_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationsynonym_party_id_x ON observationsynonym USING btree (party_id);


--
-- Name: observationsynonym_primaryobservation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationsynonym_primaryobservation_id_x ON observationsynonym USING btree (primaryobservation_id);


--
-- Name: observationsynonym_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationsynonym_role_id_x ON observationsynonym USING btree (role_id);


--
-- Name: observationsynonym_synonymobservation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX observationsynonym_synonymobservation_id_x ON observationsynonym USING btree (synonymobservation_id);


--
-- Name: party_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX party_accessioncode_index ON party USING btree (accessioncode);


--
-- Name: party_currentname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX party_currentname_id_x ON party USING btree (currentname_id);


--
-- Name: partymember_childparty_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX partymember_childparty_id_x ON partymember USING btree (childparty_id);


--
-- Name: partymember_parentparty_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX partymember_parentparty_id_x ON partymember USING btree (parentparty_id);


--
-- Name: partymember_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX partymember_role_id_x ON partymember USING btree (role_id);


--
-- Name: place_namedplace_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX place_namedplace_id_x ON place USING btree (namedplace_id);


--
-- Name: place_plot_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX place_plot_id_x ON place USING btree (plot_id);


--
-- Name: plantconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX plantconcept_accessioncode_index ON plantconcept USING btree (accessioncode);


--
-- Name: plantconcept_dobscount_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantconcept_dobscount_x ON plantconcept USING btree (d_obscount);


--
-- Name: plantconcept_plantname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantconcept_plantname_id_x ON plantconcept USING btree (plantname_id);


--
-- Name: plantconcept_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantconcept_reference_id_x ON plantconcept USING btree (reference_id);


--
-- Name: plantcorrelation_plantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantcorrelation_plantconcept_id_x ON plantcorrelation USING btree (plantconcept_id);


--
-- Name: plantcorrelation_plantstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantcorrelation_plantstatus_id_x ON plantcorrelation USING btree (plantstatus_id);


--
-- Name: plantlineage_childplantstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantlineage_childplantstatus_id_x ON plantlineage USING btree (childplantstatus_id);


--
-- Name: plantlineage_parentplantstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantlineage_parentplantstatus_id_x ON plantlineage USING btree (parentplantstatus_id);


--
-- Name: plantname_plantname_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantname_plantname_x ON plantname USING btree (plantname);


--
-- Name: plantname_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantname_reference_id_x ON plantname USING btree (reference_id);


--
-- Name: plantstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX plantstatus_accessioncode_index ON plantstatus USING btree (accessioncode);


--
-- Name: plantstatus_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantstatus_party_id_x ON plantstatus USING btree (party_id);


--
-- Name: plantstatus_plantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantstatus_plantconcept_id_x ON plantstatus USING btree (plantconcept_id);


--
-- Name: plantstatus_plantlevel_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantstatus_plantlevel_x ON plantstatus USING btree (plantlevel);


--
-- Name: plantstatus_plantparent_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantstatus_plantparent_id_x ON plantstatus USING btree (plantparent_id);


--
-- Name: plantstatus_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantstatus_reference_id_x ON plantstatus USING btree (reference_id);


--
-- Name: plantusage_classsystem_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_classsystem_x ON plantusage USING btree (classsystem);


--
-- Name: plantusage_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_party_id_x ON plantusage USING btree (party_id);


--
-- Name: plantusage_plantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_plantconcept_id_x ON plantusage USING btree (plantconcept_id);


--
-- Name: plantusage_plantname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_plantname_id_x ON plantusage USING btree (plantname_id);


--
-- Name: plantusage_plantname_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_plantname_x ON plantusage USING btree (plantname);


--
-- Name: plantusage_plantstatus_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plantusage_plantstatus_id_x ON plantusage USING btree (plantstatus_id);


--
-- Name: plot_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX plot_accessioncode_index ON plot USING btree (accessioncode);


--
-- Name: plot_parent_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plot_parent_id_x ON plot USING btree (parent_id);


--
-- Name: plot_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX plot_reference_id_x ON plot USING btree (reference_id);


--
-- Name: project_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX project_accessioncode_index ON project USING btree (accessioncode);


--
-- Name: projectcontributor_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX projectcontributor_party_id_x ON projectcontributor USING btree (party_id);


--
-- Name: projectcontributor_project_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX projectcontributor_project_id_x ON projectcontributor USING btree (project_id);


--
-- Name: projectcontributor_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX projectcontributor_role_id_x ON projectcontributor USING btree (role_id);


--
-- Name: reference_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX reference_accessioncode_index ON reference USING btree (accessioncode);


--
-- Name: reference_referencejournal_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX reference_referencejournal_id_x ON reference USING btree (referencejournal_id);


--
-- Name: referencealtident_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX referencealtident_reference_id_x ON referencealtident USING btree (reference_id);


--
-- Name: referencecontributor_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX referencecontributor_reference_id_x ON referencecontributor USING btree (reference_id);


--
-- Name: referencecontributor_referenceparty_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX referencecontributor_referenceparty_id_x ON referencecontributor USING btree (referenceparty_id);


--
-- Name: referencejournal_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX referencejournal_accessioncode_index ON referencejournal USING btree (accessioncode);


--
-- Name: referenceparty_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX referenceparty_accessioncode_index ON referenceparty USING btree (accessioncode);


--
-- Name: referenceparty_currentparty_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX referenceparty_currentparty_id_x ON referenceparty USING btree (currentparty_id);


--
-- Name: revision_previousrevision_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX revision_previousrevision_id_x ON revision USING btree (previousrevision_id);


--
-- Name: soilobs_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX soilobs_observation_id_x ON soilobs USING btree (plotevent_id);


--
-- Name: soiltaxon_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX soiltaxon_accessioncode_index ON soiltaxon USING btree (accessioncode);


--
-- Name: soiltaxon_soilparent_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX soiltaxon_soilparent_id_x ON soiltaxon USING btree (soilparent_id);


--
-- Name: stemcount_taxonimportance_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stemcount_taxonimportance_id_x ON stemcount USING btree (collectiveobs_id);


--
-- Name: stemlocation_stemcount_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stemlocation_stemcount_id_x ON individual USING btree (stemcount_id);


--
-- Name: stratum_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stratum_observation_id_x ON taxonbin USING btree (plotevent_id);


--
-- Name: stratum_stratummethod_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stratum_stratummethod_id_x ON taxonbin USING btree (stratummethod_id);


--
-- Name: stratum_stratumtype_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stratum_stratumtype_id_x ON taxonbin USING btree (stratumtype_id);


--
-- Name: stratummethod_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX stratummethod_accessioncode_index ON stratummethod USING btree (accessioncode);


--
-- Name: stratummethod_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stratummethod_reference_id_x ON stratummethod USING btree (reference_id);


--
-- Name: stratumtype_stratummethod_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX stratumtype_stratummethod_id_x ON stratumtype USING btree (stratummethod_id);


--
-- Name: taxonalt_plantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonalt_plantconcept_id_x ON taxonalt USING btree (plantconcept_id);


--
-- Name: taxonalt_taxoninterpretation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonalt_taxoninterpretation_id_x ON taxonalt USING btree (taxondetermination_id);


--
-- Name: taxonimportance_stratum_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonimportance_stratum_id_x ON collectiveobs USING btree (taxonbin_id);


--
-- Name: taxonimportance_taxonobservation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonimportance_taxonobservation_id_x ON collectiveobs USING btree (taxonoccurrence_id);


--
-- Name: taxoninterpretation_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX taxoninterpretation_accessioncode_index ON taxondetermination USING btree (accessioncode);


--
-- Name: taxoninterpretation_collector_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_collector_id_x ON taxondetermination USING btree (collector_id);


--
-- Name: taxoninterpretation_museum_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_museum_id_x ON taxondetermination USING btree (museum_id);


--
-- Name: taxoninterpretation_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_party_id_x ON taxondetermination USING btree (party_id);


--
-- Name: taxoninterpretation_plantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_plantconcept_id_x ON taxondetermination USING btree (plantconcept_id);


--
-- Name: taxoninterpretation_plantname_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_plantname_id_x ON taxondetermination USING btree (plantname_id);


--
-- Name: taxoninterpretation_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_reference_id_x ON taxondetermination USING btree (reference_id);


--
-- Name: taxoninterpretation_role_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_role_id_x ON taxondetermination USING btree (role_id);


--
-- Name: taxoninterpretation_stemlocation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_stemlocation_id_x ON taxondetermination USING btree (individual_id);


--
-- Name: taxoninterpretation_taxonobservation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxoninterpretation_taxonobservation_id_x ON taxondetermination USING btree (taxonoccurrence_id);


--
-- Name: taxonobservation_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX taxonobservation_accessioncode_index ON taxonoccurrence USING btree (accessioncode);


--
-- Name: taxonobservation_int_currplantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonobservation_int_currplantconcept_id_x ON taxonoccurrence USING btree (int_currplantconcept_id);


--
-- Name: taxonobservation_int_origplantconcept_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonobservation_int_origplantconcept_id_x ON taxonoccurrence USING btree (int_origplantconcept_id);


--
-- Name: taxonobservation_observation_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonobservation_observation_id_x ON taxonoccurrence USING btree (plotevent_id);


--
-- Name: taxonobservation_reference_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX taxonobservation_reference_id_x ON taxonoccurrence USING btree (reference_id);


--
-- Name: telephone_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX telephone_party_id_x ON telephone USING btree (party_id);


--
-- Name: usercertification_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX usercertification_usr_id_x ON usercertification USING btree (usr_id);


--
-- Name: userdataset_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX userdataset_accessioncode_index ON userdataset USING btree (accessioncode);


--
-- Name: userdataset_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userdataset_usr_id_x ON userdataset USING btree (usr_id);


--
-- Name: userdatasetitem2_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userdatasetitem2_accessioncode_index ON userdatasetitem USING btree (externalaccessioncode);


--
-- Name: userdatasetitem_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userdatasetitem_accessioncode_index ON userdatasetitem USING btree (itemaccessioncode);


--
-- Name: userdatasetitem_userdataset_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userdatasetitem_userdataset_id_x ON userdatasetitem USING btree (userdataset_id);


--
-- Name: userdefined_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX userdefined_accessioncode_index ON userdefined USING btree (accessioncode);


--
-- Name: usernotify_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX usernotify_usr_id_x ON usernotify USING btree (usr_id);


--
-- Name: userpermission_embargo_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userpermission_embargo_id_x ON userpermission USING btree (embargo_id);


--
-- Name: userpermission_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userpermission_usr_id_x ON userpermission USING btree (usr_id);


--
-- Name: userpreference_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userpreference_usr_id_x ON userpreference USING btree (usr_id);


--
-- Name: userquery_accessioncode_index; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE UNIQUE INDEX userquery_accessioncode_index ON userquery USING btree (accessioncode);


--
-- Name: userquery_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userquery_usr_id_x ON userquery USING btree (usr_id);


--
-- Name: userrecordowner_usr_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userrecordowner_usr_id_x ON userrecordowner USING btree (usr_id);


--
-- Name: userregionalexp_usercertification_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX userregionalexp_usercertification_id_x ON userregionalexp USING btree (usercertification_id);


--
-- Name: usr_party_id_x; Type: INDEX; Schema: public; Owner: bien; Tablespace: 
--

CREATE INDEX usr_party_id_x ON usr USING btree (party_id);


--
-- Name: r1address_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY address
    ADD CONSTRAINT r1address_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r1classcontributor_commclass_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY classcontributor
    ADD CONSTRAINT r1classcontributor_commclass_id FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id);


--
-- Name: r1commclass_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commclass
    ADD CONSTRAINT r1commclass_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1commconcept_commname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commconcept
    ADD CONSTRAINT r1commconcept_commname_id FOREIGN KEY (commname_id) REFERENCES commname(commname_id);


--
-- Name: r1commcorrelation_commstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commcorrelation
    ADD CONSTRAINT r1commcorrelation_commstatus_id FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id);


--
-- Name: r1comminterpretation_commclass_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY comminterpretation
    ADD CONSTRAINT r1comminterpretation_commclass_id FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id);


--
-- Name: r1commlineage_parentcommstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commlineage
    ADD CONSTRAINT r1commlineage_parentcommstatus_id FOREIGN KEY (parentcommstatus_id) REFERENCES commstatus(commstatus_id);


--
-- Name: r1commname_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commname
    ADD CONSTRAINT r1commname_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1commstatus_commconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commstatus
    ADD CONSTRAINT r1commstatus_commconcept_id FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id);


--
-- Name: r1commusage_commname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commusage
    ADD CONSTRAINT r1commusage_commname_id FOREIGN KEY (commname_id) REFERENCES commname(commname_id);


--
-- Name: r1coverindex_covermethod_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY coverindex
    ADD CONSTRAINT r1coverindex_covermethod_id FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id);


--
-- Name: r1covermethod_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY covermethod
    ADD CONSTRAINT r1covermethod_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1definedvalue_userdefined_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY definedvalue
    ADD CONSTRAINT r1definedvalue_userdefined_id FOREIGN KEY (userdefined_id) REFERENCES userdefined(userdefined_id);


--
-- Name: r1disturbanceobs_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY disturbanceobs
    ADD CONSTRAINT r1disturbanceobs_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1embargo_plot_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY embargo
    ADD CONSTRAINT r1embargo_plot_id FOREIGN KEY (plot_id) REFERENCES plot(plot_id);


--
-- Name: r1graphic_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY graphic
    ADD CONSTRAINT r1graphic_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1namedplace_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY namedplace
    ADD CONSTRAINT r1namedplace_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1namedplacecorrelation_parentplace_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY namedplacecorrelation
    ADD CONSTRAINT r1namedplacecorrelation_parentplace_id FOREIGN KEY (parentplace_id) REFERENCES namedplace(namedplace_id);


--
-- Name: r1note_notelink_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY note
    ADD CONSTRAINT r1note_notelink_id FOREIGN KEY (notelink_id) REFERENCES notelink(notelink_id);


--
-- Name: r1observation_previousobs_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r1observation_previousobs_id FOREIGN KEY (previousobs_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1observationcontributor_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationcontributor
    ADD CONSTRAINT r1observationcontributor_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1observationsynonym_synonymobservation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationsynonym
    ADD CONSTRAINT r1observationsynonym_synonymobservation_id FOREIGN KEY (synonymobservation_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1party_currentname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY party
    ADD CONSTRAINT r1party_currentname_id FOREIGN KEY (currentname_id) REFERENCES party(party_id);


--
-- Name: r1partymember_parentparty_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY partymember
    ADD CONSTRAINT r1partymember_parentparty_id FOREIGN KEY (parentparty_id) REFERENCES party(party_id);


--
-- Name: r1place_plot_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY place
    ADD CONSTRAINT r1place_plot_id FOREIGN KEY (plot_id) REFERENCES plot(plot_id);


--
-- Name: r1plantconcept_plantname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantconcept
    ADD CONSTRAINT r1plantconcept_plantname_id FOREIGN KEY (plantname_id) REFERENCES plantname(plantname_id);


--
-- Name: r1plantcorrelation_plantstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantcorrelation
    ADD CONSTRAINT r1plantcorrelation_plantstatus_id FOREIGN KEY (plantstatus_id) REFERENCES plantstatus(plantstatus_id);


--
-- Name: r1plantlineage_childplantstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantlineage
    ADD CONSTRAINT r1plantlineage_childplantstatus_id FOREIGN KEY (childplantstatus_id) REFERENCES plantstatus(plantstatus_id);


--
-- Name: r1plantname_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantname
    ADD CONSTRAINT r1plantname_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1plantstatus_plantconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantstatus
    ADD CONSTRAINT r1plantstatus_plantconcept_id FOREIGN KEY (plantconcept_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r1plantusage_plantname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantusage
    ADD CONSTRAINT r1plantusage_plantname_id FOREIGN KEY (plantname_id) REFERENCES plantname(plantname_id);


--
-- Name: r1plot_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plot
    ADD CONSTRAINT r1plot_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1projectcontributor_project_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY projectcontributor
    ADD CONSTRAINT r1projectcontributor_project_id FOREIGN KEY (project_id) REFERENCES project(project_id);


--
-- Name: r1reference_referencejournal_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY reference
    ADD CONSTRAINT r1reference_referencejournal_id FOREIGN KEY (referencejournal_id) REFERENCES referencejournal(referencejournal_id);


--
-- Name: r1referencealtident_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY referencealtident
    ADD CONSTRAINT r1referencealtident_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1referencecontributor_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY referencecontributor
    ADD CONSTRAINT r1referencecontributor_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1referenceparty_currentparty_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY referenceparty
    ADD CONSTRAINT r1referenceparty_currentparty_id FOREIGN KEY (currentparty_id) REFERENCES referenceparty(referenceparty_id);


--
-- Name: r1revision_previousrevision_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY revision
    ADD CONSTRAINT r1revision_previousrevision_id FOREIGN KEY (previousrevision_id) REFERENCES revision(revision_id);


--
-- Name: r1soilobs_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY soilobs
    ADD CONSTRAINT r1soilobs_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1soiltaxon_soilparent_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY soiltaxon
    ADD CONSTRAINT r1soiltaxon_soilparent_id FOREIGN KEY (soilparent_id) REFERENCES soiltaxon(soiltaxon_id);


--
-- Name: r1stemcount_taxonimportance_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY stemcount
    ADD CONSTRAINT r1stemcount_taxonimportance_id FOREIGN KEY (collectiveobs_id) REFERENCES collectiveobs(collectiveobs_id);


--
-- Name: r1stemlocation_stemcount_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY individual
    ADD CONSTRAINT r1stemlocation_stemcount_id FOREIGN KEY (stemcount_id) REFERENCES stemcount(stemcount_id);


--
-- Name: r1stratum_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonbin
    ADD CONSTRAINT r1stratum_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1stratummethod_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY stratummethod
    ADD CONSTRAINT r1stratummethod_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r1stratumtype_stratummethod_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY stratumtype
    ADD CONSTRAINT r1stratumtype_stratummethod_id FOREIGN KEY (stratummethod_id) REFERENCES stratummethod(stratummethod_id);


--
-- Name: r1taxonalt_taxoninterpretation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonalt
    ADD CONSTRAINT r1taxonalt_taxoninterpretation_id FOREIGN KEY (taxondetermination_id) REFERENCES taxondetermination(taxondetermination_id);


--
-- Name: r1taxonimportance_taxonobservation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY collectiveobs
    ADD CONSTRAINT r1taxonimportance_taxonobservation_id FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id);


--
-- Name: r1taxoninterpretation_taxonobservation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r1taxoninterpretation_taxonobservation_id FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id);


--
-- Name: r1taxonobservation_observation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonoccurrence
    ADD CONSTRAINT r1taxonobservation_observation_id FOREIGN KEY (plotevent_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r1telephone_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY telephone
    ADD CONSTRAINT r1telephone_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r1usercertification_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY usercertification
    ADD CONSTRAINT r1usercertification_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userdataset_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userdataset
    ADD CONSTRAINT r1userdataset_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userdatasetitem_userdataset_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userdatasetitem
    ADD CONSTRAINT r1userdatasetitem_userdataset_id FOREIGN KEY (userdataset_id) REFERENCES userdataset(userdataset_id);


--
-- Name: r1usernotify_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY usernotify
    ADD CONSTRAINT r1usernotify_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userpermission_embargo_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userpermission
    ADD CONSTRAINT r1userpermission_embargo_id FOREIGN KEY (embargo_id) REFERENCES embargo(embargo_id);


--
-- Name: r1userpreference_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userpreference
    ADD CONSTRAINT r1userpreference_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userquery_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userquery
    ADD CONSTRAINT r1userquery_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userrecordowner_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userrecordowner
    ADD CONSTRAINT r1userrecordowner_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r1userregionalexp_usercertification_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userregionalexp
    ADD CONSTRAINT r1userregionalexp_usercertification_id FOREIGN KEY (usercertification_id) REFERENCES usercertification(usercertification_id);


--
-- Name: r1usr_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY usr
    ADD CONSTRAINT r1usr_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r2address_organization_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY address
    ADD CONSTRAINT r2address_organization_id FOREIGN KEY (organization_id) REFERENCES party(party_id);


--
-- Name: r2classcontributor_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY classcontributor
    ADD CONSTRAINT r2classcontributor_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r2commclass_classpublication_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commclass
    ADD CONSTRAINT r2commclass_classpublication_id FOREIGN KEY (classpublication_id) REFERENCES reference(reference_id);


--
-- Name: r2commconcept_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commconcept
    ADD CONSTRAINT r2commconcept_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r2commcorrelation_commconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commcorrelation
    ADD CONSTRAINT r2commcorrelation_commconcept_id FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id);


--
-- Name: r2comminterpretation_commconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY comminterpretation
    ADD CONSTRAINT r2comminterpretation_commconcept_id FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id);


--
-- Name: r2commlineage_childcommstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commlineage
    ADD CONSTRAINT r2commlineage_childcommstatus_id FOREIGN KEY (childcommstatus_id) REFERENCES commstatus(commstatus_id);


--
-- Name: r2commstatus_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commstatus
    ADD CONSTRAINT r2commstatus_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r2commusage_commconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commusage
    ADD CONSTRAINT r2commusage_commconcept_id FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id);


--
-- Name: r2namedplacecorrelation_childplace_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY namedplacecorrelation
    ADD CONSTRAINT r2namedplacecorrelation_childplace_id FOREIGN KEY (childplace_id) REFERENCES namedplace(namedplace_id);


--
-- Name: r2note_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY note
    ADD CONSTRAINT r2note_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r2observation_plot_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r2observation_plot_id FOREIGN KEY (plot_id) REFERENCES plot(plot_id);


--
-- Name: r2observationcontributor_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationcontributor
    ADD CONSTRAINT r2observationcontributor_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r2observationsynonym_primaryobservation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationsynonym
    ADD CONSTRAINT r2observationsynonym_primaryobservation_id FOREIGN KEY (primaryobservation_id) REFERENCES plotevent(plotevent_id);


--
-- Name: r2partymember_childparty_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY partymember
    ADD CONSTRAINT r2partymember_childparty_id FOREIGN KEY (childparty_id) REFERENCES party(party_id);


--
-- Name: r2place_namedplace_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY place
    ADD CONSTRAINT r2place_namedplace_id FOREIGN KEY (namedplace_id) REFERENCES namedplace(namedplace_id);


--
-- Name: r2plantconcept_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantconcept
    ADD CONSTRAINT r2plantconcept_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r2plantcorrelation_plantconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantcorrelation
    ADD CONSTRAINT r2plantcorrelation_plantconcept_id FOREIGN KEY (plantconcept_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r2plantlineage_parentplantstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantlineage
    ADD CONSTRAINT r2plantlineage_parentplantstatus_id FOREIGN KEY (parentplantstatus_id) REFERENCES plantstatus(plantstatus_id);


--
-- Name: r2plantstatus_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantstatus
    ADD CONSTRAINT r2plantstatus_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r2plantusage_plantconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantusage
    ADD CONSTRAINT r2plantusage_plantconcept_id FOREIGN KEY (plantconcept_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r2plot_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plot
    ADD CONSTRAINT r2plot_parent_id FOREIGN KEY (parent_id) REFERENCES plot(plot_id);


--
-- Name: r2projectcontributor_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY projectcontributor
    ADD CONSTRAINT r2projectcontributor_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r2referencecontributor_referenceparty_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY referencecontributor
    ADD CONSTRAINT r2referencecontributor_referenceparty_id FOREIGN KEY (referenceparty_id) REFERENCES referenceparty(referenceparty_id);


--
-- Name: r2stratum_stratumtype_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonbin
    ADD CONSTRAINT r2stratum_stratumtype_id FOREIGN KEY (stratumtype_id) REFERENCES stratumtype(stratumtype_id);


--
-- Name: r2taxonalt_plantconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonalt
    ADD CONSTRAINT r2taxonalt_plantconcept_id FOREIGN KEY (plantconcept_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r2taxonimportance_stratum_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY collectiveobs
    ADD CONSTRAINT r2taxonimportance_stratum_id FOREIGN KEY (taxonbin_id) REFERENCES taxonbin(taxonbin_id);


--
-- Name: r2taxoninterpretation_stemlocation_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r2taxoninterpretation_stemlocation_id FOREIGN KEY (individual_id) REFERENCES individual(individual_id);


--
-- Name: r2taxonobservation_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonoccurrence
    ADD CONSTRAINT r2taxonobservation_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r2userpermission_usr_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY userpermission
    ADD CONSTRAINT r2userpermission_usr_id FOREIGN KEY (usr_id) REFERENCES usr(usr_id);


--
-- Name: r3classcontributor_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY classcontributor
    ADD CONSTRAINT r3classcontributor_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r3comminterpretation_commauthority_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY comminterpretation
    ADD CONSTRAINT r3comminterpretation_commauthority_id FOREIGN KEY (commauthority_id) REFERENCES reference(reference_id);


--
-- Name: r3commstatus_commparent_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commstatus
    ADD CONSTRAINT r3commstatus_commparent_id FOREIGN KEY (commparent_id) REFERENCES commconcept(commconcept_id);


--
-- Name: r3commusage_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commusage
    ADD CONSTRAINT r3commusage_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r3note_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY note
    ADD CONSTRAINT r3note_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r3observation_project_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r3observation_project_id FOREIGN KEY (project_id) REFERENCES project(project_id);


--
-- Name: r3observationcontributor_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationcontributor
    ADD CONSTRAINT r3observationcontributor_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r3observationsynonym_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationsynonym
    ADD CONSTRAINT r3observationsynonym_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r3partymember_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY partymember
    ADD CONSTRAINT r3partymember_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r3plantstatus_plantparent_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantstatus
    ADD CONSTRAINT r3plantstatus_plantparent_id FOREIGN KEY (plantparent_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r3plantusage_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantusage
    ADD CONSTRAINT r3plantusage_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r3projectcontributor_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY projectcontributor
    ADD CONSTRAINT r3projectcontributor_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r3stratum_stratummethod_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxonbin
    ADD CONSTRAINT r3stratum_stratummethod_id FOREIGN KEY (stratummethod_id) REFERENCES stratummethod(stratummethod_id);


--
-- Name: r3taxoninterpretation_plantconcept_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r3taxoninterpretation_plantconcept_id FOREIGN KEY (plantconcept_id) REFERENCES plantconcept(plantconcept_id);


--
-- Name: r4commstatus_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commstatus
    ADD CONSTRAINT r4commstatus_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r4commusage_commstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY commusage
    ADD CONSTRAINT r4commusage_commstatus_id FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id);


--
-- Name: r4observation_covermethod_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r4observation_covermethod_id FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id);


--
-- Name: r4observationsynonym_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY observationsynonym
    ADD CONSTRAINT r4observationsynonym_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r4plantstatus_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantstatus
    ADD CONSTRAINT r4plantstatus_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r4plantusage_plantstatus_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plantusage
    ADD CONSTRAINT r4plantusage_plantstatus_id FOREIGN KEY (plantstatus_id) REFERENCES plantstatus(plantstatus_id);


--
-- Name: r4taxoninterpretation_plantname_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r4taxoninterpretation_plantname_id FOREIGN KEY (plantname_id) REFERENCES plantname(plantname_id);


--
-- Name: r5observation_stratummethod_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r5observation_stratummethod_id FOREIGN KEY (stratummethod_id) REFERENCES stratummethod(stratummethod_id);


--
-- Name: r5taxoninterpretation_party_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r5taxoninterpretation_party_id FOREIGN KEY (party_id) REFERENCES party(party_id);


--
-- Name: r6observation_soiltaxon_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY plotevent
    ADD CONSTRAINT r6observation_soiltaxon_id FOREIGN KEY (soiltaxon_id) REFERENCES soiltaxon(soiltaxon_id);


--
-- Name: r6taxoninterpretation_role_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r6taxoninterpretation_role_id FOREIGN KEY (role_id) REFERENCES aux_role(role_id);


--
-- Name: r7taxoninterpretation_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r7taxoninterpretation_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id);


--
-- Name: r8taxoninterpretation_collector_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r8taxoninterpretation_collector_id FOREIGN KEY (collector_id) REFERENCES party(party_id);


--
-- Name: r9taxoninterpretation_museum_id; Type: FK CONSTRAINT; Schema: public; Owner: bien
--

ALTER TABLE ONLY taxondetermination
    ADD CONSTRAINT r9taxoninterpretation_museum_id FOREIGN KEY (museum_id) REFERENCES party(party_id);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- PostgreSQL database dump complete
--

