Project

General

Profile

« Previous | Next » 

Revision 525

VegBIEN: Renamed plot to location to reflect that a location can also be used for specimens

View differences:

test/accepted_output/SALVIAS.plots.VegBIEN.xml
1 1
<?xml version="1.0" ?>
2 2
<VegBIEN>
3
    <plotevent id="0">
4
        <plot_id>
5
            <plot>
3
    <locationevent id="0">
4
        <location_id>
5
            <location>
6 6
                <area>0.44</area>
7 7
                <elevation>200</elevation>
8 8
                <place>
......
34 34
                <reallongitude>-73.4333</reallongitude>
35 35
                <confidentialitystatus>0</confidentialitystatus>
36 36
                <sourceid>ALP-11</sourceid>
37
            </plot>
38
        </plot_id>
37
            </location>
38
        </location_id>
39 39
        <project_id>
40 40
            <project>
41 41
                <projectname>RAINFOR - 1 ha Peru</projectname>
......
44 44
        <methodnarrative>1 ha, stems &gt;= 10 cm dbh</methodnarrative>
45 45
        <obsstartdate>1990-11-16</obsstartdate>
46 46
        <sourceid>ALP-11</sourceid>
47
    </plotevent>
48
    <plotevent id="1">
49
        <plot_id>
50
            <plot>
47
    </locationevent>
48
    <locationevent id="1">
49
        <location_id>
50
            <location>
51 51
                <area>0.4</area>
52 52
                <elevation>200</elevation>
53 53
                <place>
......
79 79
                <reallongitude>-73.4333</reallongitude>
80 80
                <confidentialitystatus>0</confidentialitystatus>
81 81
                <sourceid>ALP-12</sourceid>
82
            </plot>
83
        </plot_id>
82
            </location>
83
        </location_id>
84 84
        <project_id>
85 85
            <project>
86 86
                <projectname>RAINFOR - 1 ha Peru</projectname>
......
89 89
        <methodnarrative>1 ha, stems &gt;= 10 cm dbh</methodnarrative>
90 90
        <obsstartdate>1990-11-16</obsstartdate>
91 91
        <sourceid>ALP-12</sourceid>
92
    </plotevent>
92
    </locationevent>
93 93
</VegBIEN>
test/accepted_output/SALVIAS.organisms.VegBIEN.xml
1 1
<?xml version="1.0" ?>
2 2
<VegBIEN>
3 3
    <taxonoccurrence id="0">
4
        <plotevent_id>
5
            <plotevent>
6
                <plot_id>
7
                    <plot>
4
        <locationevent_id>
5
            <locationevent>
6
                <location_id>
7
                    <location>
8 8
                        <parent_id>
9
                            <plot>
9
                            <location>
10 10
                                <confidentialitystatus>0</confidentialitystatus>
11 11
                                <sourceid>ALP-11</sourceid>
12
                            </plot>
12
                            </location>
13 13
                        </parent_id>
14 14
                        <confidentialitystatus>0</confidentialitystatus>
15 15
                        <sourceid>1</sourceid>
16
                    </plot>
17
                </plot_id>
16
                    </location>
17
                </location_id>
18 18
                <obsstartdate>2001-01-01</obsstartdate>
19 19
                <sourceid>1</sourceid>
20
            </plotevent>
21
        </plotevent_id>
20
            </locationevent>
21
        </locationevent_id>
22 22
        <aggregateoccurrence>
23 23
            <count>1</count>
24 24
            <individualplant>
......
288 288
        </taxondetermination>
289 289
    </taxonoccurrence>
290 290
    <taxonoccurrence id="1">
291
        <plotevent_id>
292
            <plotevent>
293
                <plot_id>
294
                    <plot>
291
        <locationevent_id>
292
            <locationevent>
293
                <location_id>
294
                    <location>
295 295
                        <parent_id>
296
                            <plot>
296
                            <location>
297 297
                                <confidentialitystatus>0</confidentialitystatus>
298 298
                                <sourceid>ALP-11</sourceid>
299
                            </plot>
299
                            </location>
300 300
                        </parent_id>
301 301
                        <confidentialitystatus>0</confidentialitystatus>
302 302
                        <sourceid>4</sourceid>
303
                    </plot>
304
                </plot_id>
303
                    </location>
304
                </location_id>
305 305
                <obsstartdate>2001-01-01</obsstartdate>
306 306
                <sourceid>4</sourceid>
307
            </plotevent>
308
        </plotevent_id>
307
            </locationevent>
308
        </locationevent_id>
309 309
        <aggregateoccurrence>
310 310
            <count>1</count>
311 311
            <individualplant>
test/accepted_output/SALVIAS_db.plots.VegBIEN.xml
1 1
<?xml version="1.0" ?>
2 2
<VegBIEN>
3
    <plotevent id="0">
4
        <plot_id>
5
            <plot>
3
    <locationevent id="0">
4
        <location_id>
5
            <location>
6 6
                <area>0.06</area>
7 7
                <elevation>2100.0</elevation>
8 8
                <place>
......
25 25
                <reallongitude>-78.3667</reallongitude>
26 26
                <confidentialitystatus>0</confidentialitystatus>
27 27
                <sourceid>ACHUPALL</sourceid>
28
            </plot>
29
        </plot_id>
28
            </location>
29
        </location_id>
30 30
        <project_id>
31 31
            <project>
32 32
                <projectname>1</projectname>
......
49 49
        <definedvalue fkey="tableRecord_ID">
50 50
            <userdefined_id>
51 51
                <userdefined>
52
                    <tablename>plotevent</tablename>
52
                    <tablename>locationevent</tablename>
53 53
                    <userdefinedname>precipitationMm</userdefinedname>
54 54
                    <userdefinedtype>varchar</userdefinedtype>
55 55
                </userdefined>
......
58 58
        </definedvalue>
59 59
        <methodnarrative>0.1 ha  transect, stems &gt;= 2.5 cm dbh</methodnarrative>
60 60
        <sourceid>1</sourceid>
61
    </plotevent>
62
    <plotevent id="1">
63
        <plot_id>
64
            <plot>
61
    </locationevent>
62
    <locationevent id="1">
63
        <location_id>
64
            <location>
65 65
                <area>0.1</area>
66 66
                <elevation>530.0</elevation>
67 67
                <place>
......
84 84
                <reallongitude>11.5</reallongitude>
85 85
                <confidentialitystatus>0</confidentialitystatus>
86 86
                <sourceid>ALLACHER</sourceid>
87
            </plot>
88
        </plot_id>
87
            </location>
88
        </location_id>
89 89
        <project_id>
90 90
            <project>
91 91
                <projectname>1</projectname>
......
108 108
        <definedvalue fkey="tableRecord_ID">
109 109
            <userdefined_id>
110 110
                <userdefined>
111
                    <tablename>plotevent</tablename>
111
                    <tablename>locationevent</tablename>
112 112
                    <userdefinedname>precipitationMm</userdefinedname>
113 113
                    <userdefinedtype>varchar</userdefinedtype>
