Revision 4391
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
82 | 82 |
|
83 | 83 |
|
84 | 84 |
-- |
85 |
-- Name: make_analytical_db(); Type: FUNCTION; Schema: public; Owner: - |
|
86 |
-- |
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
-- |
|
85 | 92 |
-- Name: namedplace_update_ancestors(); Type: FUNCTION; Schema: public; Owner: - |
86 | 93 |
-- |
87 | 94 |
|
... | ... | |
208 | 215 |
|
209 | 216 |
|
210 | 217 |
-- |
211 |
-- Name: classcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
218 |
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
212 | 219 |
-- |
213 | 220 |
|
214 |
CREATE TABLE classcontributor ( |
|
215 |
classcontributor_id int(11) NOT NULL, |
|
216 |
commclass_id int(11) NOT NULL, |
|
217 |
party_id int(11) NOT NULL, |
|
218 |
role text |
|
221 |
CREATE TABLE location ( |
|
222 |
location_id int(11) NOT NULL, |
|
223 |
datasource_id int(11) NOT NULL, |
|
224 |
sourceaccessioncode text, |
|
225 |
parent_id int(11), |
|
226 |
authorlocationcode text, |
|
227 |
centerlatitude double precision, |
|
228 |
centerlongitude double precision, |
|
229 |
locationaccuracy double precision, |
|
230 |
confidentialitystatus int(11) DEFAULT 0 NOT NULL, |
|
231 |
confidentialityreason text, |
|
232 |
publiclatitude double precision, |
|
233 |
publiclongitude double precision, |
|
234 |
sublocationxposition double precision, |
|
235 |
sublocationyposition double precision, |
|
236 |
authore text, |
|
237 |
authorn text, |
|
238 |
authorzone text, |
|
239 |
authordatum text, |
|
240 |
authorlocation text, |
|
241 |
locationnarrative text, |
|
242 |
azimuth double precision, |
|
243 |
shape text, |
|
244 |
area double precision, |
|
245 |
standsize text, |
|
246 |
placementmethod text, |
|
247 |
permanence int(1), |
|
248 |
layoutnarrative text, |
|
249 |
elevation double precision, |
|
250 |
elevationaccuracy double precision, |
|
251 |
elevationrange double precision, |
|
252 |
slopeaspect double precision, |
|
253 |
minslopeaspect double precision, |
|
254 |
maxslopeaspect double precision, |
|
255 |
slopegradient double precision, |
|
256 |
minslopegradient double precision, |
|
257 |
maxslopegradient double precision, |
|
258 |
topoposition text, |
|
259 |
landform text, |
|
260 |
surficialdeposits text, |
|
261 |
rocktype text, |
|
262 |
stateprovince text, |
|
263 |
country text, |
|
264 |
submitter_surname text, |
|
265 |
submitter_givenname text, |
|
266 |
submitter_email text, |
|
267 |
notespublic int(1), |
|
268 |
notesmgt int(1), |
|
269 |
revisions int(1), |
|
270 |
dateentered timestamp NULL , |
|
271 |
locationrationalenarrative text, |
|
272 |
accessioncode text |
|
219 | 273 |
); |
220 | 274 |
|
221 | 275 |
|
222 | 276 |
-- |
223 |
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
277 |
-- Name: TABLE location; Type: COMMENT; Schema: public; Owner: -
|
|
224 | 278 |
-- |
225 | 279 |
|
226 | 280 |
|
227 | 281 |
|
228 | 282 |
|
229 | 283 |
-- |
230 |
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
284 |
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
231 | 285 |
-- |
232 | 286 |
|
287 |
CREATE TABLE locationdetermination ( |
|
288 |
locationdetermination_id int(11) NOT NULL, |
|
289 |
location_id int(11) NOT NULL, |
|
290 |
latitude double precision, |
|
291 |
longitude double precision, |
|
292 |
verbatimlatitude text, |
|
293 |
verbatimlongitude text, |
|
294 |
verbatimcoordinates text, |
|
295 |
footprintgeometry_dwc text, |
|
296 |
coordsaccuracy double precision, |
|
297 |
namedplace_id int(11), |
|
298 |
identifier_id int(11), |
|
299 |
determinationdate timestamp NULL, |
|
300 |
isoriginal int(1) DEFAULT false NOT NULL, |
|
301 |
iscurrent int(1) DEFAULT false NOT NULL, |
|
302 |
calculated int(1) |
|
303 |
); |
|
233 | 304 |
|
234 | 305 |
|
306 |
-- |
|
307 |
-- Name: TABLE locationdetermination; Type: COMMENT; Schema: public; Owner: - |
|
308 |
-- |
|
235 | 309 |
|
310 |
|
|
311 |
|
|
312 |
|
|
236 | 313 |
-- |
237 |
-- Name: commclass; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
314 |
-- Name: COLUMN locationdetermination.footprintgeometry_dwc; Type: COMMENT; Schema: public; Owner: -
|
|
238 | 315 |
-- |
239 | 316 |
|
240 |
CREATE TABLE commclass ( |
|
241 |
commclass_id int(11) NOT NULL, |
|
242 |
locationevent_id int(11) NOT NULL, |
|
243 |
inspection int(1), |
|
244 |
tableanalysis int(1), |
|
245 |
multivariateanalysis int(1), |
|
246 |
classpublication_id int(11), |
|
247 |
classnotes text, |
|
248 |
commname text, |
|
249 |
commcode text, |
|
250 |
commframework text, |
|
251 |
commlevel text, |
|
252 |
classstartdate timestamp NULL, |
|
253 |
classstopdate timestamp NULL, |
|
254 |
expertsystem text, |
|
255 |
accessioncode text |
|
256 |
); |
|
257 | 317 |
|
258 | 318 |
|
319 |
|
|
259 | 320 |
-- |
260 |
-- Name: commclass_commclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
321 |
-- Name: COLUMN locationdetermination.coordsaccuracy; Type: COMMENT; Schema: public; Owner: -
|
|
261 | 322 |
-- |
262 | 323 |
|
263 | 324 |
|
264 | 325 |
|
265 | 326 |
|
266 | 327 |
-- |
267 |
-- Name: commclass_commclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
328 |
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
268 | 329 |
-- |
269 | 330 |
|
331 |
CREATE TABLE locationevent ( |
|
332 |
locationevent_id int(11) NOT NULL, |
|
333 |
datasource_id int(11) NOT NULL, |
|
334 |
sourceaccessioncode text, |
|
335 |
parent_id int(11), |
|
336 |
location_id int(11) NOT NULL, |
|
337 |
project_id int(11), |
|
338 |
authoreventcode text, |
|
339 |
previous_id int(11), |
|
340 |
dateaccuracy text, |
|
341 |
method_id int(11), |
|
342 |
temperature double precision, |
|
343 |
precipitation double precision, |
|
344 |
autotaxoncover int(1), |
|
345 |
originaldata text, |
|
346 |
effortlevel text, |
|
347 |
floristicquality text, |
|
348 |
bryophytequality text, |
|
349 |
lichenquality text, |
|
350 |
locationeventnarrative text, |
|
351 |
landscapenarrative text, |
|
352 |
homogeneity text, |
|
353 |
phenologicaspect text, |
|
354 |
representativeness text, |
|
355 |
standmaturity text, |
|
356 |
successionalstatus text, |
|
357 |
basalarea double precision, |
|
358 |
hydrologicregime text, |
|
359 |
soilmoistureregime text, |
|
360 |
soildrainage text, |
|
361 |
watersalinity text, |
|
362 |
waterdepth double precision, |
|
363 |
shoredistance double precision, |
|
364 |
soildepth double precision, |
|
365 |
organicdepth double precision, |
|
366 |
soiltaxon_id int(11), |
|
367 |
soiltaxonsrc text, |
|
368 |
percentbedrock double precision, |
|
369 |
percentrockgravel double precision, |
|
370 |
percentwood double precision, |
|
371 |
percentlitter double precision, |
|
372 |
percentbaresoil double precision, |
|
373 |
percentwater double precision, |
|
374 |
percentother double precision, |
|
375 |
nameother text, |
|
376 |
treeht double precision, |
|
377 |
shrubht double precision, |
|
378 |
fieldht double precision, |
|
379 |
nonvascularht double precision, |
|
380 |
submergedht double precision, |
|
381 |
treecover double precision, |
|
382 |
shrubcover double precision, |
|
383 |
fieldcover double precision, |
|
384 |
nonvascularcover double precision, |
|
385 |
floatingcover double precision, |
|
386 |
submergedcover double precision, |
|
387 |
dominantstratum text, |
|
388 |
growthform1type text, |
|
389 |
growthform2type text, |
|
390 |
growthform3type text, |
|
391 |
growthform1cover double precision, |
|
392 |
growthform2cover double precision, |
|
393 |
growthform3cover double precision, |
|
394 |
totalcover double precision, |
|
395 |
notespublic int(1), |
|
396 |
notesmgt int(1), |
|
397 |
revisions int(1), |
|
398 |
obsstartdate timestamp NULL, |
|
399 |
obsenddate timestamp NULL, |
|
400 |
dateentered timestamp NULL , |
|
401 |
toptaxon1name text, |
|
402 |
toptaxon2name text, |
|
403 |
toptaxon3name text, |
|
404 |
toptaxon4name text, |
|
405 |
toptaxon5name text, |
|
406 |
numberoftaxa int(11), |
|
407 |
accessioncode text |
|
408 |
); |
|
270 | 409 |
|
271 | 410 |
|
411 |
-- |
|
412 |
-- Name: TABLE locationevent; Type: COMMENT; Schema: public; Owner: - |
|
413 |
-- |
|
272 | 414 |
|
415 |
|
|
416 |
|
|
417 |
|
|
273 | 418 |
-- |
274 |
-- Name: commconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
419 |
-- Name: method; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
275 | 420 |
-- |
276 | 421 |
|
277 |
CREATE TABLE commconcept ( |
|
278 |
commconcept_id int(11) NOT NULL, |
|
279 |
commname_id int(11) NOT NULL, |
|
422 |
CREATE TABLE method ( |
|
423 |
method_id int(11) NOT NULL, |
|
280 | 424 |
reference_id int(11), |
281 |
commdescription text, |
|
282 |
d_obscount int(11), |
|
283 |
commname text, |
|
284 |
d_currentaccepted int(1), |
|
425 |
name text NOT NULL, |
|
426 |
description text, |
|
427 |
diameterheight double precision, |
|
428 |
mindiameter double precision, |
|
429 |
maxdiameter double precision, |
|
430 |
minheight double precision, |
|
431 |
maxheight double precision, |
|
432 |
observationtype text, |
|
433 |
observationmeasure text, |
|
434 |
covermethod_id int(11), |
|
435 |
samplingfactor double precision DEFAULT 1 NOT NULL, |
|
436 |
coverbasis text, |
|
437 |
stemsamplemethod text, |
|
438 |
shape text, |
|
439 |
length double precision, |
|
440 |
width double precision, |
|
441 |
radius double precision, |
|
442 |
area double precision, |
|
443 |
samplearea double precision, |
|
444 |
subplotspacing double precision, |
|
445 |
subplotmethod_id int(11), |
|
446 |
pointsperline int(11), |
|
285 | 447 |
accessioncode text |
286 | 448 |
); |
287 | 449 |
|
288 | 450 |
|
289 | 451 |
-- |
290 |
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
452 |
-- Name: TABLE method; Type: COMMENT; Schema: public; Owner: -
|
|
291 | 453 |
-- |
292 | 454 |
|
293 | 455 |
|
294 | 456 |
|
295 | 457 |
|
296 | 458 |
-- |
297 |
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
459 |
-- Name: COLUMN method.reference_id; Type: COMMENT; Schema: public; Owner: -
|
|
298 | 460 |
-- |
299 | 461 |
|
300 | 462 |
|
301 | 463 |
|
302 | 464 |
|
303 | 465 |
-- |
304 |
-- Name: commcorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
466 |
-- Name: COLUMN method.name; Type: COMMENT; Schema: public; Owner: -
|
|
305 | 467 |
-- |
306 | 468 |
|
307 |
CREATE TABLE commcorrelation ( |
|
308 |
commcorrelation_id int(11) NOT NULL, |
|
309 |
commstatus_id int(11) NOT NULL, |
|
310 |
commconcept_id int(11) NOT NULL, |
|
311 |
commconvergence text NOT NULL, |
|
312 |
correlationstart timestamp NOT NULL, |
|
313 |
correlationstop timestamp NULL |
|
314 |
); |
|
315 | 469 |
|
316 | 470 |
|
471 |
|
|
317 | 472 |
-- |
318 |
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
473 |
-- Name: COLUMN method.description; Type: COMMENT; Schema: public; Owner: -
|
|
319 | 474 |
-- |
320 | 475 |
|
321 | 476 |
|
322 | 477 |
|
323 | 478 |
|
324 | 479 |
-- |
325 |
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
480 |
-- Name: COLUMN method.diameterheight; Type: COMMENT; Schema: public; Owner: -
|
|
326 | 481 |
-- |
327 | 482 |
|
328 | 483 |
|
329 | 484 |
|
330 | 485 |
|
331 | 486 |
-- |
332 |
-- Name: commdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
487 |
-- Name: COLUMN method.mindiameter; Type: COMMENT; Schema: public; Owner: -
|
|
333 | 488 |
-- |
334 | 489 |
|
335 |
CREATE TABLE commdetermination ( |
|
336 |
commdetermination_id int(11) NOT NULL, |
|
337 |
commclass_id int(11) NOT NULL, |
|
338 |
commconcept_id int(11) NOT NULL, |
|
339 |
commcode text, |
|
340 |
commname text, |
|
341 |
classfit text, |
|
342 |
classconfidence text, |
|
343 |
commauthority_id int(11), |
|
344 |
notes text, |
|
345 |
type int(1), |
|
346 |
nomenclaturaltype int(1) |
|
347 |
); |
|
348 | 490 |
|
349 | 491 |
|
492 |
|
|
350 | 493 |
-- |
351 |
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
494 |
-- Name: COLUMN method.maxdiameter; Type: COMMENT; Schema: public; Owner: -
|
|
352 | 495 |
-- |
353 | 496 |
|
354 | 497 |
|
355 | 498 |
|
356 | 499 |
|
357 | 500 |
-- |
358 |
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
501 |
-- Name: COLUMN method.minheight; Type: COMMENT; Schema: public; Owner: -
|
|
359 | 502 |
-- |
360 | 503 |
|
361 | 504 |
|
362 | 505 |
|
363 | 506 |
|
364 | 507 |
-- |
365 |
-- Name: commlineage; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
508 |
-- Name: COLUMN method.maxheight; Type: COMMENT; Schema: public; Owner: -
|
|
366 | 509 |
-- |
367 | 510 |
|
368 |
CREATE TABLE commlineage ( |
|
369 |
commlineage_id int(11) NOT NULL, |
|
370 |
parentcommstatus_id int(11) NOT NULL, |
|
371 |
childcommstatus_id int(11) NOT NULL |
|
372 |
); |
|
373 | 511 |
|
374 | 512 |
|
513 |
|
|
375 | 514 |
-- |
376 |
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
515 |
-- Name: COLUMN method.observationtype; Type: COMMENT; Schema: public; Owner: -
|
|
377 | 516 |
-- |
378 | 517 |
|
379 | 518 |
|
380 | 519 |
|
381 | 520 |
|
382 | 521 |
-- |
383 |
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
522 |
-- Name: COLUMN method.observationmeasure; Type: COMMENT; Schema: public; Owner: -
|
|
384 | 523 |
-- |
385 | 524 |
|
386 | 525 |
|
387 | 526 |
|
388 | 527 |
|
389 | 528 |
-- |
390 |
-- Name: commname; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
529 |
-- Name: COLUMN method.samplingfactor; Type: COMMENT; Schema: public; Owner: -
|
|
391 | 530 |
-- |
392 | 531 |
|
393 |
CREATE TABLE commname ( |
|
394 |
commname_id int(11) NOT NULL, |
|
395 |
commname text NOT NULL, |
|
396 |
reference_id int(11), |
|
397 |
dateentered timestamp NULL |
|
398 |
); |
|
399 | 532 |
|
400 | 533 |
|
534 |
|
|
401 | 535 |
-- |
402 |
-- Name: commname_commname_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
536 |
-- Name: COLUMN method.coverbasis; Type: COMMENT; Schema: public; Owner: -
|
|
403 | 537 |
-- |
404 | 538 |
|
405 | 539 |
|
406 | 540 |
|
407 | 541 |
|
408 | 542 |
-- |
409 |
-- Name: commname_commname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
543 |
-- Name: COLUMN method.stemsamplemethod; Type: COMMENT; Schema: public; Owner: -
|
|
410 | 544 |
-- |
411 | 545 |
|
412 | 546 |
|
413 | 547 |
|
414 | 548 |
|
415 | 549 |
-- |
416 |
-- Name: commstatus; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
550 |
-- Name: COLUMN method.shape; Type: COMMENT; Schema: public; Owner: -
|
|
417 | 551 |
-- |
418 | 552 |
|
419 |
CREATE TABLE commstatus ( |
|
420 |
commstatus_id int(11) NOT NULL, |
|
421 |
commconcept_id int(11) NOT NULL, |
|
422 |
reference_id int(11), |
|
423 |
commconceptstatus text NOT NULL, |
|
424 |
commparent_id int(11), |
|
425 |
commlevel text, |
|
426 |
commpartycomments text, |
|
427 |
party_id int(11) NOT NULL, |
|
428 |
startdate timestamp NOT NULL, |
|
429 |
stopdate timestamp NULL, |
|
553 |
|
|
554 |
|
|
555 |
|
|
556 |
-- |
|
557 |
-- Name: COLUMN method.length; Type: COMMENT; Schema: public; Owner: - |
|
558 |
-- |
|
559 |
|
|
560 |
|
|
561 |
|
|
562 |
|
|
563 |
-- |
|
564 |
-- Name: COLUMN method.width; Type: COMMENT; Schema: public; Owner: - |
|
565 |
-- |
|
566 |
|
|
567 |
|
|
568 |
|
|
569 |
|
|
570 |
-- |
|
571 |
-- Name: COLUMN method.radius; Type: COMMENT; Schema: public; Owner: - |
|
572 |
-- |
|
573 |
|
|
574 |
|
|
575 |
|
|
576 |
|
|
577 |
-- |
|
578 |
-- Name: COLUMN method.area; Type: COMMENT; Schema: public; Owner: - |
|
579 |
-- |
|
580 |
|
|
581 |
|
|
582 |
|
|
583 |
|
|
584 |
-- |
|
585 |
-- Name: COLUMN method.samplearea; Type: COMMENT; Schema: public; Owner: - |
|
586 |
-- |
|
587 |
|
|
588 |
|
|
589 |
|
|
590 |
|
|
591 |
-- |
|
592 |
-- Name: COLUMN method.subplotspacing; Type: COMMENT; Schema: public; Owner: - |
|
593 |
-- |
|
594 |
|
|
595 |
|
|
596 |
|
|
597 |
|
|
598 |
-- |
|
599 |
-- Name: COLUMN method.subplotmethod_id; Type: COMMENT; Schema: public; Owner: - |
|
600 |
-- |
|
601 |
|
|
602 |
|
|
603 |
|
|
604 |
|
|
605 |
-- |
|
606 |
-- Name: COLUMN method.pointsperline; Type: COMMENT; Schema: public; Owner: - |
|
607 |
-- |
|
608 |
|
|
609 |
|
|
610 |
|
|
611 |
|
|
612 |
-- |
|
613 |
-- Name: namedplace; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
614 |
-- |
|
615 |
|
|
616 |
CREATE TABLE namedplace ( |
|
617 |
namedplace_id int(11) NOT NULL, |
|
618 |
parent_id int(11), |
|
619 |
rank text NOT NULL, |
|
620 |
placename text NOT NULL, |
|
621 |
placecode text, |
|
622 |
placedescription text, |
|
430 | 623 |
accessioncode text |
431 | 624 |
); |
432 | 625 |
|
433 | 626 |
|
434 | 627 |
-- |
435 |
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
628 |
-- Name: namedplace_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
436 | 629 |
-- |
437 | 630 |
|
631 |
CREATE TABLE namedplace_ancestor ( |
|
632 |
namedplace_id int(11) NOT NULL, |
|
633 |
ancestor_id int(11) NOT NULL |
|
634 |
); |
|
438 | 635 |
|
439 | 636 |
|
637 |
-- |
|
638 |
-- Name: party; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
639 |
-- |
|
440 | 640 |
|
641 |
CREATE TABLE party ( |
|
642 |
party_id int(11) NOT NULL, |
|
643 |
salutation text, |
|
644 |
givenname text, |
|
645 |
middlename text, |
|
646 |
surname text, |
|
647 |
organizationname text, |
|
648 |
currentname_id int(11), |
|
649 |
contactinstructions text, |
|
650 |
email text, |
|
651 |
partytype text, |
|
652 |
partypublic int(1) DEFAULT true, |
|
653 |
d_obscount int(11), |
|
654 |
accessioncode text |
|
655 |
); |
|
656 |
|
|
657 |
|
|
441 | 658 |
-- |
442 |
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
659 |
-- Name: plantconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
443 | 660 |
-- |
444 | 661 |
|
662 |
CREATE TABLE plantconcept ( |
|
663 |
plantconcept_id int(11) NOT NULL, |
|
664 |
plantname_id int(11) NOT NULL, |
|
665 |
plantcode text, |
|
666 |
plantdescription text, |
|
667 |
accessioncode text |
|
668 |
); |
|
445 | 669 |
|
446 | 670 |
|
671 |
-- |
|
672 |
-- Name: plantname; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
673 |
-- |
|
447 | 674 |
|
675 |
CREATE TABLE plantname ( |
|
676 |
plantname_id int(11) NOT NULL, |
|
677 |
parent_id int(11), |
|
678 |
scope_id int(11), |
|
679 |
rank text NOT NULL, |
|
680 |
plantname text NOT NULL, |
|
681 |
accessioncode text |
|
682 |
); |
|
683 |
|
|
684 |
|
|
448 | 685 |
-- |
449 |
-- Name: commusage; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
686 |
-- Name: plantname_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
450 | 687 |
-- |
451 | 688 |
|
452 |
CREATE TABLE commusage ( |
|
453 |
commusage_id int(11) NOT NULL, |
|
454 |
commname_id int(11) NOT NULL, |
|
455 |
commname text, |
|
456 |
commconcept_id int(11), |
|
457 |
commnamestatus text, |
|
458 |
classsystem text, |
|
459 |
party_id int(11), |
|
460 |
commstatus_id int(11), |
|
461 |
usagestart timestamp NULL, |
|
462 |
usagestop timestamp NULL |
|
689 |
CREATE TABLE plantname_ancestor ( |
|
690 |
plantname_id int(11) NOT NULL, |
|
691 |
ancestor_id int(11) NOT NULL |
|
463 | 692 |
); |
464 | 693 |
|
465 | 694 |
|
466 | 695 |
-- |
467 |
-- Name: commusage_commusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
696 |
-- Name: plantobservation; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
468 | 697 |
-- |
469 | 698 |
|
699 |
CREATE TABLE plantobservation ( |
|
700 |
plantobservation_id int(11) NOT NULL, |
|
701 |
datasource_id int(11) NOT NULL, |
|
702 |
sourceaccessioncode text, |
|
703 |
aggregateoccurrence_id int(11) NOT NULL, |
|
704 |
overallheight double precision, |
|
705 |
overallheightaccuracy double precision, |
|
706 |
collectionnumber text, |
|
707 |
stemcount int(11), |
|
708 |
plant_id int(11), |
|
709 |
accessioncode text |
|
710 |
); |
|
470 | 711 |
|
471 | 712 |
|
713 |
-- |
|
714 |
-- Name: TABLE plantobservation; Type: COMMENT; Schema: public; Owner: - |
|
715 |
-- |
|
472 | 716 |
|
717 |
|
|
718 |
|
|
719 |
|
|
473 | 720 |
-- |
474 |
-- Name: commusage_commusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
721 |
-- Name: COLUMN plantobservation.collectionnumber; Type: COMMENT; Schema: public; Owner: -
|
|
475 | 722 |
-- |
476 | 723 |
|
477 | 724 |
|
478 | 725 |
|
479 | 726 |
|
480 | 727 |
-- |
481 |
-- Name: coverindex; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
728 |
-- Name: specimenreplicate; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
482 | 729 |
-- |
483 | 730 |
|
484 |
CREATE TABLE coverindex ( |
|
485 |
coverindex_id int(11) NOT NULL, |
|
486 |
covermethod_id int(11) NOT NULL, |
|
487 |
covercode text NOT NULL, |
|
488 |
upperlimit double precision, |
|
489 |
lowerlimit double precision, |
|
490 |
coverpercent double precision NOT NULL, |
|
491 |
indexdescription text |
|
731 |
CREATE TABLE specimenreplicate ( |
|
732 |
specimenreplicate_id int(11) NOT NULL, |
|
733 |
datasource_id int(11) NOT NULL, |
|
734 |
sourceaccessioncode text, |
|
735 |
plantobservation_id int(11), |
|
736 |
institution_id int(11), |
|
737 |
collectioncode_dwc text, |
|
738 |
catalognumber_dwc text, |
|
739 |
description text, |
|
740 |
specimen_id int(11), |
|
741 |
accessioncode text |
|
492 | 742 |
); |
493 | 743 |
|
494 | 744 |
|
495 | 745 |
-- |
496 |
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
746 |
-- Name: TABLE specimenreplicate; Type: COMMENT; Schema: public; Owner: -
|
|
497 | 747 |
-- |
498 | 748 |
|
499 | 749 |
|
500 | 750 |
|
501 | 751 |
|
502 | 752 |
-- |
503 |
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
753 |
-- Name: COLUMN specimenreplicate.institution_id; Type: COMMENT; Schema: public; Owner: -
|
|
504 | 754 |
-- |
505 | 755 |
|
506 | 756 |
|
507 | 757 |
|
508 | 758 |
|
509 | 759 |
-- |
510 |
-- Name: covermethod; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
760 |
-- Name: COLUMN specimenreplicate.collectioncode_dwc; Type: COMMENT; Schema: public; Owner: -
|
|
511 | 761 |
-- |
512 | 762 |
|
513 |
CREATE TABLE covermethod ( |
|
514 |
covermethod_id int(11) NOT NULL, |
|
763 |
|
|
764 |
|
|
765 |
|
|
766 |
-- |
|
767 |
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
768 |
-- |
|
769 |
|
|
770 |
CREATE TABLE taxondetermination ( |
|
771 |
taxondetermination_id int(11) NOT NULL, |
|
772 |
taxonoccurrence_id int(11) NOT NULL, |
|
773 |
plantconcept_id int(11) NOT NULL, |
|
774 |
party_id int(11), |
|
775 |
role text DEFAULT 'unknown' NOT NULL, |
|
776 |
determinationtype text, |
|
515 | 777 |
reference_id int(11), |
516 |
covertype text NOT NULL, |
|
517 |
coverestimationmethod text, |
|
778 |
isoriginal int(1) DEFAULT false NOT NULL, |
|
779 |
iscurrent int(1) DEFAULT false NOT NULL, |
|
780 |
taxonfit text, |
|
781 |
taxonconfidence text, |
|
782 |
grouptype text, |
|
783 |
notes text, |
|
784 |
notespublic int(1), |
|
785 |
notesmgt int(1), |
|
786 |
revisions int(1), |
|
787 |
determinationdate timestamp NULL, |
|
518 | 788 |
accessioncode text |
519 | 789 |
); |
520 | 790 |
|
521 | 791 |
|
522 | 792 |
-- |
523 |
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
793 |
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
|
|
524 | 794 |
-- |
525 | 795 |
|
526 | 796 |
|
527 | 797 |
|
528 | 798 |
|
529 | 799 |
-- |
530 |
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
800 |
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
531 | 801 |
-- |
532 | 802 |
|
803 |
CREATE TABLE taxonoccurrence ( |
|
804 |
taxonoccurrence_id int(11) NOT NULL, |
|
805 |
datasource_id int(11) NOT NULL, |
|
806 |
sourceaccessioncode text, |
|
807 |
locationevent_id int(11), |
|
808 |
authortaxoncode text, |
|
809 |
verbatimcollectorname text, |
|
810 |
growthform text, |
|
811 |
iscultivated int(1), |
|
812 |
cultivatedbasis text, |
|
813 |
isnative int(1), |
|
814 |
accessioncode text |
|
815 |
); |
|
533 | 816 |
|
534 | 817 |
|
818 |
-- |
|
819 |
-- Name: TABLE taxonoccurrence; Type: COMMENT; Schema: public; Owner: - |
|
820 |
-- |
|
535 | 821 |
|
822 |
|
|
823 |
|
|
824 |
|
|
536 | 825 |
-- |
537 |
-- Name: dba_preassignacccode_dba_requestnumber_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
826 |
-- Name: COLUMN taxonoccurrence.iscultivated; Type: COMMENT; Schema: public; Owner: -
|
|
538 | 827 |
-- |
539 | 828 |
|
540 | 829 |
|
541 | 830 |
|
542 | 831 |
|
543 | 832 |
-- |
544 |
-- Name: definedvalue; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
833 |
-- Name: COLUMN taxonoccurrence.cultivatedbasis; Type: COMMENT; Schema: public; Owner: -
|
|
545 | 834 |
-- |
546 | 835 |
|
547 |
CREATE TABLE definedvalue ( |
|
548 |
definedvalue_id int(11) NOT NULL, |
|
549 |
userdefined_id int(11) NOT NULL, |
|
550 |
tablerecord_id int(11) NOT NULL, |
|
551 |
definedvalue text |
|
552 |
); |
|
553 | 836 |
|
554 | 837 |
|
838 |
|
|
555 | 839 |
-- |
556 |
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
840 |
-- Name: COLUMN taxonoccurrence.isnative; Type: COMMENT; Schema: public; Owner: -
|
|
557 | 841 |
-- |
558 | 842 |
|
559 | 843 |
|
560 | 844 |
|
561 | 845 |
|
562 | 846 |
-- |
563 |
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
847 |
-- Name: analytical_db_view; Type: VIEW; Schema: public; Owner: -
|
|
564 | 848 |
-- |
565 | 849 |
|
850 |
CREATE VIEW analytical_db_view AS |
|
851 |
SELECT datasource.organizationname AS `dataSourceName`, family.plantname AS family, genus.plantname AS genus, species.plantname AS species, binomial.plantname AS taxon, authority.plantname AS `taxonAuthor`, variety.plantname AS `taxonMorphospecies`, country.placename AS country, stateprovince.placename AS `stateProvince`, county.placename AS `countyParish`, taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS `collectionNumber`, array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], CAST(' ' AS text)) AS `identifiedBy`, aggregateoccurrence.collectiondate AS `observationDate`, location.authorlocationcode AS `plotCode`, location.area AS `plotAreaHa`, method.name AS `plotMethod`, locationdetermination.latitude, locationdetermination.longitude, location.elevation AS elevation_m, taxonoccurrence.iscultivated AS `isCultivated`, taxonoccurrence.cultivatedbasis AS `isCultivatedReason`, aggregateoccurrence.cover AS `pctCover` FROM (((((((((((((((((((((((((((((((((((((((((party datasource LEFT JOIN location ON ((location.datasource_id = datasource.party_id))) LEFT JOIN locationdetermination USING (location_id)) LEFT JOIN namedplace_ancestor continent_ancestor ON ((continent_ancestor.namedplace_id = locationdetermination.namedplace_id))) LEFT JOIN namedplace continent ON (((continent.namedplace_id = continent_ancestor.ancestor_id) AND (continent.rank = CAST('continent' AS placerank))))) LEFT JOIN namedplace_ancestor country_ancestor ON ((country_ancestor.namedplace_id = locationdetermination.namedplace_id))) LEFT JOIN namedplace country ON (((country.namedplace_id = country_ancestor.ancestor_id) AND (country.rank = CAST('country' AS placerank))))) LEFT JOIN namedplace_ancestor stateprovince_ancestor ON ((stateprovince_ancestor.namedplace_id = locationdetermination.namedplace_id))) LEFT JOIN namedplace stateprovince ON (((stateprovince.namedplace_id = stateprovince_ancestor.ancestor_id) AND (stateprovince.rank = CAST('stateProvince' AS placerank))))) LEFT JOIN namedplace_ancestor county_ancestor ON ((county_ancestor.namedplace_id = locationdetermination.namedplace_id))) LEFT JOIN namedplace county ON (((county.namedplace_id = county_ancestor.ancestor_id) AND (county.rank = CAST('county' AS placerank))))) LEFT JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) LEFT JOIN taxonoccurrence USING (locationevent_id)) LEFT JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) LEFT JOIN plantconcept USING (plantconcept_id)) LEFT JOIN plantname_ancestor binomial_ancestor ON ((binomial_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname binomial ON (((binomial.plantname_id = binomial_ancestor.ancestor_id) AND (binomial.rank = CAST('binomial' AS taxonrank))))) LEFT JOIN plantname_ancestor kingdom_ancestor ON ((kingdom_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname kingdom ON (((kingdom.plantname_id = kingdom_ancestor.ancestor_id) AND (kingdom.rank = CAST('kingdom' AS taxonrank))))) LEFT JOIN plantname_ancestor division_ancestor ON ((division_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname division ON (((division.plantname_id = division_ancestor.ancestor_id) AND (division.rank = CAST('division' AS taxonrank))))) LEFT JOIN plantname_ancestor class_ancestor ON ((class_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname class ON (((class.plantname_id = class_ancestor.ancestor_id) AND (class.rank = CAST('class' AS taxonrank))))) LEFT JOIN plantname_ancestor order_ancestor ON ((order_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname `order` ON (((`order`.plantname_id = order_ancestor.ancestor_id) AND (`order`.rank = CAST('order' AS taxonrank))))) LEFT JOIN plantname_ancestor family_ancestor ON ((family_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname family ON (((family.plantname_id = family_ancestor.ancestor_id) AND (family.rank = CAST('family' AS taxonrank))))) LEFT JOIN plantname_ancestor genus_ancestor ON ((genus_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname genus ON (((genus.plantname_id = genus_ancestor.ancestor_id) AND (genus.rank = CAST('genus' AS taxonrank))))) LEFT JOIN plantname_ancestor species_ancestor ON ((species_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname species ON (((species.plantname_id = species_ancestor.ancestor_id) AND (species.rank = CAST('species' AS taxonrank))))) LEFT JOIN plantname_ancestor subspecies_ancestor ON ((subspecies_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname subspecies ON (((subspecies.plantname_id = subspecies_ancestor.ancestor_id) AND (subspecies.rank = CAST('subspecies' AS taxonrank))))) LEFT JOIN plantname_ancestor authority_ancestor ON ((authority_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname authority ON (((authority.plantname_id = authority_ancestor.ancestor_id) AND (authority.rank = CAST('authority' AS taxonrank))))) LEFT JOIN plantname_ancestor variety_ancestor ON ((variety_ancestor.plantname_id = plantconcept.plantname_id))) LEFT JOIN plantname variety ON (((variety.plantname_id = variety_ancestor.ancestor_id) AND (variety.rank = CAST('variety' AS taxonrank))))) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id)) WHERE (datasource.organizationname IS NOT NULL); |
|
566 | 852 |
|
567 | 853 |
|
854 |
-- |
|
855 |
-- Name: VIEW analytical_db_view; Type: COMMENT; Schema: public; Owner: - |
|
856 |
-- |
|
568 | 857 |
|
858 |
|
|
859 |
|
|
860 |
|
|
569 | 861 |
-- |
570 |
-- Name: disturbanceobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
862 |
-- Name: classcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
571 | 863 |
-- |
572 | 864 |
|
573 |
CREATE TABLE disturbanceobs ( |
|
574 |
disturbanceobs_id int(11) NOT NULL, |
|
575 |
locationevent_id int(11) NOT NULL, |
|
576 |
disturbancetype text NOT NULL, |
|
577 |
disturbanceintensity text, |
|
578 |
disturbanceage double precision, |
|
579 |
disturbanceextent double precision, |
|
580 |
disturbancecomment text |
|
865 |
CREATE TABLE classcontributor ( |
|
866 |
classcontributor_id int(11) NOT NULL, |
|
867 |
commclass_id int(11) NOT NULL, |
|
868 |
party_id int(11) NOT NULL, |
|
869 |
role text |
|
581 | 870 |
); |
582 | 871 |
|
583 | 872 |
|
584 | 873 |
-- |
585 |
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
874 |
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
586 | 875 |
-- |
587 | 876 |
|
588 | 877 |
|
589 | 878 |
|
590 | 879 |
|
591 | 880 |
-- |
592 |
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
881 |
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
593 | 882 |
-- |
594 | 883 |
|
595 | 884 |
|
596 | 885 |
|
597 | 886 |
|
598 | 887 |
-- |
599 |
-- Name: graphic; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
888 |
-- Name: commclass; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
600 | 889 |
-- |
601 | 890 |
|
602 |
CREATE TABLE graphic (
|
|
603 |
graphic_id int(11) NOT NULL,
|
|
891 |
CREATE TABLE commclass (
|
|
892 |
commclass_id int(11) NOT NULL,
|
|
604 | 893 |
locationevent_id int(11) NOT NULL, |
605 |
graphicname text, |
|
606 |
graphiclocation text, |
|
607 |
graphicdescription text, |
|
608 |
graphictype text, |
|
609 |
graphicdata int(11), |
|
610 |
graphicdate timestamp NULL, |
|
894 |
inspection int(1), |
|
895 |
tableanalysis int(1), |
|
896 |
multivariateanalysis int(1), |
|
897 |
classpublication_id int(11), |
|
898 |
classnotes text, |
|
899 |
commname text, |
|
900 |
commcode text, |
|
901 |
commframework text, |
|
902 |
commlevel text, |
|
903 |
classstartdate timestamp NULL, |
|
904 |
classstopdate timestamp NULL, |
|
905 |
expertsystem text, |
|
611 | 906 |
accessioncode text |
612 | 907 |
); |
613 | 908 |
|
614 | 909 |
|
615 | 910 |
-- |
616 |
-- Name: graphic_graphic_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
911 |
-- Name: commclass_commclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
617 | 912 |
-- |
618 | 913 |
|
619 | 914 |
|
620 | 915 |
|
621 | 916 |
|
622 | 917 |
-- |
623 |
-- Name: graphic_graphic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
918 |
-- Name: commclass_commclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
624 | 919 |
-- |
625 | 920 |
|
626 | 921 |
|
627 | 922 |
|
628 | 923 |
|
629 | 924 |
-- |
630 |
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
925 |
-- Name: commconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
631 | 926 |
-- |
632 | 927 |
|
633 |
CREATE TABLE location ( |
|
634 |
location_id int(11) NOT NULL, |
|
635 |
datasource_id int(11) NOT NULL, |
|
636 |
sourceaccessioncode text, |
|
637 |
parent_id int(11), |
|
638 |
authorlocationcode text, |
|
639 |
centerlatitude double precision, |
|
640 |
centerlongitude double precision, |
|
641 |
locationaccuracy double precision, |
|
642 |
confidentialitystatus int(11) DEFAULT 0 NOT NULL, |
|
643 |
confidentialityreason text, |
|
644 |
publiclatitude double precision, |
|
645 |
publiclongitude double precision, |
|
646 |
sublocationxposition double precision, |
|
647 |
sublocationyposition double precision, |
|
648 |
authore text, |
|
649 |
authorn text, |
|
650 |
authorzone text, |
|
651 |
authordatum text, |
|
652 |
authorlocation text, |
|
653 |
locationnarrative text, |
|
654 |
azimuth double precision, |
|
655 |
shape text, |
|
656 |
area double precision, |
|
657 |
standsize text, |
|
658 |
placementmethod text, |
|
659 |
permanence int(1), |
|
660 |
layoutnarrative text, |
|
661 |
elevation double precision, |
|
662 |
elevationaccuracy double precision, |
|
663 |
elevationrange double precision, |
|
664 |
slopeaspect double precision, |
|
665 |
minslopeaspect double precision, |
|
666 |
maxslopeaspect double precision, |
|
667 |
slopegradient double precision, |
|
668 |
minslopegradient double precision, |
|
669 |
maxslopegradient double precision, |
|
670 |
topoposition text, |
|
671 |
landform text, |
|
672 |
surficialdeposits text, |
|
673 |
rocktype text, |
|
674 |
stateprovince text, |
|
675 |
country text, |
|
676 |
submitter_surname text, |
|
677 |
submitter_givenname text, |
|
678 |
submitter_email text, |
|
679 |
notespublic int(1), |
|
680 |
notesmgt int(1), |
|
681 |
revisions int(1), |
|
682 |
dateentered timestamp NULL , |
|
683 |
locationrationalenarrative text, |
|
928 |
CREATE TABLE commconcept ( |
|
929 |
commconcept_id int(11) NOT NULL, |
|
930 |
commname_id int(11) NOT NULL, |
|
931 |
reference_id int(11), |
|
932 |
commdescription text, |
|
933 |
d_obscount int(11), |
|
934 |
commname text, |
|
935 |
d_currentaccepted int(1), |
|
684 | 936 |
accessioncode text |
685 | 937 |
); |
686 | 938 |
|
687 | 939 |
|
688 | 940 |
-- |
689 |
-- Name: TABLE location; Type: COMMENT; Schema: public; Owner: -
|
|
941 |
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
690 | 942 |
-- |
691 | 943 |
|
692 | 944 |
|
693 | 945 |
|
694 | 946 |
|
695 | 947 |
-- |
696 |
-- Name: location_location_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
948 |
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
697 | 949 |
-- |
698 | 950 |
|
699 | 951 |
|
700 | 952 |
|
701 | 953 |
|
702 | 954 |
-- |
703 |
-- Name: location_location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
955 |
-- Name: commcorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
704 | 956 |
-- |
705 | 957 |
|
958 |
CREATE TABLE commcorrelation ( |
|
959 |
commcorrelation_id int(11) NOT NULL, |
|
960 |
commstatus_id int(11) NOT NULL, |
|
961 |
commconcept_id int(11) NOT NULL, |
|
962 |
commconvergence text NOT NULL, |
|
963 |
correlationstart timestamp NOT NULL, |
|
964 |
correlationstop timestamp NULL |
|
965 |
); |
|
706 | 966 |
|
707 | 967 |
|
968 |
-- |
|
969 |
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: - |
|
970 |
-- |
|
708 | 971 |
|
972 |
|
|
973 |
|
|
974 |
|
|
709 | 975 |
-- |
710 |
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
976 |
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
711 | 977 |
-- |
712 | 978 |
|
713 |
CREATE TABLE locationdetermination ( |
|
714 |
locationdetermination_id int(11) NOT NULL, |
|
715 |
location_id int(11) NOT NULL, |
|
716 |
latitude double precision, |
|
717 |
longitude double precision, |
|
718 |
verbatimlatitude text, |
|
719 |
verbatimlongitude text, |
|
720 |
verbatimcoordinates text, |
|
721 |
footprintgeometry_dwc text, |
|
722 |
coordsaccuracy double precision, |
|
723 |
namedplace_id int(11), |
|
724 |
identifier_id int(11), |
|
725 |
determinationdate timestamp NULL, |
|
726 |
isoriginal int(1) DEFAULT false NOT NULL, |
|
727 |
iscurrent int(1) DEFAULT false NOT NULL, |
|
728 |
calculated int(1) |
|
979 |
|
|
980 |
|
|
981 |
|
|
982 |
-- |
|
983 |
-- Name: commdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
984 |
-- |
|
985 |
|
|
986 |
CREATE TABLE commdetermination ( |
|
987 |
commdetermination_id int(11) NOT NULL, |
|
988 |
commclass_id int(11) NOT NULL, |
|
989 |
commconcept_id int(11) NOT NULL, |
|
990 |
commcode text, |
|
991 |
commname text, |
|
992 |
classfit text, |
|
993 |
classconfidence text, |
|
994 |
commauthority_id int(11), |
|
995 |
notes text, |
|
996 |
type int(1), |
|
997 |
nomenclaturaltype int(1) |
|
729 | 998 |
); |
730 | 999 |
|
731 | 1000 |
|
732 | 1001 |
-- |
733 |
-- Name: TABLE locationdetermination; Type: COMMENT; Schema: public; Owner: -
|
|
1002 |
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
734 | 1003 |
-- |
735 | 1004 |
|
736 | 1005 |
|
737 | 1006 |
|
738 | 1007 |
|
739 | 1008 |
-- |
740 |
-- Name: COLUMN locationdetermination.footprintgeometry_dwc; Type: COMMENT; Schema: public; Owner: -
|
|
1009 |
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
741 | 1010 |
-- |
742 | 1011 |
|
743 | 1012 |
|
744 | 1013 |
|
745 | 1014 |
|
746 | 1015 |
-- |
747 |
-- Name: COLUMN locationdetermination.coordsaccuracy; Type: COMMENT; Schema: public; Owner: -
|
|
1016 |
-- Name: commlineage; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
748 | 1017 |
-- |
749 | 1018 |
|
1019 |
CREATE TABLE commlineage ( |
|
1020 |
commlineage_id int(11) NOT NULL, |
|
1021 |
parentcommstatus_id int(11) NOT NULL, |
|
1022 |
childcommstatus_id int(11) NOT NULL |
|
1023 |
); |
|
750 | 1024 |
|
751 | 1025 |
|
752 |
|
|
753 | 1026 |
-- |
754 |
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1027 |
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
755 | 1028 |
-- |
756 | 1029 |
|
757 | 1030 |
|
758 | 1031 |
|
759 | 1032 |
|
760 | 1033 |
-- |
761 |
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1034 |
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
762 | 1035 |
-- |
763 | 1036 |
|
764 | 1037 |
|
765 | 1038 |
|
766 | 1039 |
|
767 | 1040 |
-- |
768 |
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1041 |
-- Name: commname; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
769 | 1042 |
-- |
770 | 1043 |
|
771 |
CREATE TABLE locationevent ( |
|
772 |
locationevent_id int(11) NOT NULL, |
|
773 |
datasource_id int(11) NOT NULL, |
|
774 |
sourceaccessioncode text, |
|
775 |
parent_id int(11), |
|
776 |
location_id int(11) NOT NULL, |
|
777 |
project_id int(11), |
|
778 |
authoreventcode text, |
|
779 |
previous_id int(11), |
|
780 |
dateaccuracy text, |
|
781 |
method_id int(11), |
|
782 |
temperature double precision, |
|
783 |
precipitation double precision, |
|
784 |
autotaxoncover int(1), |
|
785 |
originaldata text, |
|
786 |
effortlevel text, |
|
787 |
floristicquality text, |
|
788 |
bryophytequality text, |
|
789 |
lichenquality text, |
|
790 |
locationeventnarrative text, |
|
791 |
landscapenarrative text, |
|
792 |
homogeneity text, |
|
793 |
phenologicaspect text, |
|
794 |
representativeness text, |
|
795 |
standmaturity text, |
|
796 |
successionalstatus text, |
|
797 |
basalarea double precision, |
|
798 |
hydrologicregime text, |
|
799 |
soilmoistureregime text, |
|
800 |
soildrainage text, |
|
801 |
watersalinity text, |
|
802 |
waterdepth double precision, |
|
803 |
shoredistance double precision, |
|
804 |
soildepth double precision, |
|
805 |
organicdepth double precision, |
|
806 |
soiltaxon_id int(11), |
|
807 |
soiltaxonsrc text, |
|
808 |
percentbedrock double precision, |
|
809 |
percentrockgravel double precision, |
|
810 |
percentwood double precision, |
|
811 |
percentlitter double precision, |
|
812 |
percentbaresoil double precision, |
|
813 |
percentwater double precision, |
|
814 |
percentother double precision, |
|
815 |
nameother text, |
|
816 |
treeht double precision, |
|
817 |
shrubht double precision, |
|
818 |
fieldht double precision, |
|
819 |
nonvascularht double precision, |
|
820 |
submergedht double precision, |
|
821 |
treecover double precision, |
|
822 |
shrubcover double precision, |
|
823 |
fieldcover double precision, |
|
824 |
nonvascularcover double precision, |
|
825 |
floatingcover double precision, |
|
826 |
submergedcover double precision, |
|
827 |
dominantstratum text, |
|
828 |
growthform1type text, |
|
829 |
growthform2type text, |
|
830 |
growthform3type text, |
|
831 |
growthform1cover double precision, |
|
832 |
growthform2cover double precision, |
|
833 |
growthform3cover double precision, |
|
834 |
totalcover double precision, |
|
835 |
notespublic int(1), |
|
836 |
notesmgt int(1), |
|
837 |
revisions int(1), |
|
838 |
obsstartdate timestamp NULL, |
|
839 |
obsenddate timestamp NULL, |
|
840 |
dateentered timestamp NULL , |
|
841 |
toptaxon1name text, |
|
842 |
toptaxon2name text, |
|
843 |
toptaxon3name text, |
|
844 |
toptaxon4name text, |
|
845 |
toptaxon5name text, |
|
846 |
numberoftaxa int(11), |
|
847 |
accessioncode text |
|
1044 |
CREATE TABLE commname ( |
|
1045 |
commname_id int(11) NOT NULL, |
|
1046 |
commname text NOT NULL, |
|
1047 |
reference_id int(11), |
|
1048 |
dateentered timestamp NULL |
|
848 | 1049 |
); |
849 | 1050 |
|
850 | 1051 |
|
851 | 1052 |
-- |
852 |
-- Name: TABLE locationevent; Type: COMMENT; Schema: public; Owner: -
|
|
1053 |
-- Name: commname_commname_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
853 | 1054 |
-- |
854 | 1055 |
|
855 | 1056 |
|
856 | 1057 |
|
857 | 1058 |
|
858 | 1059 |
-- |
859 |
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1060 |
-- Name: commname_commname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
860 | 1061 |
-- |
861 | 1062 |
|
862 | 1063 |
|
863 | 1064 |
|
864 | 1065 |
|
865 | 1066 |
-- |
866 |
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1067 |
-- Name: commstatus; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
867 | 1068 |
-- |
868 | 1069 |
|
1070 |
CREATE TABLE commstatus ( |
|
1071 |
commstatus_id int(11) NOT NULL, |
|
1072 |
commconcept_id int(11) NOT NULL, |
|
1073 |
reference_id int(11), |
|
1074 |
commconceptstatus text NOT NULL, |
|
1075 |
commparent_id int(11), |
|
1076 |
commlevel text, |
|
1077 |
commpartycomments text, |
|
1078 |
party_id int(11) NOT NULL, |
|
1079 |
startdate timestamp NOT NULL, |
|
1080 |
stopdate timestamp NULL, |
|
1081 |
accessioncode text |
|
1082 |
); |
|
869 | 1083 |
|
870 | 1084 |
|
1085 |
-- |
|
1086 |
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: - |
|
1087 |
-- |
|
871 | 1088 |
|
1089 |
|
|
1090 |
|
|
1091 |
|
|
872 | 1092 |
-- |
873 |
-- Name: locationeventcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1093 |
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
874 | 1094 |
-- |
875 | 1095 |
|
876 |
CREATE TABLE locationeventcontributor ( |
|
877 |
locationeventcontributor_id int(11) NOT NULL, |
|
878 |
locationevent_id int(11) NOT NULL, |
|
879 |
party_id int(11) NOT NULL, |
|
880 |
role text NOT NULL, |
|
881 |
contributiondate timestamp NULL |
|
1096 |
|
|
1097 |
|
|
1098 |
|
|
1099 |
-- |
|
1100 |
-- Name: commusage; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1101 |
-- |
|
1102 |
|
|
1103 |
CREATE TABLE commusage ( |
|
1104 |
commusage_id int(11) NOT NULL, |
|
1105 |
commname_id int(11) NOT NULL, |
|
1106 |
commname text, |
|
1107 |
commconcept_id int(11), |
|
1108 |
commnamestatus text, |
|
1109 |
classsystem text, |
|
1110 |
party_id int(11), |
|
1111 |
commstatus_id int(11), |
|
1112 |
usagestart timestamp NULL, |
|
1113 |
usagestop timestamp NULL |
|
882 | 1114 |
); |
883 | 1115 |
|
884 | 1116 |
|
885 | 1117 |
-- |
886 |
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1118 |
-- Name: commusage_commusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
887 | 1119 |
-- |
888 | 1120 |
|
889 | 1121 |
|
890 | 1122 |
|
891 | 1123 |
|
892 | 1124 |
-- |
893 |
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1125 |
-- Name: commusage_commusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
894 | 1126 |
-- |
895 | 1127 |
|
896 | 1128 |
|
897 | 1129 |
|
898 | 1130 |
|
899 | 1131 |
-- |
900 |
-- Name: locationeventsynonym; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1132 |
-- Name: coverindex; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
901 | 1133 |
-- |
902 | 1134 |
|
903 |
CREATE TABLE locationeventsynonym ( |
|
904 |
locationeventsynonym_id int(11) NOT NULL, |
|
905 |
synonymlocationevent_id int(11) NOT NULL, |
|
906 |
primarylocationevent_id int(11) NOT NULL, |
|
907 |
party_id int(11) NOT NULL, |
|
908 |
role text NOT NULL, |
|
909 |
synonymcomment text, |
|
910 |
classstartdate timestamp NULL NOT NULL, |
|
911 |
classstopdate timestamp NULL, |
|
912 |
accessioncode text |
|
1135 |
CREATE TABLE coverindex ( |
|
1136 |
coverindex_id int(11) NOT NULL, |
|
1137 |
covermethod_id int(11) NOT NULL, |
|
1138 |
covercode text NOT NULL, |
|
1139 |
upperlimit double precision, |
|
1140 |
lowerlimit double precision, |
|
1141 |
coverpercent double precision NOT NULL, |
|
1142 |
indexdescription text |
|
913 | 1143 |
); |
914 | 1144 |
|
915 | 1145 |
|
916 | 1146 |
-- |
917 |
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1147 |
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
918 | 1148 |
-- |
919 | 1149 |
|
920 | 1150 |
|
921 | 1151 |
|
922 | 1152 |
|
923 | 1153 |
-- |
924 |
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1154 |
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
925 | 1155 |
-- |
926 | 1156 |
|
927 | 1157 |
|
928 | 1158 |
|
929 | 1159 |
|
930 | 1160 |
-- |
931 |
-- Name: method; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1161 |
-- Name: covermethod; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
932 | 1162 |
-- |
933 | 1163 |
|
934 |
CREATE TABLE method ( |
|
935 |
method_id int(11) NOT NULL, |
|
1164 |
CREATE TABLE covermethod (
|
|
1165 |
covermethod_id int(11) NOT NULL,
|
|
936 | 1166 |
reference_id int(11), |
937 |
name text NOT NULL, |
|
938 |
description text, |
|
939 |
diameterheight double precision, |
|
940 |
mindiameter double precision, |
|
941 |
maxdiameter double precision, |
|
942 |
minheight double precision, |
|
943 |
maxheight double precision, |
|
944 |
observationtype text, |
|
945 |
observationmeasure text, |
|
946 |
covermethod_id int(11), |
|
947 |
samplingfactor double precision DEFAULT 1 NOT NULL, |
|
948 |
coverbasis text, |
|
949 |
stemsamplemethod text, |
|
950 |
shape text, |
|
951 |
length double precision, |
|
952 |
width double precision, |
|
953 |
radius double precision, |
|
954 |
area double precision, |
|
955 |
samplearea double precision, |
|
956 |
subplotspacing double precision, |
|
957 |
subplotmethod_id int(11), |
|
958 |
pointsperline int(11), |
|
1167 |
covertype text NOT NULL, |
|
1168 |
coverestimationmethod text, |
|
959 | 1169 |
accessioncode text |
960 | 1170 |
); |
961 | 1171 |
|
962 | 1172 |
|
963 | 1173 |
-- |
964 |
-- Name: TABLE method; Type: COMMENT; Schema: public; Owner: -
|
|
1174 |
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
965 | 1175 |
-- |
966 | 1176 |
|
967 | 1177 |
|
968 | 1178 |
|
969 | 1179 |
|
970 | 1180 |
-- |
971 |
-- Name: COLUMN method.reference_id; Type: COMMENT; Schema: public; Owner: -
|
|
1181 |
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
972 | 1182 |
-- |
973 | 1183 |
|
974 | 1184 |
|
975 | 1185 |
|
976 | 1186 |
|
977 | 1187 |
-- |
978 |
-- Name: COLUMN method.name; Type: COMMENT; Schema: public; Owner: -
|
|
1188 |
-- Name: dba_preassignacccode_dba_requestnumber_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
979 | 1189 |
-- |
980 | 1190 |
|
981 | 1191 |
|
982 | 1192 |
|
983 | 1193 |
|
984 | 1194 |
-- |
985 |
-- Name: COLUMN method.description; Type: COMMENT; Schema: public; Owner: -
|
|
1195 |
-- Name: definedvalue; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
986 | 1196 |
-- |
987 | 1197 |
|
1198 |
CREATE TABLE definedvalue ( |
|
1199 |
definedvalue_id int(11) NOT NULL, |
|
1200 |
userdefined_id int(11) NOT NULL, |
|
1201 |
tablerecord_id int(11) NOT NULL, |
|
1202 |
definedvalue text |
|
1203 |
); |
|
988 | 1204 |
|
989 | 1205 |
|
990 |
|
|
991 | 1206 |
-- |
992 |
-- Name: COLUMN method.diameterheight; Type: COMMENT; Schema: public; Owner: -
|
|
1207 |
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
993 | 1208 |
-- |
994 | 1209 |
|
995 | 1210 |
|
996 | 1211 |
|
997 | 1212 |
|
998 | 1213 |
-- |
999 |
-- Name: COLUMN method.mindiameter; Type: COMMENT; Schema: public; Owner: -
|
|
1214 |
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1000 | 1215 |
-- |
1001 | 1216 |
|
1002 | 1217 |
|
1003 | 1218 |
|
1004 | 1219 |
|
1005 | 1220 |
-- |
1006 |
-- Name: COLUMN method.maxdiameter; Type: COMMENT; Schema: public; Owner: -
|
|
1221 |
-- Name: disturbanceobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1007 | 1222 |
-- |
1008 | 1223 |
|
1224 |
CREATE TABLE disturbanceobs ( |
|
1225 |
disturbanceobs_id int(11) NOT NULL, |
|
1226 |
locationevent_id int(11) NOT NULL, |
|
1227 |
disturbancetype text NOT NULL, |
|
1228 |
disturbanceintensity text, |
|
1229 |
disturbanceage double precision, |
|
1230 |
disturbanceextent double precision, |
|
1231 |
disturbancecomment text |
|
1232 |
); |
|
1009 | 1233 |
|
1010 | 1234 |
|
1011 |
|
|
1012 | 1235 |
-- |
1013 |
-- Name: COLUMN method.minheight; Type: COMMENT; Schema: public; Owner: -
|
|
1236 |
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1014 | 1237 |
-- |
1015 | 1238 |
|
1016 | 1239 |
|
1017 | 1240 |
|
1018 | 1241 |
|
1019 | 1242 |
-- |
1020 |
-- Name: COLUMN method.maxheight; Type: COMMENT; Schema: public; Owner: -
|
|
1243 |
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
1021 | 1244 |
-- |
1022 | 1245 |
|
1023 | 1246 |
|
1024 | 1247 |
|
1025 | 1248 |
|
1026 | 1249 |
-- |
1027 |
-- Name: COLUMN method.observationtype; Type: COMMENT; Schema: public; Owner: -
|
|
1250 |
-- Name: graphic; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1028 | 1251 |
-- |
1029 | 1252 |
|
1253 |
CREATE TABLE graphic ( |
|
1254 |
graphic_id int(11) NOT NULL, |
|
1255 |
locationevent_id int(11) NOT NULL, |
|
1256 |
graphicname text, |
|
1257 |
graphiclocation text, |
|
1258 |
graphicdescription text, |
|
1259 |
graphictype text, |
|
1260 |
graphicdata int(11), |
|
1261 |
graphicdate timestamp NULL, |
|
1262 |
accessioncode text |
|
1263 |
); |
|
1030 | 1264 |
|
1031 | 1265 |
|
1032 |
|
|
1033 | 1266 |
-- |
1034 |
-- Name: COLUMN method.observationmeasure; Type: COMMENT; Schema: public; Owner: -
|
|
1267 |
-- Name: graphic_graphic_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
1035 | 1268 |
-- |
1036 | 1269 |
|
1037 | 1270 |
|
1038 | 1271 |
|
1039 | 1272 |
|
1040 | 1273 |
-- |
1041 |
-- Name: COLUMN method.samplingfactor; Type: COMMENT; Schema: public; Owner: - |
Also available in: Unified diff
schemas/vegbien.sql: Added make_analytical_db() and helper view analytical_db_view. Note that adding a view which depends on other tables will cause those tables to be reordered in dependency order to appear before the view, causing the svn diff to change completely even though the DB structure has only been added to.