114 114
                </userdefined>
......
118 118
        <definedvalue fkey="tableRecord_ID">
119 119
            <userdefined_id>
120 120
                <userdefined>
121
                    <tablename>plotevent</tablename>
121
                    <tablename>locationevent</tablename>
122 122
                    <userdefinedname>temperatureC</userdefinedname>
123 123
                    <userdefinedtype>varchar</userdefinedtype>
124 124
                </userdefined>
......
127 127
        </definedvalue>
128 128
        <methodnarrative>0.1 ha  transect, stems &gt;= 2.5 cm dbh</methodnarrative>
129 129
        <sourceid>2</sourceid>
130
    </plotevent>
130
    </locationevent>
131 131
</VegBIEN>
test/accepted_output/SALVIAS_db.organisms.VegBIEN.xml
1 1
<?xml version="1.0" ?>
2 2
<VegBIEN>
3 3
    <taxonoccurrence id="0">
4
        <plotevent_id>
5
            <plotevent>
4
        <locationevent_id>
5
            <locationevent>
6 6
                <sourceid>295</sourceid>
7
                <plot_id>
8
                    <plot>
7
                <location_id>
8
                    <location>
9 9
                        <confidentialitystatus>0</confidentialitystatus>
10 10
                        <sourceid>1</sourceid>
11
                    </plot>
12
                </plot_id>
13
            </plotevent>
14
        </plotevent_id>
11
                    </location>
12
                </location_id>
13
            </locationevent>
14
        </locationevent_id>
15 15
        <aggregateoccurrence>
16 16
            <count>1</count>
17 17
            <individualplant>
......
286 286
        </taxondetermination>
287 287
    </taxonoccurrence>
288 288
    <taxonoccurrence id="1">
289
        <plotevent_id>
290
            <plotevent>
289
        <locationevent_id>
290
            <locationevent>
291 291
                <sourceid>295</sourceid>
292
                <plot_id>
293
                    <plot>
292
                <location_id>
293
                    <location>
294 294
                        <confidentialitystatus>0</confidentialitystatus>
295 295
                        <sourceid>2</sourceid>
296
                    </plot>
297
                </plot_id>
298
            </plotevent>
299
        </plotevent_id>
296
                    </location>
297
                </location_id>
298
            </locationevent>
299
        </locationevent_id>
300 300
        <aggregateoccurrence>
301 301
            <count>1</count>
302 302
            <individualplant>
test/accepted_output/NYBG.organisms.VegBIEN.xml
1 1
<?xml version="1.0" ?>
2 2
<VegBIEN>
3 3
    <taxonoccurrence id="0">
4
        <plotevent_id>
5
            <plotevent>
6
                <plot_id>
7
                    <plot>
4
        <locationevent_id>
5
            <locationevent>
6
                <location_id>
7
                    <location>
8 8
                        <place>
9 9
                            <namedplace_id>
10 10
                                <namedplace>
......
36 36
                        <elevationrange>0.0</elevationrange>
37 37
                        <confidentialitystatus>0</confidentialitystatus>
38 38
                        <sourceid>816590</sourceid>
39
                    </plot>
40
                </plot_id>
39
                    </location>
40
                </location_id>
41 41
                <obsstartdate>1984-08-20</obsstartdate>
42 42
                <sourceid>816590</sourceid>
43
            </plotevent>
44
        </plotevent_id>
43
            </locationevent>
44
        </locationevent_id>
45 45
        <aggregateoccurrence>
46 46
            <individualplant>
47 47
                <specimen>
......
334 334
        </taxondetermination>
335 335
    </taxonoccurrence>
336 336
    <taxonoccurrence id="1">
337
        <plotevent_id>
338
            <plotevent>
339
                <plot_id>
340
                    <plot>
337
        <locationevent_id>
338
            <locationevent>
339
                <location_id>
340
                    <location>
341 341
                        <place>
342 342
                            <namedplace_id>
343 343
                                <namedplace>
......
361 361
                        <elevationrange>0.0</elevationrange>
362 362
                        <confidentialitystatus>0</confidentialitystatus>
363 363
                        <sourceid>220541</sourceid>
364
                    </plot>
365
                </plot_id>
364
                    </location>
365
                </location_id>
366 366
                <obsstartdate>1994-01-17</obsstartdate>
367 367
                <sourceid>220541</sourceid>
368
            </plotevent>
369
        </plotevent_id>
368
            </locationevent>
369
        </locationevent_id>
370 370
        <aggregateoccurrence>
371 371
            <individualplant>
372 372
                <specimen>
inputs/SALVIAS/maps/VegBIEN.plots.csv
1 1
SALVIAS:plotMetadata,VegBIEN:/plotevent,Comments
2
plot_area_ha,/*_id/plot/area,"Brad: Area in hectares. Is there any way to store units?; Aaron: VegX plot area annotation says ""Total area of the plot in square meters."" so units are fixed"
3
Elev,/*_id/plot/elevation/_alt/1,Brad: Mean elevation in meters. This is a constrained decimal value; is there no place for this in VegX other than verbatimElevation? Check with Nick.
4
Country,"/*_id/plot/place(/*_id/namedplace[placesystem=""area|country|territory""])/placename",
5
PolDiv1,"/*_id/plot/place(/*_id/namedplace[placesystem=""region|state|province""])/placename",Brad: No; pol1=stateProvince
6
MajorGeo,/*_id/plot/place(/*_id/namedplace[placesystem=continent])/placename,
7
pol2,/*_id/plot/place(/*_id/namedplace[placesystem=county])/placename,Brad: No pol2=countyParish
8
Locality_Description,/*_id/plot/place/*_id/namedplace/placedescription,"Brad: No; this is free text description of locality where plot was situated, same as for DwC. Not a description of vegetation. Most likely='namedPlace.placeDescription' in VB; not sure about VX, again need to ask Nick where locality descriptions live in VX"
9
LatDec,/*_id/plot/reallatitude,
10
LongDec,/*_id/plot/reallongitude,
11
slope_aspect,/*_id/plot/slopeaspect,
12
slope_gradient,/*_id/plot/slopegradient,
13
elev_max_m,"/*_id/plot/{elevation/_alt/2/_avg/max,elevationrange/_range/to}",
14
elev_min_m,"/*_id/plot/{elevation/_alt/2/_avg/min,elevationrange/_range/from}",
15
project_id,/*_id/project/projectname,
16
life_zone_code,/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
17
life_zone,/commclass/commdetermination/*_id/commconcept/commdescription,
18
Precip,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=precipitationMm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
19
Temp,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=temperatureC]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
20
PlotMethod,/methodnarrative,
21
date_finish,/obsenddate/_date/date,
22
date_start,/obsstartdate/_date/date,
23
soil_acidity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilAcidity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
24
soil_base,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilBase]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
25
soil_Ca,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCalcium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
26
soil_C,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCarbon]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
27
soil_cation_cap,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCationCap]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
28
soil_conductivity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilConductivity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
29
soil_Mg,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilMagnesium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
30
soil_N,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilNitrogen]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
31
soil_P,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPhosphorus]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
32
soil_K,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPotassium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
33
soil_Na,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilSodium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
34
clay_percent,/soilobs:[soilhorizon=unknown]/soilclay,
35
organic_percent,/soilobs:[soilhorizon=unknown]/soilorganic,
36
pH,/soilobs:[soilhorizon=unknown]/soilph,"Brad: For all these soil variables, how do we store information on method, units. Seems like an ontological structure would be more appropriate (measurementName, measurementValue, measurementUnits, measurementMethod). Same as BIEN traits table. Something to discuss."
37
sand_percent,/soilobs:[soilhorizon=unknown]/soilsand,
38
silt_percent,/soilobs:[soilhorizon=unknown]/soilsilt,
39
soil_texture,/soilobs:[soilhorizon=unknown]/soiltexture,
40
PlotID,/sourceid/_alt/1,"Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
41
SiteCode,"/{*_id/plot:[confidentialitystatus=0]/sourceid/_alt/2,sourceid/_alt/2}",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
inputs/SALVIAS/maps/VegBIEN.organisms.csv
1 1
SALVIAS:plotObservations,VegBIEN:/taxonoccurrence,Comments
2
PlotID,/*_id/plotevent/sourceid/_alt/1,"Brad: Not sure why this is repeated? This field and plotCode, as the same as above."
2
PlotID,/*_id/locationevent/sourceid/_alt/1,"Brad: Not sure why this is repeated? This field and plotCode, as the same as above."
3 3
NoInd,/aggregateoccurrence/count/_alt/1,"Brad: Incorrect for VegX. This is a count of number of indiiduals for an *aggregate* observation. For VegBank, I'm not sure. Not exactly the same as stemCount. An individual tree could have 3 stems but would still only count as 1. We need to check with Bob on this."
4 4
cover_percent,/aggregateoccurrence/cover,
5 5
intercept_cm,"/aggregateoccurrence/definedvalue[*_id/userdefined[tablename=aggregateoccurrence,userdefinedname=interceptCm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Incorrect for VegBank This is an aggregate observation. Used in line-intercept methodology only, describes the point along centerline at which an individual intercepts the center line of the plot. Used to determin relative abundance."
......
28 28
infra_ep_1,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Subspecies]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname/_name/last,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname/_name/last}",
29 29
OrigFamily,"/taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Family]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",Brad: OMIT
30 30
OrigSpecies,"/{taxondetermination[role_id/aux_role/rolecode=collector]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/*_id/*/plantname/_alt/2,taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Species]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}}",Brad: OMIT
31
PlotObsID,":[aggregateoccurrence/count/_alt/2=1]/{aggregateoccurrence/individualplant/sourceid,aggregateoccurrence/individualplant/specimen:[*_id/reference]/sourceaccessionnumber,*_id/plotevent/sourceid/_alt/2,*_id/plotevent/*_id/plot:[confidentialitystatus=0]/sourceid/_alt/3}","Brad: Neither is correct; this is just an internal ID for table plotObservations. However, it has the important property of uniquely identifying an ""observation"", which is an individual tree, in the case of an individual observation, or a records of a species with an associated count of individuals or measurement of percent cover, in the case of aggregate observations. Not sure where to store this. Main point is that it is not part of the original data, but an auto_increment added later."
31
PlotObsID,":[aggregateoccurrence/count/_alt/2=1]/{aggregateoccurrence/individualplant/sourceid,aggregateoccurrence/individualplant/specimen:[*_id/reference]/sourceaccessionnumber,*_id/locationevent/sourceid/_alt/2,*_id/locationevent/*_id/location:[confidentialitystatus=0]/sourceid/_alt/3}","Brad: Neither is correct; this is just an internal ID for table plotObservations. However, it has the important property of uniquely identifying an ""observation"", which is an individual tree, in the case of an individual observation, or a records of a species with an associated count of individuals or measurement of percent cover, in the case of aggregate observations. Not sure where to store this. Main point is that it is not part of the original data, but an auto_increment added later."
schemas/vegbien_empty.sql
31 31
TRUNCATE individualplant CASCADE;
32 32
TRUNCATE keywords CASCADE;
33 33
TRUNCATE keywords_extra CASCADE;
34
TRUNCATE location CASCADE;
35
TRUNCATE locationevent CASCADE;
36
TRUNCATE locationeventcontributor CASCADE;
37
TRUNCATE locationeventsynonym CASCADE;
34 38
TRUNCATE namedplace CASCADE;
35 39
TRUNCATE namedplacecorrelation CASCADE;
36 40
TRUNCATE note CASCADE;
......
44 48
TRUNCATE plantname CASCADE;
45 49
TRUNCATE plantstatus CASCADE;
46 50
TRUNCATE plantusage CASCADE;
47
TRUNCATE plot CASCADE;
48
TRUNCATE plotevent CASCADE;
49
TRUNCATE ploteventcontributor CASCADE;
50
TRUNCATE ploteventsynonym CASCADE;
51 51
TRUNCATE project CASCADE;
52 52
TRUNCATE projectcontributor CASCADE;
53 53
TRUNCATE reference CASCADE;
schemas/vegbien.sql
185 185

  
186 186
CREATE TABLE commclass (
187 187
    commclass_id integer NOT NULL,
188
    plotevent_id integer NOT NULL,
188
    locationevent_id integer NOT NULL,
189 189
    inspection boolean,
190 190
    tableanalysis boolean,
191 191
    multivariateanalysis boolean,
......
950 950

  
951 951
CREATE TABLE disturbanceobs (
952 952
    disturbanceobs_id integer NOT NULL,
953
    plotevent_id integer NOT NULL,
953
    locationevent_id integer NOT NULL,
954 954
    disturbancetype character varying(30) NOT NULL,
955 955
    disturbanceintensity character varying(30),
956 956
    disturbanceage double precision,
......
985 985

  
986 986
CREATE TABLE embargo (
987 987
    embargo_id integer NOT NULL,
988
    plot_id integer NOT NULL,
988
    location_id integer NOT NULL,
989 989
    embargoreason text NOT NULL,
990 990
    defaultstatus integer NOT NULL,
991 991
    embargostart timestamp with time zone NOT NULL,
......
1018 1018

  
1019 1019
CREATE TABLE graphic (
1020 1020
    graphic_id integer NOT NULL,
1021
    plotevent_id integer NOT NULL,
1021
    locationevent_id integer NOT NULL,
1022 1022
    graphicname character varying(30),
1023 1023
    graphiclocation text,
1024 1024
    graphicdescription text,
......
1115 1115

  
1116 1116

  
1117 1117
--
1118
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1119
--
1120

  
1121
CREATE TABLE location (
1122
    location_id integer NOT NULL,
1123
    sourceid character varying(30),
1124
    reference_id integer,
1125
    parent_id integer,
1126
    reallatitude double precision,
1127
    reallongitude double precision,
1128
    locationaccuracy double precision,
1129
    confidentialitystatus integer NOT NULL,
1130
    confidentialityreason character varying(200),
1131
    latitude double precision,
1132
    longitude double precision,
1133
    authore character varying(20),
1134
    authorn character varying(20),
1135
    authorzone character varying(20),
1136
    authordatum character varying(20),
1137
    authorlocation character varying(200),
1138
    locationnarrative text,
1139
    azimuth double precision,
1140
    dsgpoly text,
1141
    shape character varying(50),
1142
    area double precision,
1143
    standsize character varying(50),
1144
    placementmethod character varying(50),
1145
    permanence boolean,
1146
    layoutnarrative text,
1147
    elevation double precision,
1148
    elevationaccuracy double precision,
1149
    elevationrange double precision,
1150
    slopeaspect double precision,
1151
    minslopeaspect double precision,
1152
    maxslopeaspect double precision,
1153
    slopegradient double precision,
1154
    minslopegradient double precision,
1155
    maxslopegradient double precision,
1156
    topoposition character varying(90),
1157
    landform character varying(50),
1158
    surficialdeposits character varying(90),
1159
    rocktype character varying(90),
1160
    stateprovince character varying(55),
1161
    country character varying(100),
1162
    submitter_surname character varying(100),
1163
    submitter_givenname character varying(100),
1164
    submitter_email character varying(100),
1165
    notespublic boolean,
1166
    notesmgt boolean,
1167
    revisions boolean,
1168
    dateentered timestamp with time zone DEFAULT now(),
1169
    emb_location integer,
1170
    locationrationalenarrative text,
1171
    accessioncode character varying(255),
1172
    sublocationxposition double precision,
1173
    sublocationyposition double precision,
1174
    namedplace_id integer
1175
);
1176

  
1177

  
1178
--
1179
-- Name: location_location_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1180
--
1181

  
1182
CREATE SEQUENCE location_location_id_seq
1183
    START WITH 1
1184
    INCREMENT BY 1
1185
    NO MINVALUE
1186
    NO MAXVALUE
1187
    CACHE 1;
1188

  
1189

  
1190
--
1191
-- Name: location_location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1192
--
1193

  
1194
ALTER SEQUENCE location_location_id_seq OWNED BY location.location_id;
1195

  
1196

  
1197
--
1198
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1199
--
1200

  
1201
CREATE TABLE locationevent (
1202
    locationevent_id integer NOT NULL,
1203
    previous_id integer,
1204
    location_id integer NOT NULL,
1205
    project_id integer,
1206
    sourceid character varying(30),
1207
    dateaccuracy character varying(30),
1208
    covermethod_id integer,
1209
    coverdispersion character varying(30),
1210
    autotaxoncover boolean,
1211
    stratummethod_id integer,
1212
    methodnarrative text,
1213
    taxonoccurrencearea double precision,
1214
    stemsizelimit double precision,
1215
    stemarea double precision,
1216
    stemsamplemethod character varying(30),
1217
    originaldata text,
1218
    effortlevel character varying(30),
1219
    locationvalidationlevel integer,
1220
    floristicquality character varying(30),
1221
    bryophytequality character varying(30),
1222
    lichenquality character varying(30),
1223
    locationeventnarrative text,
1224
    landscapenarrative text,
1225
    homogeneity character varying(50),
1226
    phenologicaspect character varying(30),
1227
    representativeness character varying(255),
1228
    standmaturity character varying(50),
1229
    successionalstatus text,
1230
    basalarea double precision,
1231
    hydrologicregime character varying(30),
1232
    soilmoistureregime character varying(30),
1233
    soildrainage character varying(30),
1234
    watersalinity character varying(30),
1235
    waterdepth double precision,
1236
    shoredistance double precision,
1237
    soildepth double precision,
1238
    organicdepth double precision,
1239
    soiltaxon_id integer,
1240
    soiltaxonsrc character varying(200),
1241
    percentbedrock double precision,
1242
    percentrockgravel double precision,
1243
    percentwood double precision,
1244
    percentlitter double precision,
1245
    percentbaresoil double precision,
1246
    percentwater double precision,
1247
    percentother double precision,
1248
    nameother character varying(30),
1249
    treeht double precision,
1250
    shrubht double precision,
1251
    fieldht double precision,
1252
    nonvascularht double precision,
1253
    submergedht double precision,
1254
    treecover double precision,
1255
    shrubcover double precision,
1256
    fieldcover double precision,
1257
    nonvascularcover double precision,
1258
    floatingcover double precision,
1259
    submergedcover double precision,
1260
    dominantstratum character varying(40),
1261
    growthform1type character varying(40),
1262
    growthform2type character varying(40),
1263
    growthform3type character varying(40),
1264
    growthform1cover double precision,
1265
    growthform2cover double precision,
1266
    growthform3cover double precision,
1267
    totalcover double precision,
1268
    notespublic boolean,
1269
    notesmgt boolean,
1270
    revisions boolean,
1271
    obsstartdate timestamp with time zone,
1272
    obsenddate timestamp with time zone,
1273
    dateentered timestamp with time zone DEFAULT now(),
1274
    emb_locationevent integer,
1275
    interp_orig_ci_id integer,
1276
    interp_orig_cc_id integer,
1277
    interp_orig_sciname text,
1278
    interp_orig_code text,
1279
    interp_orig_party_id integer,
1280
    interp_orig_partyname text,
1281
    interp_current_ci_id integer,
1282
    interp_current_cc_id integer,
1283
    interp_current_sciname text,
1284
    interp_current_code text,
1285
    interp_current_party_id integer,
1286
    interp_current_partyname text,
1287
    interp_bestfit_ci_id integer,
1288
    interp_bestfit_cc_id integer,
1289
    interp_bestfit_sciname text,
1290
    interp_bestfit_code text,
1291
    interp_bestfit_party_id integer,
1292
    interp_bestfit_partyname text,
1293
    toptaxon1name character varying(255),
1294
    toptaxon2name character varying(255),
1295
    toptaxon3name character varying(255),
1296
    toptaxon4name character varying(255),
1297
    toptaxon5name character varying(255),
1298
    numberoftaxa integer,
1299
    accessioncode character varying(255)
1300
);
1301

  
1302

  
1303
--
1304
-- Name: TABLE locationevent; Type: COMMENT; Schema: public; Owner: -
1305
--
1306

  
1307
COMMENT ON TABLE locationevent IS 'VegBank''s observation table.';
1308

  
1309

  
1310
--
1311
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1312
--
1313

  
1314
CREATE SEQUENCE locationevent_locationevent_id_seq
1315
    START WITH 1
1316
    INCREMENT BY 1
1317
    NO MINVALUE
1318
    NO MAXVALUE
1319
    CACHE 1;
1320

  
1321

  
1322
--
1323
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1324
--
1325

  
1326
ALTER SEQUENCE locationevent_locationevent_id_seq OWNED BY locationevent.locationevent_id;
1327

  
1328

  
1329
--
1330
-- Name: locationeventcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1331
--
1332

  
1333
CREATE TABLE locationeventcontributor (
1334
    locationeventcontributor_id integer NOT NULL,
1335
    locationevent_id integer NOT NULL,
1336
    party_id integer NOT NULL,
1337
    role_id integer NOT NULL,
1338
    contributiondate timestamp with time zone
1339
);
1340

  
1341

  
1342
--
1343
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1344
--
1345

  
1346
CREATE SEQUENCE locationeventcontributor_locationeventcontributor_id_seq
1347
    START WITH 1
1348
    INCREMENT BY 1
1349
    NO MINVALUE
1350
    NO MAXVALUE
1351
    CACHE 1;
1352

  
1353

  
1354
--
1355
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1356
--
1357

  
1358
ALTER SEQUENCE locationeventcontributor_locationeventcontributor_id_seq OWNED BY locationeventcontributor.locationeventcontributor_id;
1359

  
1360

  
1361
--
1362
-- Name: locationeventsynonym; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1363
--
1364

  
1365
CREATE TABLE locationeventsynonym (
1366
    locationeventsynonym_id integer NOT NULL,
1367
    synonymlocationevent_id integer NOT NULL,
1368
    primarylocationevent_id integer NOT NULL,
1369
    party_id integer NOT NULL,
1370
    role_id integer NOT NULL,
1371
    synonymcomment text,
1372
    classstartdate timestamp with time zone DEFAULT now() NOT NULL,
1373
    classstopdate timestamp with time zone,
1374
    accessioncode character varying(255)
1375
);
1376

  
1377

  
1378
--
1379
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1380
--
1381

  
1382
CREATE SEQUENCE locationeventsynonym_locationeventsynonym_id_seq
1383
    START WITH 1
1384
    INCREMENT BY 1
1385
    NO MINVALUE
1386
    NO MAXVALUE
1387
    CACHE 1;
1388

  
1389

  
1390
--
1391
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1392
--
1393

  
1394
ALTER SEQUENCE locationeventsynonym_locationeventsynonym_id_seq OWNED BY locationeventsynonym.locationeventsynonym_id;
1395

  
1396

  
1397
--
1118 1398
-- Name: namedplace; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1119 1399
--
1120 1400

  
......
1325 1605
--
1326 1606

  
1327 1607
CREATE TABLE place (
1328
    plotplace_id integer NOT NULL,
1329
    plot_id integer NOT NULL,
1608
    locationplace_id integer NOT NULL,
1609
    location_id integer NOT NULL,
1330 1610
    calculated boolean,
1331 1611
    namedplace_id integer NOT NULL
1332 1612
);
1333 1613

  
1334 1614

  
1335 1615
--
1336
-- Name: place_plotplace_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1616
-- Name: place_locationplace_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1337 1617
--
1338 1618

  
1339
CREATE SEQUENCE place_plotplace_id_seq
1619
CREATE SEQUENCE place_locationplace_id_seq
1340 1620
    START WITH 1
1341 1621
    INCREMENT BY 1
1342 1622
    NO MINVALUE
......
1345 1625

  
1346 1626

  
1347 1627
--
1348
-- Name: place_plotplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1628
-- Name: place_locationplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1349 1629
--
1350 1630

  
1351
ALTER SEQUENCE place_plotplace_id_seq OWNED BY place.plotplace_id;
1631
ALTER SEQUENCE place_locationplace_id_seq OWNED BY place.locationplace_id;
1352 1632

  
1353 1633

  
1354 1634
--
......
1560 1840

  
1561 1841

  
1562 1842
--
1563
-- Name: plot; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1564
--
1565

  
1566
CREATE TABLE plot (
1567
    plot_id integer NOT NULL,
1568
    sourceid character varying(30),
1569
    reference_id integer,
1570
    parent_id integer,
1571
    reallatitude double precision,
1572
    reallongitude double precision,
1573
    locationaccuracy double precision,
1574
    confidentialitystatus integer NOT NULL,
1575
    confidentialityreason character varying(200),
1576
    latitude double precision,
1577
    longitude double precision,
1578
    authore character varying(20),
1579
    authorn character varying(20),
1580
    authorzone character varying(20),
1581
    authordatum character varying(20),
1582
    authorlocation character varying(200),
1583
    locationnarrative text,
1584
    azimuth double precision,
1585
    dsgpoly text,
1586
    shape character varying(50),
1587
    area double precision,
1588
    standsize character varying(50),
1589
    placementmethod character varying(50),
1590
    permanence boolean,
1591
    layoutnarrative text,
1592
    elevation double precision,
1593
    elevationaccuracy double precision,
1594
    elevationrange double precision,
1595
    slopeaspect double precision,
1596
    minslopeaspect double precision,
1597
    maxslopeaspect double precision,
1598
    slopegradient double precision,
1599
    minslopegradient double precision,
1600
    maxslopegradient double precision,
1601
    topoposition character varying(90),
1602
    landform character varying(50),
1603
    surficialdeposits character varying(90),
1604
    rocktype character varying(90),
1605
    stateprovince character varying(55),
1606
    country character varying(100),
1607
    submitter_surname character varying(100),
1608
    submitter_givenname character varying(100),
1609
    submitter_email character varying(100),
1610
    notespublic boolean,
1611
    notesmgt boolean,
1612
    revisions boolean,
1613
    dateentered timestamp with time zone DEFAULT now(),
1614
    emb_plot integer,
1615
    plotrationalenarrative text,
1616
    accessioncode character varying(255),
1617
    subplotxposition double precision,
1618
    subplotyposition double precision,
1619
    namedplace_id integer
1620
);
1621

  
1622

  
1623
--
1624
-- Name: plot_plot_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1625
--
1626

  
1627
CREATE SEQUENCE plot_plot_id_seq
1628
    START WITH 1
1629
    INCREMENT BY 1
1630
    NO MINVALUE
1631
    NO MAXVALUE
1632
    CACHE 1;
1633

  
1634

  
1635
--
1636
-- Name: plot_plot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1637
--
1638

  
1639
ALTER SEQUENCE plot_plot_id_seq OWNED BY plot.plot_id;
1640

  
1641

  
1642
--
1643
-- Name: plotevent; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1644
--
1645

  
1646
CREATE TABLE plotevent (
1647
    plotevent_id integer NOT NULL,
1648
    previous_id integer,
1649
    plot_id integer NOT NULL,
1650
    project_id integer,
1651
    sourceid character varying(30),
1652
    dateaccuracy character varying(30),
1653
    covermethod_id integer,
1654
    coverdispersion character varying(30),
1655
    autotaxoncover boolean,
1656
    stratummethod_id integer,
1657
    methodnarrative text,
1658
    taxonoccurrencearea double precision,
1659
    stemsizelimit double precision,
1660
    stemarea double precision,
1661
    stemsamplemethod character varying(30),
1662
    originaldata text,
1663
    effortlevel character varying(30),
1664
    plotvalidationlevel integer,
1665
    floristicquality character varying(30),
1666
    bryophytequality character varying(30),
1667
    lichenquality character varying(30),
1668
    ploteventnarrative text,
1669
    landscapenarrative text,
1670
    homogeneity character varying(50),
1671
    phenologicaspect character varying(30),
1672
    representativeness character varying(255),
1673
    standmaturity character varying(50),
1674
    successionalstatus text,
1675
    basalarea double precision,
1676
    hydrologicregime character varying(30),
1677
    soilmoistureregime character varying(30),
1678
    soildrainage character varying(30),
1679
    watersalinity character varying(30),
1680
    waterdepth double precision,
1681
    shoredistance double precision,
1682
    soildepth double precision,
1683
    organicdepth double precision,
1684
    soiltaxon_id integer,
1685
    soiltaxonsrc character varying(200),
1686
    percentbedrock double precision,
1687
    percentrockgravel double precision,
1688
    percentwood double precision,
1689
    percentlitter double precision,
1690
    percentbaresoil double precision,
1691
    percentwater double precision,
1692
    percentother double precision,
1693
    nameother character varying(30),
1694
    treeht double precision,
1695
    shrubht double precision,
1696
    fieldht double precision,
1697
    nonvascularht double precision,
1698
    submergedht double precision,
1699
    treecover double precision,
1700
    shrubcover double precision,
1701
    fieldcover double precision,
1702
    nonvascularcover double precision,
1703
    floatingcover double precision,
1704
    submergedcover double precision,
1705
    dominantstratum character varying(40),
1706
    growthform1type character varying(40),
1707
    growthform2type character varying(40),
1708
    growthform3type character varying(40),
1709
    growthform1cover double precision,
1710
    growthform2cover double precision,
1711
    growthform3cover double precision,
1712
    totalcover double precision,
1713
    notespublic boolean,
1714
    notesmgt boolean,
1715
    revisions boolean,
1716
    obsstartdate timestamp with time zone,
1717
    obsenddate timestamp with time zone,
1718
    dateentered timestamp with time zone DEFAULT now(),
1719
    emb_plotevent integer,
1720
    interp_orig_ci_id integer,
1721
    interp_orig_cc_id integer,
1722
    interp_orig_sciname text,
1723
    interp_orig_code text,
1724
    interp_orig_party_id integer,
1725
    interp_orig_partyname text,
1726
    interp_current_ci_id integer,
1727
    interp_current_cc_id integer,
1728
    interp_current_sciname text,
1729
    interp_current_code text,
1730
    interp_current_party_id integer,
1731
    interp_current_partyname text,
1732
    interp_bestfit_ci_id integer,
1733
    interp_bestfit_cc_id integer,
1734
    interp_bestfit_sciname text,
1735
    interp_bestfit_code text,
1736
    interp_bestfit_party_id integer,
1737
    interp_bestfit_partyname text,
1738
    toptaxon1name character varying(255),
1739
    toptaxon2name character varying(255),
1740
    toptaxon3name character varying(255),
1741
    toptaxon4name character varying(255),
1742
    toptaxon5name character varying(255),
1743
    numberoftaxa integer,
1744
    accessioncode character varying(255)
1745
);
1746

  
1747

  
1748
--
1749
-- Name: TABLE plotevent; Type: COMMENT; Schema: public; Owner: -
1750
--
1751

  
1752
COMMENT ON TABLE plotevent IS 'VegBank''s observation table.';
1753

  
1754

  
1755
--
1756
-- Name: plotevent_plotevent_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1757
--
1758

  
1759
CREATE SEQUENCE plotevent_plotevent_id_seq
1760
    START WITH 1
1761
    INCREMENT BY 1
1762
    NO MINVALUE
1763
    NO MAXVALUE
1764
    CACHE 1;
1765

  
1766

  
1767
--
1768
-- Name: plotevent_plotevent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1769
--
1770

  
1771
ALTER SEQUENCE plotevent_plotevent_id_seq OWNED BY plotevent.plotevent_id;
1772

  
1773

  
1774
--
1775
-- Name: ploteventcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1776
--
1777

  
1778
CREATE TABLE ploteventcontributor (
1779
    ploteventcontributor_id integer NOT NULL,
1780
    plotevent_id integer NOT NULL,
1781
    party_id integer NOT NULL,
1782
    role_id integer NOT NULL,
1783
    contributiondate timestamp with time zone
1784
);
1785

  
1786

  
1787
--
1788
-- Name: ploteventcontributor_ploteventcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1789
--
1790

  
1791
CREATE SEQUENCE ploteventcontributor_ploteventcontributor_id_seq
1792
    START WITH 1
1793
    INCREMENT BY 1
1794
    NO MINVALUE
1795
    NO MAXVALUE
1796
    CACHE 1;
1797

  
1798

  
1799
--
1800
-- Name: ploteventcontributor_ploteventcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1801
--
1802

  
1803
ALTER SEQUENCE ploteventcontributor_ploteventcontributor_id_seq OWNED BY ploteventcontributor.ploteventcontributor_id;
1804

  
1805

  
1806
--
1807
-- Name: ploteventsynonym; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1808
--
1809

  
1810
CREATE TABLE ploteventsynonym (
1811
    ploteventsynonym_id integer NOT NULL,
1812
    synonymplotevent_id integer NOT NULL,
1813
    primaryplotevent_id integer NOT NULL,
1814
    party_id integer NOT NULL,
1815
    role_id integer NOT NULL,
1816
    synonymcomment text,
1817
    classstartdate timestamp with time zone DEFAULT now() NOT NULL,
1818
    classstopdate timestamp with time zone,
1819
    accessioncode character varying(255)
1820
);
1821

  
1822

  
1823
--
1824
-- Name: ploteventsynonym_ploteventsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1825
--
1826

  
1827
CREATE SEQUENCE ploteventsynonym_ploteventsynonym_id_seq
1828
    START WITH 1
1829
    INCREMENT BY 1
1830
    NO MINVALUE
1831
    NO MAXVALUE
1832
    CACHE 1;
1833

  
1834

  
1835
--
1836
-- Name: ploteventsynonym_ploteventsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1837
--
1838

  
1839
ALTER SEQUENCE ploteventsynonym_ploteventsynonym_id_seq OWNED BY ploteventsynonym.ploteventsynonym_id;
1840

  
1841

  
1842
--
1843 1843
-- Name: project; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1844 1844
--
1845 1845

  
......
1850 1850
    startdate timestamp with time zone,
1851 1851
    stopdate timestamp with time zone,
1852 1852
    d_obscount integer,
1853
    d_lastplotaddeddate timestamp with time zone,
1853
    d_lastlocationaddeddate timestamp with time zone,
1854 1854
    accessioncode character varying(255)
1855 1855
);
1856 1856

  
......
2180 2180

  
2181 2181
CREATE TABLE soilobs (
2182 2182
    soilobs_id integer NOT NULL,
2183
    plotevent_id integer NOT NULL,
2183
    locationevent_id integer NOT NULL,
2184 2184
    soilhorizon character varying(15) NOT NULL,
2185 2185
    soildepthtop double precision,
2186 2186
    soildepthbottom double precision,
......
2352 2352

  
2353 2353
CREATE TABLE stratum (
2354 2354
    stratum_id integer NOT NULL,
2355
    plotevent_id integer NOT NULL,
2355
    locationevent_id integer NOT NULL,
2356 2356
    stratumtype_id integer NOT NULL,
2357 2357
    stratummethod_id integer,
2358 2358
    stratumname character varying(30),
......
2565 2565

  
2566 2566
CREATE TABLE taxonoccurrence (
2567 2567
    taxonoccurrence_id integer NOT NULL,
2568
    plotevent_id integer NOT NULL,
2568
    locationevent_id integer NOT NULL,
2569 2569
    authorplantname character varying(255),
2570 2570
    reference_id integer,
2571 2571
    taxoninferencearea double precision,
......
3365 3365

  
3366 3366

  
3367 3367
--
3368
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: -
3369
--
3370

  
3371
ALTER TABLE location ALTER COLUMN location_id SET DEFAULT nextval('location_location_id_seq'::regclass);
3372

  
3373

  
3374
--
3375
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
3376
--
3377

  
3378
ALTER TABLE locationevent ALTER COLUMN locationevent_id SET DEFAULT nextval('locationevent_locationevent_id_seq'::regclass);
3379

  
3380

  
3381
--
3382
-- Name: locationeventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
3383
--
3384

  
3385
ALTER TABLE locationeventcontributor ALTER COLUMN locationeventcontributor_id SET DEFAULT nextval('locationeventcontributor_locationeventcontributor_id_seq'::regclass);
3386

  
3387

  
3388
--
3389
-- Name: locationeventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
3390
--
3391

  
3392
ALTER TABLE locationeventsynonym ALTER COLUMN locationeventsynonym_id SET DEFAULT nextval('locationeventsynonym_locationeventsynonym_id_seq'::regclass);
3393

  
3394

  
3395
--
3368 3396
-- Name: namedplace_id; Type: DEFAULT; Schema: public; Owner: -
3369 3397
--
3370 3398

  
......
3407 3435

  
3408 3436

  
3409 3437
--
3410
-- Name: plotplace_id; Type: DEFAULT; Schema: public; Owner: -
3438
-- Name: locationplace_id; Type: DEFAULT; Schema: public; Owner: -
3411 3439
--
3412 3440

  
3413
ALTER TABLE place ALTER COLUMN plotplace_id SET DEFAULT nextval('place_plotplace_id_seq'::regclass);
3441
ALTER TABLE place ALTER COLUMN locationplace_id SET DEFAULT nextval('place_locationplace_id_seq'::regclass);
3414 3442

  
3415 3443

  
3416 3444
--
......
3456 3484

  
3457 3485

  
3458 3486
--
3459
-- Name: plot_id; Type: DEFAULT; Schema: public; Owner: -
3460
--
3461

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

  
3464

  
3465
--
3466
-- Name: plotevent_id; Type: DEFAULT; Schema: public; Owner: -
3467
--
3468

  
3469
ALTER TABLE plotevent ALTER COLUMN plotevent_id SET DEFAULT nextval('plotevent_plotevent_id_seq'::regclass);
3470

  
3471

  
3472
--
3473
-- Name: ploteventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
3474
--
3475

  
3476
ALTER TABLE ploteventcontributor ALTER COLUMN ploteventcontributor_id SET DEFAULT nextval('ploteventcontributor_ploteventcontributor_id_seq'::regclass);
3477

  
3478

  
3479
--
3480
-- Name: ploteventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
3481
--
3482

  
3483
ALTER TABLE ploteventsynonym ALTER COLUMN ploteventsynonym_id SET DEFAULT nextval('ploteventsynonym_ploteventsynonym_id_seq'::regclass);
3484

  
3485

  
3486
--
3487 3487
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: -
3488 3488
--
3489 3489

  
......
3766 3766
--
3767 3767

  
3768 3768
ALTER TABLE ONLY commclass
3769
    ADD CONSTRAINT commclass_keys UNIQUE (plotevent_id, classnotes);
3769
    ADD CONSTRAINT commclass_keys UNIQUE (locationevent_id, classnotes);
3770 3770

  
3771 3771

  
3772 3772
--
......
4010 4010

  
4011 4011

  
4012 4012
--
4013
-- Name: location_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4014
--
4015

  
4016
ALTER TABLE ONLY location
4017
    ADD CONSTRAINT location_keys UNIQUE (reference_id, parent_id, sourceid);
4018

  
4019

  
4020
--
4021
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4022
--
4023

  
4024
ALTER TABLE ONLY location
4025
    ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);
4026

  
4027

  
4028
--
4029
-- Name: locationevent_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4030
--
4031

  
4032
ALTER TABLE ONLY locationevent
4033
    ADD CONSTRAINT locationevent_keys UNIQUE (location_id, project_id, sourceid);
4034

  
4035

  
4036
--
4037
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4038
--
4039

  
4040
ALTER TABLE ONLY locationevent
4041
    ADD CONSTRAINT locationevent_pkey PRIMARY KEY (locationevent_id);
4042

  
4043

  
4044
--
4045
-- Name: locationeventcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4046
--
4047

  
4048
ALTER TABLE ONLY locationeventcontributor
4049
    ADD CONSTRAINT locationeventcontributor_pkey PRIMARY KEY (locationeventcontributor_id);
4050

  
4051

  
4052
--
4053
-- Name: locationeventsynonym_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4054
--
4055

  
4056
ALTER TABLE ONLY locationeventsynonym
4057
    ADD CONSTRAINT locationeventsynonym_pkey PRIMARY KEY (locationeventsynonym_id);
4058

  
4059

  
4060
--
4013 4061
-- Name: namedplace_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4014 4062
--
4015 4063

  
......
4078 4126
--
4079 4127

  
4080 4128
ALTER TABLE ONLY place
4081
    ADD CONSTRAINT place_keys UNIQUE (plot_id, namedplace_id);
4129
    ADD CONSTRAINT place_keys UNIQUE (location_id, namedplace_id);
4082 4130

  
4083 4131

  
4084 4132
--
......
4086 4134
--
4087 4135

  
4088 4136
ALTER TABLE ONLY place
4089
    ADD CONSTRAINT place_pkey PRIMARY KEY (plotplace_id);
4137
    ADD CONSTRAINT place_pkey PRIMARY KEY (locationplace_id);
4090 4138

  
4091 4139

  
4092 4140
--
......
4138 4186

  
4139 4187

  
4140 4188
--
4141
-- Name: plot_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4142
--
4143

  
4144
ALTER TABLE ONLY plot
4145
    ADD CONSTRAINT plot_keys UNIQUE (reference_id, parent_id, sourceid);
4146

  
4147

  
4148
--
4149
-- Name: plot_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4150
--
4151

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

  
4155

  
4156
--
4157
-- Name: plotevent_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4158
--
4159

  
4160
ALTER TABLE ONLY plotevent
4161
    ADD CONSTRAINT plotevent_keys UNIQUE (plot_id, project_id, sourceid);
4162

  
4163

  
4164
--
4165
-- Name: plotevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4166
--
4167

  
4168
ALTER TABLE ONLY plotevent
4169
    ADD CONSTRAINT plotevent_pkey PRIMARY KEY (plotevent_id);
4170

  
4171

  
4172
--
4173
-- Name: ploteventcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4174
--
4175

  
4176
ALTER TABLE ONLY ploteventcontributor
4177
    ADD CONSTRAINT ploteventcontributor_pkey PRIMARY KEY (ploteventcontributor_id);
4178

  
4179

  
4180
--
4181
-- Name: ploteventsynonym_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4182
--
4183

  
4184
ALTER TABLE ONLY ploteventsynonym
4185
    ADD CONSTRAINT ploteventsynonym_pkey PRIMARY KEY (ploteventsynonym_id);
4186

  
4187

  
4188
--
4189 4189
-- Name: project_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4190 4190
--
4191 4191

  
......
4270 4270
--
4271 4271

  
4272 4272
ALTER TABLE ONLY soilobs
4273
    ADD CONSTRAINT soilobs_keys UNIQUE (plotevent_id);
4273
    ADD CONSTRAINT soilobs_keys UNIQUE (locationevent_id);
4274 4274

  
4275 4275

  
4276 4276
--
......
4600 4600

  
4601 4601

  
4602 4602
--
4603
-- Name: commclass_plotevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4603
-- Name: commclass_locationevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4604 4604
--
4605 4605

  
4606
CREATE INDEX commclass_plotevent_id_x ON commclass USING btree (plotevent_id);
4606
CREATE INDEX commclass_locationevent_id_x ON commclass USING btree (locationevent_id);
4607 4607

  
4608 4608

  
4609 4609
--
......
4810 4810

  
4811 4811

  
4812 4812
--
4813
-- Name: disturbanceobs_plotevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4813
-- Name: disturbanceobs_locationevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4814 4814
--
4815 4815

  
4816
CREATE INDEX disturbanceobs_plotevent_id_x ON disturbanceobs USING btree (plotevent_id);
4816
CREATE INDEX disturbanceobs_locationevent_id_x ON disturbanceobs USING btree (locationevent_id);
4817 4817

  
4818 4818

  
4819 4819
--
......
4859 4859

  
4860 4860

  
4861 4861
--
4862
-- Name: emb_plot_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4862
-- Name: emb_location_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4863 4863
--
4864 4864

  
4865
CREATE INDEX emb_plot_idx ON plot USING btree (emb_plot);
4865
CREATE INDEX emb_location_idx ON location USING btree (emb_location);
4866 4866

  
4867 4867

  
4868 4868
--
4869
-- Name: emb_plotevent_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4869
-- Name: emb_locationevent_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4870 4870
--
4871 4871

  
4872
CREATE INDEX emb_plotevent_idx ON plotevent USING btree (emb_plotevent);
4872
CREATE INDEX emb_locationevent_idx ON locationevent USING btree (emb_locationevent);
4873 4873

  
4874 4874

  
4875 4875
--
......
4908 4908

  
4909 4909

  
4910 4910
--
4911
-- Name: embargo_plot_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4911
-- Name: embargo_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4912 4912
--
4913 4913

  
4914
CREATE INDEX embargo_plot_id_x ON embargo USING btree (plot_id);
4914
CREATE INDEX embargo_location_id_x ON embargo USING btree (location_id);
4915 4915

  
4916 4916

  
4917 4917
--
4918
-- Name: fki_plot_namedplace_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4918
-- Name: fki_location_namedplace_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4919 4919
--
4920 4920

  
4921
CREATE INDEX fki_plot_namedplace_id ON plot USING btree (namedplace_id);
4921
CREATE INDEX fki_location_namedplace_id ON location USING btree (namedplace_id);
4922 4922

  
4923 4923

  
4924 4924
--
......
4971 4971

  
4972 4972

  
4973 4973
--
4974
-- Name: graphic_plotevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4974
-- Name: graphic_locationevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4975 4975
--
4976 4976

  
4977
CREATE INDEX graphic_plotevent_id_x ON graphic USING btree (plotevent_id);
4977
CREATE INDEX graphic_locationevent_id_x ON graphic USING btree (locationevent_id);
4978 4978

  
4979 4979

  
4980 4980
--
......
4992 4992

  
4993 4993

  
4994 4994
--
4995
-- Name: namedplace_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4995
-- Name: location_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4996 4996
--
4997 4997

  
4998
CREATE UNIQUE INDEX namedplace_accessioncode_index ON namedplace USING btree (accessioncode);
4998
CREATE UNIQUE INDEX location_accessioncode_index ON location USING btree (accessioncode);
4999 4999

  
5000 5000

  
5001 5001
--
5002
-- Name: namedplace_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5002
-- Name: location_parent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5003 5003
--
5004 5004

  
5005
CREATE INDEX namedplace_reference_id_x ON namedplace USING btree (reference_id);
5005
CREATE INDEX location_parent_id_x ON location USING btree (parent_id);
5006 5006

  
5007 5007

  
5008 5008
--
5009
-- Name: note_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5009
-- Name: location_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5010 5010
--
5011 5011

  
5012
CREATE UNIQUE INDEX note_accessioncode_index ON note USING btree (accessioncode);
5012
CREATE INDEX location_reference_id_x ON location USING btree (reference_id);
5013 5013

  
5014 5014

  
5015 5015
--
5016
-- Name: note_notelink_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5016
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5017 5017
--
5018 5018

  
5019
CREATE INDEX note_notelink_id_x ON note USING btree (notelink_id);
5019
CREATE UNIQUE INDEX locationevent_accessioncode_index ON locationevent USING btree (accessioncode);
5020 5020

  
5021 5021

  
5022 5022
--
5023
-- Name: note_party_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5023
-- Name: locationevent_covermethod_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5024 5024
--
5025 5025

  
5026
CREATE INDEX note_party_id_x ON note USING btree (party_id);
5026
CREATE INDEX locationevent_covermethod_id_x ON locationevent USING btree (covermethod_id);
5027 5027

  
5028 5028

  
5029 5029
--
5030
-- Name: note_role_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5030
-- Name: locationevent_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5031 5031
--
5032 5032

  
5033
CREATE INDEX note_role_id_x ON note USING btree (role_id);
5033
CREATE INDEX locationevent_location_id_x ON locationevent USING btree (location_id);
5034 5034

  
5035 5035

  
5036 5036
--
5037
-- Name: party_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5037
-- Name: locationevent_previousobs_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5038 5038
--
5039 5039

  
5040
CREATE UNIQUE INDEX party_accessioncode_index ON party USING btree (accessioncode);
5040
CREATE INDEX locationevent_previousobs_id_x ON locationevent USING btree (previous_id);
5041 5041

  
5042 5042

  
5043 5043
--
5044
-- Name: party_currentname_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff