Project

General

Profile

1 689 aaronmk
--
2
-- PostgreSQL database dump
3
--
4
5
6
7
8
9
10
11
12
13
14
--
15 1431 aaronmk
-- Name: establishmentmeans_dwc; Type: TYPE; Schema: public; Owner: -
16
--
17
18
19
20
21
--
22
-- Name: TYPE establishmentmeans_dwc; Type: COMMENT; Schema: public; Owner: -
23
--
24
25
26
27
28
--
29
-- Name: growthform; Type: TYPE; Schema: public; Owner: -
30
--
31
32
33
34
35
--
36 712 aaronmk
-- Name: occurrencestatus_dwc; Type: TYPE; Schema: public; Owner: -
37
--
38
39
40
41 713 aaronmk
42 712 aaronmk
--
43 1313 aaronmk
-- Name: placerank; Type: TYPE; Schema: public; Owner: -
44
--
45
46
47
48
49
--
50
-- Name: TYPE placerank; Type: COMMENT; Schema: public; Owner: -
51
--
52
53
54
55
56
--
57 4954 aaronmk
-- Name: rankedplacename; Type: TYPE; Schema: public; Owner: -
58
--
59
60
61
62
63
--
64 4933 aaronmk
-- Name: taxonrank; Type: TYPE; Schema: public; Owner: -
65 1337 aaronmk
--
66
67
68
69
70
--
71 4933 aaronmk
-- Name: TYPE taxonrank; Type: COMMENT; Schema: public; Owner: -
72 1174 aaronmk
--
73
74
75
76
77
--
78 4933 aaronmk
-- Name: rankedtaxonname; Type: TYPE; Schema: public; Owner: -
79 1431 aaronmk
--
80
81
82
83
84
--
85 4933 aaronmk
-- Name: role; Type: TYPE; Schema: public; Owner: -
86 1111 aaronmk
--
87
88
89
90
91
--
92 4933 aaronmk
-- Name: taxonclass; Type: TYPE; Schema: public; Owner: -
93 4532 aaronmk
--
94
95
96
97
98
--
99 4933 aaronmk
-- Name: TYPE taxonclass; Type: COMMENT; Schema: public; Owner: -
100
--
101
102
103
104
105
--
106 5475 aaronmk
-- Name: _fraction_to_percent(double precision); Type: FUNCTION; Schema: public; Owner: -
107
--
108
109
110
111
112
--
113 5509 aaronmk
-- Name: _taxonconcept_set_matched_concept_id(int(11), int(11), double precision); Type: FUNCTION; Schema: public; Owner: -
114 4391 aaronmk
--
115
116
117
118
119
--
120 5510 aaronmk
-- Name: _taxonconcept_set_parent_id(int(11), int(11)); Type: FUNCTION; Schema: public; Owner: -
121
--
122
123
124
125
126
--
127 5189 aaronmk
-- Name: make_analytical_db(); Type: FUNCTION; Schema: public; Owner: -
128 704 aaronmk
--
129
130
131
132 705 aaronmk
133 704 aaronmk
--
134 5242 aaronmk
-- Name: party_creator_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
135 5234 aaronmk
--
136
137
138
139
140
--
141 5189 aaronmk
-- Name: place_update_ancestors(); Type: FUNCTION; Schema: public; Owner: -
142 5032 aaronmk
--
143
144
145
146
147
--
148 5465 aaronmk
-- Name: placepath_matched_placepath_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
149 1555 aaronmk
--
150
151
152
153
154
--
155 5189 aaronmk
-- Name: plantobservation_aggregateoccurrence_count_1(); Type: FUNCTION; Schema: public; Owner: -
156 5188 aaronmk
--
157
158
159
160
161
--
162 5465 aaronmk
-- Name: taxonconcept_0_matched_concept_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
163 5032 aaronmk
--
164
165
166
167
168
--
169 5465 aaronmk
-- Name: taxonconcept_1_matched_concept_min_fit(); Type: FUNCTION; Schema: public; Owner: -
170 5412 aaronmk
--
171
172
173
174
175
--
176 5473 aaronmk
-- Name: taxonconcept_2_propagate_accepted_concept_id(); Type: FUNCTION; Schema: public; Owner: -
177
--
178
179
180
181
182
--
183 5274 aaronmk
-- Name: taxonconcept_update_ancestors(); Type: FUNCTION; Schema: public; Owner: -
184
--
185
186
187
188
189
--
190 689 aaronmk
-- Name: concat(text); Type: AGGREGATE; Schema: public; Owner: -
191
--
192
193
194
195
196
197
198
199
200
--
201
-- Name: address; Type: TABLE; Schema: public; Owner: -; Tablespace:
202
--
203
204
CREATE TABLE address (
205
    address_id int(11) NOT NULL,
206
    party_id int(11) NOT NULL,
207
    organization_id int(11),
208 841 aaronmk
    orgposition text,
209
    email text,
210
    deliverypoint text,
211
    city text,
212
    administrativearea text,
213
    postalcode text,
214
    country text,
215 689 aaronmk
    currentflag int(1),
216 5499 aaronmk
    addressstartdate date
217 689 aaronmk
);
218
219
220
--
221
-- Name: address_address_id_seq; Type: SEQUENCE; Schema: public; Owner: -
222
--
223
224
225
226
227
--
228
-- Name: address_address_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
229
--
230
231
232
233
234
--
235
-- Name: aggregateoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace:
236
--
237
238
CREATE TABLE aggregateoccurrence (
239
    aggregateoccurrence_id int(11) NOT NULL,
240 5242 aaronmk
    creator_id int(11) NOT NULL,
241 3615 aaronmk
    sourceaccessioncode text,
242 689 aaronmk
    taxonoccurrence_id int(11) NOT NULL,
243 5499 aaronmk
    collectiondate date,
244 4787 aaronmk
    cover_fraction double precision,
245 4754 aaronmk
    linecover_m double precision,
246
    basalarea_m2 double precision,
247
    biomass_kg_m2 double precision,
248
    inferencearea_m2 double precision,
249 689 aaronmk
    count int(11),
250
    stratum_id int(11),
251 712 aaronmk
    coverindex_id int(11),
252 1231 aaronmk
    occurrencestatus_dwc text DEFAULT 'present' NOT NULL,
253 1166 aaronmk
    method_id int(11),
254 3911 aaronmk
    notes text,
255 1434 aaronmk
    accessioncode text
256 689 aaronmk
);
257
258
259
--
260
-- Name: TABLE aggregateoccurrence; Type: COMMENT; Schema: public; Owner: -
261
--
262
263
264
265
266
--
267 4754 aaronmk
-- Name: COLUMN aggregateoccurrence.linecover_m; Type: COMMENT; Schema: public; Owner: -
268 712 aaronmk
--
269
270
271
272
273
--
274 3910 aaronmk
-- Name: COLUMN aggregateoccurrence.occurrencestatus_dwc; Type: COMMENT; Schema: public; Owner: -
275 1166 aaronmk
--
276
277
278
279
280
--
281 689 aaronmk
-- Name: aggregateoccurrence_aggregateoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
282
--
283
284
285
286
287
--
288
-- Name: aggregateoccurrence_aggregateoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
289
--
290
291
292
293
294
--
295 4391 aaronmk
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace:
296 689 aaronmk
--
297
298 4391 aaronmk
CREATE TABLE location (
299
    location_id int(11) NOT NULL,
300 5242 aaronmk
    creator_id int(11) NOT NULL,
301 4391 aaronmk
    sourceaccessioncode text,
302
    parent_id int(11),
303
    authorlocationcode text,
304
    confidentialitystatus int(11) DEFAULT 0 NOT NULL,
305
    confidentialityreason text,
306 4753 aaronmk
    sublocationxposition_m double precision,
307
    sublocationyposition_m double precision,
308 4391 aaronmk
    authorzone text,
309
    authordatum text,
310
    authorlocation text,
311
    locationnarrative text,
312
    azimuth double precision,
313
    shape text,
314 4753 aaronmk
    area_m2 double precision,
315 4391 aaronmk
    standsize text,
316
    placementmethod text,
317
    permanence int(1),
318
    layoutnarrative text,
319 4753 aaronmk
    elevation_m double precision,
320
    elevationaccuracy_m double precision,
321
    elevationrange_m double precision,
322 4794 aaronmk
    verbatimelevation text,
323 4753 aaronmk
    slopeaspect_deg double precision,
324
    minslopeaspect_deg double precision,
325
    maxslopeaspect_deg double precision,
326 4787 aaronmk
    slopegradient_fraction double precision,
327
    minslopegradient_fraction double precision,
328
    maxslopegradient_fraction double precision,
329 4391 aaronmk
    topoposition text,
330
    landform text,
331
    surficialdeposits text,
332
    rocktype text,
333
    submitter_surname text,
334
    submitter_givenname text,
335
    submitter_email text,
336
    notespublic int(1),
337
    notesmgt int(1),
338
    revisions int(1),
339 5499 aaronmk
    dateentered date ,
340 4391 aaronmk
    locationrationalenarrative text,
341
    accessioncode text
342 689 aaronmk
);
343
344
345
--
346 4391 aaronmk
-- Name: TABLE location; Type: COMMENT; Schema: public; Owner: -
347 689 aaronmk
--
348
349
350
351
352
--
353 4726 aaronmk
-- Name: locationcoords; Type: TABLE; Schema: public; Owner: -; Tablespace:
354 689 aaronmk
--
355
356 4726 aaronmk
CREATE TABLE locationcoords (
357
    locationcoords_id int(11) NOT NULL,
358 4391 aaronmk
    location_id int(11) NOT NULL,
359 4753 aaronmk
    latitude_deg double precision,
360
    longitude_deg double precision,
361 4391 aaronmk
    verbatimlatitude text,
362
    verbatimlongitude text,
363
    verbatimcoordinates text,
364
    footprintgeometry_dwc text,
365 4753 aaronmk
    coordsaccuracy_deg double precision,
366 4391 aaronmk
    identifier_id int(11),
367 5499 aaronmk
    determinationdate date,
368 4391 aaronmk
    isoriginal int(1) DEFAULT false NOT NULL,
369
    iscurrent int(1) DEFAULT false NOT NULL,
370
    calculated int(1)
371
);
372 689 aaronmk
373
374 4391 aaronmk
--
375 4726 aaronmk
-- Name: COLUMN locationcoords.footprintgeometry_dwc; Type: COMMENT; Schema: public; Owner: -
376 4391 aaronmk
--
377 689 aaronmk
378 4391 aaronmk
379
380
381 689 aaronmk
--
382 4753 aaronmk
-- Name: COLUMN locationcoords.coordsaccuracy_deg; Type: COMMENT; Schema: public; Owner: -
383 689 aaronmk
--
384
385
386
387 4391 aaronmk
388 689 aaronmk
--
389 4391 aaronmk
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace:
390 689 aaronmk
--
391
392 4391 aaronmk
CREATE TABLE locationevent (
393
    locationevent_id int(11) NOT NULL,
394 5242 aaronmk
    creator_id int(11) NOT NULL,
395 4391 aaronmk
    sourceaccessioncode text,
396
    parent_id int(11),
397 4462 aaronmk
    location_id int(11),
398 4391 aaronmk
    project_id int(11),
399
    authoreventcode text,
400
    previous_id int(11),
401 5506 aaronmk
    obsstartdate date,
402
    obsenddate date,
403 4391 aaronmk
    dateaccuracy text,
404
    method_id int(11),
405 4753 aaronmk
    temperature_c double precision,
406
    precipitation_m double precision,
407 4391 aaronmk
    autotaxoncover int(1),
408
    originaldata text,
409
    effortlevel text,
410
    floristicquality text,
411
    bryophytequality text,
412
    lichenquality text,
413
    locationeventnarrative text,
414
    landscapenarrative text,
415
    homogeneity text,
416
    phenologicaspect text,
417
    representativeness text,
418
    standmaturity text,
419
    successionalstatus text,
420
    basalarea double precision,
421
    hydrologicregime text,
422
    soilmoistureregime text,
423
    soildrainage text,
424
    watersalinity text,
425 4753 aaronmk
    waterdepth_m double precision,
426 4391 aaronmk
    shoredistance double precision,
427
    soildepth double precision,
428
    organicdepth double precision,
429
    soiltaxon_id int(11),
430
    soiltaxonsrc text,
431
    percentbedrock double precision,
432
    percentrockgravel double precision,
433
    percentwood double precision,
434
    percentlitter double precision,
435
    percentbaresoil double precision,
436
    percentwater double precision,
437
    percentother double precision,
438
    nameother text,
439
    treeht double precision,
440
    shrubht double precision,
441
    fieldht double precision,
442
    nonvascularht double precision,
443
    submergedht double precision,
444
    treecover double precision,
445
    shrubcover double precision,
446
    fieldcover double precision,
447
    nonvascularcover double precision,
448
    floatingcover double precision,
449
    submergedcover double precision,
450
    dominantstratum text,
451
    growthform1type text,
452
    growthform2type text,
453
    growthform3type text,
454
    growthform1cover double precision,
455
    growthform2cover double precision,
456
    growthform3cover double precision,
457
    totalcover double precision,
458
    notespublic int(1),
459
    notesmgt int(1),
460
    revisions int(1),
461 5499 aaronmk
    dateentered date ,
462 4391 aaronmk
    toptaxon1name text,
463
    toptaxon2name text,
464
    toptaxon3name text,
465
    toptaxon4name text,
466
    toptaxon5name text,
467
    numberoftaxa int(11),
468
    accessioncode text
469
);
470 689 aaronmk
471
472 4391 aaronmk
--
473
-- Name: TABLE locationevent; Type: COMMENT; Schema: public; Owner: -
474
--
475 689 aaronmk
476 4391 aaronmk
477
478
479 689 aaronmk
--
480 4726 aaronmk
-- Name: locationplace; Type: TABLE; Schema: public; Owner: -; Tablespace:
481
--
482
483
CREATE TABLE locationplace (
484
    locationplace_id int(11) NOT NULL,
485
    location_id int(11) NOT NULL,
486 4734 aaronmk
    placepath_id int(11) NOT NULL,
487
    identifier_id int(11)
488 4726 aaronmk
);
489
490
491
--
492
-- Name: TABLE locationplace; Type: COMMENT; Schema: public; Owner: -
493
--
494
495
496
497
498
--
499 4391 aaronmk
-- Name: method; Type: TABLE; Schema: public; Owner: -; Tablespace:
500 689 aaronmk
--
501
502 4391 aaronmk
CREATE TABLE method (
503
    method_id int(11) NOT NULL,
504 689 aaronmk
    reference_id int(11),
505 4391 aaronmk
    name text NOT NULL,
506
    description text,
507 4754 aaronmk
    diameterheight_m double precision,
508
    mindiameter_m double precision,
509
    maxdiameter_m double precision,
510
    minheight_m double precision,
511
    maxheight_m double precision,
512 4391 aaronmk
    observationtype text,
513
    observationmeasure text,
514
    covermethod_id int(11),
515
    samplingfactor double precision DEFAULT 1 NOT NULL,
516
    coverbasis text,
517
    stemsamplemethod text,
518
    shape text,
519 4754 aaronmk
    length_m double precision,
520
    width_m double precision,
521
    radius_m double precision,
522
    area_m2 double precision,
523
    samplearea_m2 double precision,
524
    subplotspacing_m double precision,
525 4391 aaronmk
    subplotmethod_id int(11),
526
    pointsperline int(11),
527 841 aaronmk
    accessioncode text
528 689 aaronmk
);
529
530
531
--
532 4391 aaronmk
-- Name: TABLE method; Type: COMMENT; Schema: public; Owner: -
533 689 aaronmk
--
534
535
536
537
538
--
539 4391 aaronmk
-- Name: COLUMN method.reference_id; Type: COMMENT; Schema: public; Owner: -
540 689 aaronmk
--
541
542
543
544
545
--
546 4391 aaronmk
-- Name: COLUMN method.name; Type: COMMENT; Schema: public; Owner: -
547 689 aaronmk
--
548
549
550
551 4391 aaronmk
552 689 aaronmk
--
553 4391 aaronmk
-- Name: COLUMN method.description; Type: COMMENT; Schema: public; Owner: -
554 689 aaronmk
--
555
556
557
558
559
--
560 4754 aaronmk
-- Name: COLUMN method.diameterheight_m; Type: COMMENT; Schema: public; Owner: -
561 689 aaronmk
--
562
563
564
565
566
--
567 4754 aaronmk
-- Name: COLUMN method.mindiameter_m; Type: COMMENT; Schema: public; Owner: -
568 689 aaronmk
--
569
570
571
572 4391 aaronmk
573 689 aaronmk
--
574 4754 aaronmk
-- Name: COLUMN method.maxdiameter_m; Type: COMMENT; Schema: public; Owner: -
575 689 aaronmk
--
576
577
578
579
580
--
581 4754 aaronmk
-- Name: COLUMN method.minheight_m; Type: COMMENT; Schema: public; Owner: -
582 689 aaronmk
--
583
584
585
586
587
--
588 4754 aaronmk
-- Name: COLUMN method.maxheight_m; Type: COMMENT; Schema: public; Owner: -
589 689 aaronmk
--
590
591
592
593 4391 aaronmk
594 689 aaronmk
--
595 4391 aaronmk
-- Name: COLUMN method.observationtype; Type: COMMENT; Schema: public; Owner: -
596 689 aaronmk
--
597
598
599
600
601
--
602 4391 aaronmk
-- Name: COLUMN method.observationmeasure; Type: COMMENT; Schema: public; Owner: -
603 689 aaronmk
--
604
605
606
607
608
--
609 4391 aaronmk
-- Name: COLUMN method.samplingfactor; Type: COMMENT; Schema: public; Owner: -
610 689 aaronmk
--
611
612
613
614 4391 aaronmk
615 689 aaronmk
--
616 4391 aaronmk
-- Name: COLUMN method.coverbasis; Type: COMMENT; Schema: public; Owner: -
617 689 aaronmk
--
618
619
620
621
622
--
623 4391 aaronmk
-- Name: COLUMN method.stemsamplemethod; Type: COMMENT; Schema: public; Owner: -
624 689 aaronmk
--
625
626
627
628
629
--
630 4391 aaronmk
-- Name: COLUMN method.shape; Type: COMMENT; Schema: public; Owner: -
631 689 aaronmk
--
632
633 4391 aaronmk
634
635
636
--
637 4754 aaronmk
-- Name: COLUMN method.samplearea_m2; Type: COMMENT; Schema: public; Owner: -
638 4391 aaronmk
--
639
640
641
642
643
--
644 4754 aaronmk
-- Name: COLUMN method.subplotspacing_m; Type: COMMENT; Schema: public; Owner: -
645 4391 aaronmk
--
646
647
648
649
650
--
651
-- Name: COLUMN method.subplotmethod_id; Type: COMMENT; Schema: public; Owner: -
652
--
653
654
655
656
657
--
658
-- Name: COLUMN method.pointsperline; Type: COMMENT; Schema: public; Owner: -
659
--
660
661
662
663
664
--
665 4730 aaronmk
-- Name: party; Type: TABLE; Schema: public; Owner: -; Tablespace:
666 4391 aaronmk
--
667
668 4730 aaronmk
CREATE TABLE party (
669
    party_id int(11) NOT NULL,
670 5242 aaronmk
    creator_id int(11) NOT NULL,
671 4730 aaronmk
    salutation text,
672
    givenname text,
673
    middlename text,
674
    surname text,
675
    organizationname text,
676
    currentname_id int(11),
677
    contactinstructions text,
678
    email text,
679
    partytype text,
680
    partypublic int(1) DEFAULT true,
681
    d_obscount int(11),
682
    accessioncode text
683
);
684
685
686
--
687 5242 aaronmk
-- Name: COLUMN party.creator_id; Type: COMMENT; Schema: public; Owner: -
688 5234 aaronmk
--
689
690
691
692
693
--
694 4739 aaronmk
-- Name: placepath; Type: TABLE; Schema: public; Owner: -; Tablespace:
695 4730 aaronmk
--
696
697 4739 aaronmk
CREATE TABLE placepath (
698
    placepath_id int(11) NOT NULL,
699 5242 aaronmk
    creator_id int(11) NOT NULL,
700 4391 aaronmk
    placecode text,
701 5465 aaronmk
    matched_placepath_id int(11),
702 4739 aaronmk
    place_id int(11),
703
    continent text,
704
    country text,
705
    stateprovince text,
706
    county text,
707
    municipality text,
708 4954 aaronmk
    site text,
709
    otherranks text
710 689 aaronmk
);
711
712
713
--
714 4739 aaronmk
-- Name: TABLE placepath; Type: COMMENT; Schema: public; Owner: -
715 689 aaronmk
--
716
717
718
719 4730 aaronmk
720 4391 aaronmk
--
721 5465 aaronmk
-- Name: COLUMN placepath.matched_placepath_id; Type: COMMENT; Schema: public; Owner: -
722 4970 aaronmk
--
723
724
725
726
727
--
728 4954 aaronmk
-- Name: COLUMN placepath.otherranks; Type: COMMENT; Schema: public; Owner: -
729
--
730
731
732
733
734
--
735 4391 aaronmk
-- Name: plantobservation; Type: TABLE; Schema: public; Owner: -; Tablespace:
736 689 aaronmk
--
737
738 4391 aaronmk
CREATE TABLE plantobservation (
739
    plantobservation_id int(11) NOT NULL,
740 5242 aaronmk
    creator_id int(11) NOT NULL,
741 4391 aaronmk
    sourceaccessioncode text,
742
    aggregateoccurrence_id int(11) NOT NULL,
743 4753 aaronmk
    overallheight_m double precision,
744
    overallheightaccuracy_m double precision,
745 4391 aaronmk
    collectionnumber text,
746
    stemcount int(11),
747
    plant_id int(11),
748
    accessioncode text
749
);
750 689 aaronmk
751
752 4391 aaronmk
--
753
-- Name: TABLE plantobservation; Type: COMMENT; Schema: public; Owner: -
754
--
755 689 aaronmk
756 4391 aaronmk
757
758
759 689 aaronmk
--
760 4391 aaronmk
-- Name: COLUMN plantobservation.collectionnumber; Type: COMMENT; Schema: public; Owner: -
761 689 aaronmk
--
762
763
764
765
766
--
767 4391 aaronmk
-- Name: specimenreplicate; Type: TABLE; Schema: public; Owner: -; Tablespace:
768 689 aaronmk
--
769
770 4391 aaronmk
CREATE TABLE specimenreplicate (
771
    specimenreplicate_id int(11) NOT NULL,
772 5242 aaronmk
    creator_id int(11) NOT NULL,
773 4391 aaronmk
    sourceaccessioncode text,
774
    plantobservation_id int(11),
775
    institution_id int(11),
776
    collectioncode_dwc text,
777
    catalognumber_dwc text,
778
    description text,
779
    specimen_id int(11),
780
    accessioncode text
781 689 aaronmk
);
782
783
784
--
785 4391 aaronmk
-- Name: TABLE specimenreplicate; Type: COMMENT; Schema: public; Owner: -
786 689 aaronmk
--
787
788
789
790
791
--
792 4391 aaronmk
-- Name: COLUMN specimenreplicate.institution_id; Type: COMMENT; Schema: public; Owner: -
793 689 aaronmk
--
794
795
796
797
798
--
799 4391 aaronmk
-- Name: COLUMN specimenreplicate.collectioncode_dwc; Type: COMMENT; Schema: public; Owner: -
800 689 aaronmk
--
801
802 4391 aaronmk
803
804
805
--
806 5225 aaronmk
-- Name: taxonconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
807 4391 aaronmk
--
808
809 5225 aaronmk
CREATE TABLE taxonconcept (
810
    taxonconcept_id int(11) NOT NULL,
811 5242 aaronmk
    creator_id int(11) NOT NULL,
812 5469 aaronmk
    sourceaccessioncode text,
813 5499 aaronmk
    creationdate date,
814 5464 aaronmk
    accepted_concept_id int(11),
815 5465 aaronmk
    matched_concept_id int(11),
816
    matched_concept_fit_fraction double precision,
817 5267 aaronmk
    parent_id int(11),
818 5262 aaronmk
    taxonname text,
819 5251 aaronmk
    rank text,
820
    verbatimrank text,
821 5309 aaronmk
    identifyingtaxonomicname text,
822 5225 aaronmk
    taxonomicname text,
823
    author text,
824
    taxonomicnamewithauthor text,
825
    family text,
826
    genus text,
827
    species text,
828 5273 aaronmk
    description text,
829 841 aaronmk
    accessioncode text
830 689 aaronmk
);
831
832
833
--
834 5225 aaronmk
-- Name: TABLE taxonconcept; Type: COMMENT; Schema: public; Owner: -
835 689 aaronmk
--
836
837
838
839
840
--
841 5241 aaronmk
-- Name: COLUMN taxonconcept.creator_id; Type: COMMENT; Schema: public; Owner: -
842 5232 aaronmk
--
843
844
845
846
847
--
848 5472 aaronmk
-- Name: COLUMN taxonconcept.sourceaccessioncode; Type: COMMENT; Schema: public; Owner: -
849
--
850
851
852
853
854
--
855 5312 aaronmk
-- Name: COLUMN taxonconcept.creationdate; Type: COMMENT; Schema: public; Owner: -
856
--
857
858
859
860
861
--
862 5471 aaronmk
-- Name: COLUMN taxonconcept.accepted_concept_id; Type: COMMENT; Schema: public; Owner: -
863
--
864
865
866
867
868
--
869 5465 aaronmk
-- Name: COLUMN taxonconcept.matched_concept_id; Type: COMMENT; Schema: public; Owner: -
870 689 aaronmk
--
871
872
873
874 5225 aaronmk
875 4391 aaronmk
--
876 5465 aaronmk
-- Name: COLUMN taxonconcept.matched_concept_fit_fraction; Type: COMMENT; Schema: public; Owner: -
877 5400 aaronmk
--
878
879
880
881
882
--
883 5309 aaronmk
-- Name: COLUMN taxonconcept.parent_id; Type: COMMENT; Schema: public; Owner: -
884 4391 aaronmk
--
885 689 aaronmk
886 4391 aaronmk
887
888
889 689 aaronmk
--
890 5309 aaronmk
-- Name: COLUMN taxonconcept.taxonname; Type: COMMENT; Schema: public; Owner: -
891 5267 aaronmk
--
892
893
894
895
896
--
897 5309 aaronmk
-- Name: COLUMN taxonconcept.rank; Type: COMMENT; Schema: public; Owner: -
898 5262 aaronmk
--
899
900
901
902
903
--
904 5309 aaronmk
-- Name: COLUMN taxonconcept.verbatimrank; Type: COMMENT; Schema: public; Owner: -
905 5276 aaronmk
--
906
907
908
909
910
--
911 5309 aaronmk
-- Name: COLUMN taxonconcept.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
912 5276 aaronmk
--
913
914
915
916
917
--
918 5225 aaronmk
-- Name: COLUMN taxonconcept.taxonomicname; Type: COMMENT; Schema: public; Owner: -
919 689 aaronmk
--
920
921
922
923 4391 aaronmk
924 689 aaronmk
--
925 5225 aaronmk
-- Name: COLUMN taxonconcept.author; Type: COMMENT; Schema: public; Owner: -
926 689 aaronmk
--
927
928
929
930
931
--
932 5225 aaronmk
-- Name: COLUMN taxonconcept.taxonomicnamewithauthor; Type: COMMENT; Schema: public; Owner: -
933 4718 aaronmk
--
934
935
936
937 5225 aaronmk
938 4718 aaronmk
--
939 5225 aaronmk
-- Name: COLUMN taxonconcept.family; Type: COMMENT; Schema: public; Owner: -
940 4944 aaronmk
--
941
942
943
944 5328 aaronmk
945 4944 aaronmk
--
946 5225 aaronmk
-- Name: COLUMN taxonconcept.genus; Type: COMMENT; Schema: public; Owner: -
947 4721 aaronmk
--
948
949
950
951 5328 aaronmk
952 4721 aaronmk
--
953 5225 aaronmk
-- Name: COLUMN taxonconcept.species; Type: COMMENT; Schema: public; Owner: -
954 4964 aaronmk
--
955
956
957
958 5328 aaronmk
959 4964 aaronmk
--
960 5225 aaronmk
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
961 4964 aaronmk
--
962
963 5225 aaronmk
CREATE TABLE taxondetermination (
964
    taxondetermination_id int(11) NOT NULL,
965
    taxonoccurrence_id int(11) NOT NULL,
966
    taxonconcept_id int(11) NOT NULL,
967
    party_id int(11),
968
    role text DEFAULT 'unknown' NOT NULL,
969
    determinationtype text,
970
    reference_id int(11),
971
    isoriginal int(1) DEFAULT false NOT NULL,
972
    iscurrent int(1) DEFAULT false NOT NULL,
973
    taxonfit text,
974
    taxonconfidence text,
975
    grouptype text,
976
    notes text,
977
    notespublic int(1),
978
    notesmgt int(1),
979
    revisions int(1),
980 5499 aaronmk
    determinationdate date,
981 5225 aaronmk
    accessioncode text
982
);
983 4964 aaronmk
984
985
--
986 5225 aaronmk
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
987 4964 aaronmk
--
988
989
990
991
992
--
993 5225 aaronmk
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace:
994 4964 aaronmk
--
995
996 5225 aaronmk
CREATE TABLE taxonoccurrence (
997
    taxonoccurrence_id int(11) NOT NULL,
998 5242 aaronmk
    creator_id int(11) NOT NULL,
999 5225 aaronmk
    sourceaccessioncode text,
1000
    locationevent_id int(11),
1001
    authortaxoncode text,
1002
    verbatimcollectorname text,
1003
    growthform text,
1004
    iscultivated int(1),
1005
    cultivatedbasis text,
1006
    isnative int(1),
1007
    accessioncode text
1008
);
1009 4964 aaronmk
1010
1011
--
1012 5225 aaronmk
-- Name: TABLE taxonoccurrence; Type: COMMENT; Schema: public; Owner: -
1013 4964 aaronmk
--
1014
1015
1016
1017
1018
--
1019 5225 aaronmk
-- Name: COLUMN taxonoccurrence.iscultivated; Type: COMMENT; Schema: public; Owner: -
1020 5200 aaronmk
--
1021
1022
1023
1024
1025
--
1026 5225 aaronmk
-- Name: COLUMN taxonoccurrence.cultivatedbasis; Type: COMMENT; Schema: public; Owner: -
1027 4933 aaronmk
--
1028
1029
1030
1031
1032
--
1033 5225 aaronmk
-- Name: COLUMN taxonoccurrence.isnative; Type: COMMENT; Schema: public; Owner: -
1034 4934 aaronmk
--
1035
1036
1037
1038
1039
--
1040 4391 aaronmk
-- Name: analytical_db_view; Type: VIEW; Schema: public; Owner: -
1041 689 aaronmk
--
1042
1043 4391 aaronmk
CREATE VIEW analytical_db_view AS
1044 5493 aaronmk
    SELECT datasource.organizationname AS `dataSourceName`, accepted_taxonconcept.family, accepted_taxonconcept.genus, accepted_taxonconcept.species, COALESCE(accepted_taxonconcept.taxonomicnamewithauthor, accepted_taxonconcept.taxonomicname) AS taxon, accepted_taxonconcept.author AS `taxonAuthor`, accepted_taxonconcept.taxonname AS `taxonMorphospecies`, placepath.country, placepath.stateprovince AS `stateProvince`, placepath.county 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`, functions._m2_to_ha(location.area_m2) AS `plotAreaHa`, method.name AS `plotMethod`, locationcoords.latitude_deg AS latitude, locationcoords.longitude_deg AS longitude, location.elevation_m, taxonoccurrence.iscultivated AS `isCultivated`, taxonoccurrence.cultivatedbasis AS `isCultivatedReason`, _fraction_to_percent(aggregateoccurrence.cover_fraction) AS `pctCover` FROM ((((((((((((((location JOIN party datasource ON (((datasource.party_id = location.creator_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonconcept datasource_taxonconcept USING (taxonconcept_id)) JOIN taxonconcept accepted_taxonconcept ON ((accepted_taxonconcept.taxonconcept_id = datasource_taxonconcept.accepted_concept_id))) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
1045 689 aaronmk
1046
1047 4391 aaronmk
--
1048
-- Name: classcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
1049 689 aaronmk
--
1050
1051 4391 aaronmk
CREATE TABLE classcontributor (
1052
    classcontributor_id int(11) NOT NULL,
1053
    commclass_id int(11) NOT NULL,
1054
    party_id int(11) NOT NULL,
1055
    role text
1056 689 aaronmk
);
1057
1058
1059
--
1060 4391 aaronmk
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1061 689 aaronmk
--
1062
1063
1064
1065
1066
--
1067 4391 aaronmk
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1068 689 aaronmk
--
1069
1070
1071
1072
1073
--
1074 4391 aaronmk
-- Name: commclass; Type: TABLE; Schema: public; Owner: -; Tablespace:
1075 689 aaronmk
--
1076
1077 4391 aaronmk
CREATE TABLE commclass (
1078
    commclass_id int(11) NOT NULL,
1079 689 aaronmk
    locationevent_id int(11) NOT NULL,
1080 4391 aaronmk
    inspection int(1),
1081
    tableanalysis int(1),
1082
    multivariateanalysis int(1),
1083
    classpublication_id int(11),
1084
    classnotes text,
1085
    commname text,
1086
    commcode text,
1087
    commframework text,
1088
    commlevel text,
1089 5499 aaronmk
    classstartdate date,
1090
    classstopdate date,
1091 4391 aaronmk
    expertsystem text,
1092 841 aaronmk
    accessioncode text
1093 689 aaronmk
);
1094
1095
1096
--
1097 4391 aaronmk
-- Name: commclass_commclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1098 689 aaronmk
--
1099
1100
1101
1102
1103
--
1104 4391 aaronmk
-- Name: commclass_commclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1105 689 aaronmk
--
1106
1107
1108
1109
1110
--
1111 4391 aaronmk
-- Name: commconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
1112 689 aaronmk
--
1113
1114 4391 aaronmk
CREATE TABLE commconcept (
1115
    commconcept_id int(11) NOT NULL,
1116
    commname_id int(11) NOT NULL,
1117
    reference_id int(11),
1118
    commdescription text,
1119
    d_obscount int(11),
1120
    commname text,
1121
    d_currentaccepted int(1),
1122 1434 aaronmk
    accessioncode text
1123 689 aaronmk
);
1124
1125
1126
--
1127 4391 aaronmk
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1128 1020 aaronmk
--
1129
1130
1131
1132
1133
--
1134 4391 aaronmk
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1135 689 aaronmk
--
1136
1137
1138
1139
1140
--
1141 4391 aaronmk
-- Name: commcorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
1142 689 aaronmk
--
1143
1144 4391 aaronmk
CREATE TABLE commcorrelation (
1145
    commcorrelation_id int(11) NOT NULL,
1146
    commstatus_id int(11) NOT NULL,
1147
    commconcept_id int(11) NOT NULL,
1148
    commconvergence text NOT NULL,
1149 5499 aaronmk
    correlationstart date NOT NULL,
1150
    correlationstop date
1151 4391 aaronmk
);
1152 689 aaronmk
1153
1154 4391 aaronmk
--
1155
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1156
--
1157 689 aaronmk
1158 4391 aaronmk
1159
1160
1161 689 aaronmk
--
1162 4391 aaronmk
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1163 906 aaronmk
--
1164
1165 4391 aaronmk
1166
1167
1168
--
1169
-- Name: commdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
1170
--
1171
1172
CREATE TABLE commdetermination (
1173
    commdetermination_id int(11) NOT NULL,
1174
    commclass_id int(11) NOT NULL,
1175
    commconcept_id int(11) NOT NULL,
1176
    commcode text,
1177
    commname text,
1178
    classfit text,
1179
    classconfidence text,
1180
    commauthority_id int(11),
1181
    notes text,
1182
    type int(1),
1183
    nomenclaturaltype int(1)
1184 906 aaronmk
);
1185
1186
1187
--
1188 4391 aaronmk
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1189 1021 aaronmk
--
1190
1191
1192
1193
1194
--
1195 4391 aaronmk
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1196 1022 aaronmk
--
1197
1198
1199
1200
1201
--
1202 4391 aaronmk
-- Name: commlineage; Type: TABLE; Schema: public; Owner: -; Tablespace:
1203 1020 aaronmk
--
1204
1205 4391 aaronmk
CREATE TABLE commlineage (
1206
    commlineage_id int(11) NOT NULL,
1207
    parentcommstatus_id int(11) NOT NULL,
1208
    childcommstatus_id int(11) NOT NULL
1209
);
1210 1020 aaronmk
1211
1212
--
1213 4391 aaronmk
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1214 906 aaronmk
--
1215
1216
1217
1218
1219
--
1220 4391 aaronmk
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1221 906 aaronmk
--
1222
1223
1224
1225
1226
--
1227 4391 aaronmk
-- Name: commname; Type: TABLE; Schema: public; Owner: -; Tablespace:
1228 689 aaronmk
--
1229
1230 4391 aaronmk
CREATE TABLE commname (
1231
    commname_id int(11) NOT NULL,
1232
    commname text NOT NULL,
1233
    reference_id int(11),
1234 5499 aaronmk
    dateentered date
1235 689 aaronmk
);
1236
1237
1238
--
1239 4391 aaronmk
-- Name: commname_commname_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1240 689 aaronmk
--
1241
1242
1243
1244
1245
--
1246 4391 aaronmk
-- Name: commname_commname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1247 689 aaronmk
--
1248
1249
1250
1251
1252
--
1253 4391 aaronmk
-- Name: commstatus; Type: TABLE; Schema: public; Owner: -; Tablespace:
1254 689 aaronmk
--
1255
1256 4391 aaronmk
CREATE TABLE commstatus (
1257
    commstatus_id int(11) NOT NULL,
1258
    commconcept_id int(11) NOT NULL,
1259
    reference_id int(11),
1260
    commconceptstatus text NOT NULL,
1261
    commparent_id int(11),
1262
    commlevel text,
1263
    commpartycomments text,
1264
    party_id int(11) NOT NULL,
1265 5499 aaronmk
    startdate date NOT NULL,
1266
    stopdate date,
1267 4391 aaronmk
    accessioncode text
1268
);
1269 689 aaronmk
1270
1271 4391 aaronmk
--
1272
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1273
--
1274 689 aaronmk
1275 4391 aaronmk
1276
1277
1278 689 aaronmk
--
1279 4391 aaronmk
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1280 689 aaronmk
--
1281
1282 4391 aaronmk
1283
1284
1285
--
1286
-- Name: commusage; Type: TABLE; Schema: public; Owner: -; Tablespace:
1287
--
1288
1289
CREATE TABLE commusage (
1290
    commusage_id int(11) NOT NULL,
1291
    commname_id int(11) NOT NULL,
1292
    commname text,
1293
    commconcept_id int(11),
1294
    commnamestatus text,
1295
    classsystem text,
1296
    party_id int(11),
1297
    commstatus_id int(11),
1298 5499 aaronmk
    usagestart date,
1299
    usagestop date
1300 689 aaronmk
);
1301
1302
1303
--
1304 4391 aaronmk
-- Name: commusage_commusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1305 689 aaronmk
--
1306
1307
1308
1309
1310
--
1311 4391 aaronmk
-- Name: commusage_commusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1312 689 aaronmk
--
1313
1314
1315
1316
1317
--
1318 4391 aaronmk
-- Name: coverindex; Type: TABLE; Schema: public; Owner: -; Tablespace:
1319 689 aaronmk
--
1320
1321 4391 aaronmk
CREATE TABLE coverindex (
1322
    coverindex_id int(11) NOT NULL,
1323
    covermethod_id int(11) NOT NULL,
1324
    covercode text NOT NULL,
1325
    upperlimit double precision,
1326
    lowerlimit double precision,
1327
    coverpercent double precision NOT NULL,
1328
    indexdescription text
1329 689 aaronmk
);
1330
1331
1332
--
1333 4391 aaronmk
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1334 689 aaronmk
--
1335
1336
1337
1338
1339
--
1340 4391 aaronmk
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1341 689 aaronmk
--
1342
1343
1344
1345
1346
--
1347 4391 aaronmk
-- Name: covermethod; Type: TABLE; Schema: public; Owner: -; Tablespace:
1348 907 aaronmk
--
1349
1350 4391 aaronmk
CREATE TABLE covermethod (
1351
    covermethod_id int(11) NOT NULL,
1352 907 aaronmk
    reference_id int(11),
1353 4391 aaronmk
    covertype text NOT NULL,
1354
    coverestimationmethod text,
1355 1434 aaronmk
    accessioncode text
1356 907 aaronmk
);
1357
1358
1359
--
1360 4391 aaronmk
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1361 1039 aaronmk
--
1362
1363
1364
1365
1366
--
1367 4391 aaronmk
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1368 1100 aaronmk
--
1369
1370
1371
1372
1373
--
1374 4391 aaronmk
-- Name: dba_preassignacccode_dba_requestnumber_seq; Type: SEQUENCE; Schema: public; Owner: -
1375 1064 aaronmk
--
1376
1377
1378
1379
1380
--
1381 4391 aaronmk
-- Name: definedvalue; Type: TABLE; Schema: public; Owner: -; Tablespace:
1382 1064 aaronmk
--
1383
1384 4391 aaronmk
CREATE TABLE definedvalue (
1385
    definedvalue_id int(11) NOT NULL,
1386
    userdefined_id int(11) NOT NULL,
1387
    tablerecord_id int(11) NOT NULL,
1388
    definedvalue text
1389
);
1390 1064 aaronmk
1391
1392
--
1393 4391 aaronmk
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1394 1064 aaronmk
--
1395
1396
1397
1398
1399
--
1400 4391 aaronmk
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1401 1064 aaronmk
--
1402
1403
1404
1405
1406
--
1407 4391 aaronmk
-- Name: disturbanceobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
1408 1064 aaronmk
--
1409
1410 4391 aaronmk
CREATE TABLE disturbanceobs (
1411
    disturbanceobs_id int(11) NOT NULL,
1412
    locationevent_id int(11) NOT NULL,
1413
    disturbancetype text NOT NULL,
1414
    disturbanceintensity text,
1415
    disturbanceage double precision,
1416
    disturbanceextent double precision,
1417
    disturbancecomment text
1418
);
1419 1064 aaronmk
1420
1421
--
1422 4391 aaronmk
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1423 1112 aaronmk
--
1424
1425
1426
1427
1428
--
1429 4391 aaronmk
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1430 1064 aaronmk
--
1431
1432
1433
1434
1435
--
1436 4391 aaronmk
-- Name: graphic; Type: TABLE; Schema: public; Owner: -; Tablespace:
1437 1034 aaronmk
--
1438
1439 4391 aaronmk
CREATE TABLE graphic (
1440
    graphic_id int(11) NOT NULL,
1441
    locationevent_id int(11) NOT NULL,
1442
    graphicname text,
1443
    graphiclocation text,
1444
    graphicdescription text,
1445
    graphictype text,
1446
    graphicdata int(11),
1447 5499 aaronmk
    graphicdate date,
1448 4391 aaronmk
    accessioncode text
1449
);
1450 1034 aaronmk
1451
1452
--
1453 4391 aaronmk
-- Name: graphic_graphic_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1454 1034 aaronmk
--
1455
1456
1457
1458
1459
--
1460 4391 aaronmk
-- Name: graphic_graphic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1461 1034 aaronmk
--
1462
1463
1464
1465
1466
--
1467 4391 aaronmk
-- Name: location_location_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1468 1034 aaronmk
--
1469
1470
1471
1472
1473
--
1474 4391 aaronmk
-- Name: location_location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1475 1064 aaronmk
--
1476
1477
1478
1479
1480
--
1481 4726 aaronmk
-- Name: locationcoords_locationcoords_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1482 1064 aaronmk
--
1483
1484
1485
1486
1487
--
1488 4726 aaronmk
-- Name: locationcoords_locationcoords_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1489 1064 aaronmk
--
1490
1491
1492
1493
1494
--
1495 4391 aaronmk
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1496 1099 aaronmk
--
1497
1498
1499
1500
1501
--
1502 4391 aaronmk
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1503 1099 aaronmk
--
1504
1505
1506
1507
1508
--
1509 4391 aaronmk
-- Name: locationeventcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
1510 1099 aaronmk
--
1511
1512 4391 aaronmk
CREATE TABLE locationeventcontributor (
1513
    locationeventcontributor_id int(11) NOT NULL,
1514
    locationevent_id int(11) NOT NULL,
1515
    party_id int(11) NOT NULL,
1516
    role text NOT NULL,
1517 5499 aaronmk
    contributiondate date
1518 4391 aaronmk
);
1519 1099 aaronmk
1520
1521
--
1522 4391 aaronmk
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1523 1099 aaronmk
--
1524
1525
1526
1527
1528
--
1529 4391 aaronmk
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1530 1162 aaronmk
--
1531
1532
1533
1534
1535
--
1536 4391 aaronmk
-- Name: locationeventsynonym; Type: TABLE; Schema: public; Owner: -; Tablespace:
1537 1162 aaronmk
--
1538
1539 4391 aaronmk
CREATE TABLE locationeventsynonym (
1540
    locationeventsynonym_id int(11) NOT NULL,
1541
    synonymlocationevent_id int(11) NOT NULL,
1542
    primarylocationevent_id int(11) NOT NULL,
1543
    party_id int(11) NOT NULL,
1544
    role text NOT NULL,
1545
    synonymcomment text,
1546 5499 aaronmk
    classstartdate date  NOT NULL,
1547
    classstopdate date,
1548 4391 aaronmk
    accessioncode text
1549
);
1550 1162 aaronmk
1551
1552 4391 aaronmk
--
1553
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1554
--
1555 1162 aaronmk
1556 4391 aaronmk
1557
1558
1559 1162 aaronmk
--
1560 4391 aaronmk
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1561 1168 aaronmk
--
1562
1563
1564
1565
1566
--
1567 4726 aaronmk
-- Name: locationplace_locationplace_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1568
--
1569
1570
1571
1572
1573
--
1574
-- Name: locationplace_locationplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1575
--
1576
1577
1578
1579
1580
--
1581 1101 aaronmk
-- Name: method_method_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1582 1099 aaronmk
--
1583
1584
1585
1586
1587
--
1588 1101 aaronmk
-- Name: method_method_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1589 1099 aaronmk
--
1590
1591
1592
1593
1594
--
1595 1101 aaronmk
-- Name: methodtaxonclass; Type: TABLE; Schema: public; Owner: -; Tablespace:
1596
--
1597
1598
CREATE TABLE methodtaxonclass (
1599
    methodtaxonclass_id int(11) NOT NULL,
1600
    method_id int(11) NOT NULL,
1601 5225 aaronmk
    taxonconcept_id int(11),
1602 1152 aaronmk
    included int(1) NOT NULL,
1603 1160 aaronmk
    submethod_id int(11),
1604 1174 aaronmk
    taxonclass text
1605 1101 aaronmk
);
1606
1607
1608
--
1609
-- Name: COLUMN methodtaxonclass.included; Type: COMMENT; Schema: public; Owner: -
1610
--
1611
1612
1613
1614
1615
--
1616 1105 aaronmk
-- Name: COLUMN methodtaxonclass.submethod_id; Type: COMMENT; Schema: public; Owner: -
1617
--
1618
1619
1620
1621
1622
--
1623 1101 aaronmk
-- Name: methodtaxonclass_methodtaxonclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1624
--
1625
1626
1627
1628
1629
--
1630
-- Name: methodtaxonclass_methodtaxonclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1631
--
1632
1633
1634
1635
1636
--
1637 689 aaronmk
-- Name: note; Type: TABLE; Schema: public; Owner: -; Tablespace:
1638
--
1639
1640
CREATE TABLE note (
1641
    note_id int(11) NOT NULL,
1642
    notelink_id int(11) NOT NULL,
1643
    party_id int(11) NOT NULL,
1644 1337 aaronmk
    role text NOT NULL,
1645 841 aaronmk
    notetype text NOT NULL,
1646 689 aaronmk
    notetext text NOT NULL,
1647 5499 aaronmk
    notedate date,
1648 841 aaronmk
    accessioncode text
1649 689 aaronmk
);
1650
1651
1652
--
1653
-- Name: note_note_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1654
--
1655
1656
1657
1658
1659
--
1660
-- Name: note_note_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1661
--
1662
1663
1664
1665
1666
--
1667
-- Name: notelink; Type: TABLE; Schema: public; Owner: -; Tablespace:
1668
--
1669
1670
CREATE TABLE notelink (
1671
    notelink_id int(11) NOT NULL,
1672 841 aaronmk
    tablename text NOT NULL,
1673
    attributename text,
1674 689 aaronmk
    tablerecord int(11) NOT NULL
1675
);
1676
1677
1678
--
1679
-- Name: notelink_notelink_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1680
--
1681
1682
1683
1684
1685
--
1686
-- Name: notelink_notelink_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1687
--
1688
1689
1690
1691
1692
--
1693
-- Name: party_party_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1694
--
1695
1696
1697
1698
1699
--
1700
-- Name: party_party_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1701
--
1702
1703
1704
1705
1706
--
1707
-- Name: partymember; Type: TABLE; Schema: public; Owner: -; Tablespace:
1708
--
1709
1710
CREATE TABLE partymember (
1711
    partymember_id int(11) NOT NULL,
1712
    parentparty_id int(11) NOT NULL,
1713
    childparty_id int(11) NOT NULL,
1714 1337 aaronmk
    role text,
1715 5499 aaronmk
    memberstart date  NOT NULL,
1716
    memberstop date
1717 689 aaronmk
);
1718
1719
1720
--
1721
-- Name: partymember_partymember_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1722
--
1723
1724
1725
1726
1727
--
1728
-- Name: partymember_partymember_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1729
--
1730
1731
1732
1733
1734
--
1735 4739 aaronmk
-- Name: place; Type: TABLE; Schema: public; Owner: -; Tablespace:
1736 4730 aaronmk
--
1737
1738 4739 aaronmk
CREATE TABLE place (
1739
    place_id int(11) NOT NULL,
1740
    parent_id int(11),
1741
    rank text NOT NULL,
1742
    placename text NOT NULL,
1743
    placecode text,
1744
    placedescription text,
1745
    accessioncode text
1746
);
1747 4730 aaronmk
1748
1749
--
1750 4739 aaronmk
-- Name: TABLE place; Type: COMMENT; Schema: public; Owner: -
1751 4730 aaronmk
--
1752
1753
1754
1755
1756
--
1757 4739 aaronmk
-- Name: place_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace:
1758 4730 aaronmk
--
1759
1760 4739 aaronmk
CREATE TABLE place_ancestor (
1761
    place_id int(11) NOT NULL,
1762
    ancestor_id int(11) NOT NULL
1763 4730 aaronmk
);
1764
1765
1766
--
1767 5440 aaronmk
-- Name: TABLE place_ancestor; Type: COMMENT; Schema: public; Owner: -
1768
--
1769
1770
1771
1772
1773
--
1774 4739 aaronmk
-- Name: place_place_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1775 4730 aaronmk
--
1776
1777
1778
1779
1780
--
1781 4739 aaronmk
-- Name: place_place_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1782 4730 aaronmk
--
1783
1784
1785
1786
1787
--
1788 4739 aaronmk
-- Name: placecorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
1789 4727 aaronmk
--
1790
1791 4739 aaronmk
CREATE TABLE placecorrelation (
1792
    placecorrelation_id int(11) NOT NULL,
1793
    parentplace_id int(11) NOT NULL,
1794
    childplace_id int(11) NOT NULL,
1795
    placeconvergence text NOT NULL
1796 4727 aaronmk
);
1797
1798
1799
--
1800 4739 aaronmk
-- Name: placecorrelation_placecorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1801 4727 aaronmk
--
1802
1803
1804
1805
1806
--
1807 4739 aaronmk
-- Name: placecorrelation_placecorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1808
--
1809
1810
1811
1812
1813
--
1814 4727 aaronmk
-- Name: placepath_placepath_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1815
--
1816
1817
1818
1819
1820
--
1821
-- Name: placepath_placepath_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1822
--
1823
1824
1825
1826
1827
--
1828 689 aaronmk
-- Name: plant; Type: TABLE; Schema: public; Owner: -; Tablespace:
1829
--
1830
1831
CREATE TABLE plant (
1832
    plant_id int(11) NOT NULL
1833
);
1834
1835
1836
--
1837
-- Name: TABLE plant; Type: COMMENT; Schema: public; Owner: -
1838
--
1839
1840
1841
1842
1843
--
1844
-- Name: plant_plant_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1845
--
1846
1847
1848
1849
1850
--
1851
-- Name: plant_plant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1852
--
1853
1854
1855
1856
1857
--
1858
-- Name: plantobservation_plantobservation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1859
--
1860
1861
1862
1863
1864
--
1865
-- Name: plantobservation_plantobservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1866
--
1867
1868
1869
1870
1871
--
1872
-- Name: project; Type: TABLE; Schema: public; Owner: -; Tablespace:
1873
--
1874
1875
CREATE TABLE project (
1876
    project_id int(11) NOT NULL,
1877 5242 aaronmk
    creator_id int(11) NOT NULL,
1878 3615 aaronmk
    sourceaccessioncode text,
1879 4489 aaronmk
    projectname text,
1880 689 aaronmk
    projectdescription text,
1881 5499 aaronmk
    startdate date,
1882
    stopdate date,
1883 689 aaronmk
    d_obscount int(11),
1884 5499 aaronmk
    d_lastlocationaddeddate date,
1885 1434 aaronmk
    accessioncode text
1886 689 aaronmk
);
1887
1888
1889
--
1890
-- Name: project_project_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1891
--
1892
1893
1894
1895
1896
--
1897
-- Name: project_project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1898
--
1899
1900
1901
1902
1903
--
1904
-- Name: projectcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
1905
--
1906
1907
CREATE TABLE projectcontributor (
1908
    projectcontributor_id int(11) NOT NULL,
1909
    project_id int(11) NOT NULL,
1910
    party_id int(11) NOT NULL,
1911 1337 aaronmk
    role text,
1912 841 aaronmk
    surname text,
1913
    cheatrole text
1914 689 aaronmk
);
1915
1916
1917
--
1918
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1919
--
1920
1921
1922
1923
1924
--
1925
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1926
--
1927
1928
1929
1930
1931
--
1932
-- Name: reference; Type: TABLE; Schema: public; Owner: -; Tablespace:
1933
--
1934
1935
CREATE TABLE reference (
1936
    reference_id int(11) NOT NULL,
1937 841 aaronmk
    shortname text,
1938 5233 aaronmk
    `fulltext` text,
1939 841 aaronmk
    referencetype text,
1940
    title text,
1941
    titlesuperior text,
1942 689 aaronmk
    referencejournal_id int(11),
1943 841 aaronmk
    volume text,
1944
    issue text,
1945
    pagerange text,
1946 689 aaronmk
    totalpages int(11),
1947 841 aaronmk
    publisher text,
1948
    publicationplace text,
1949
    isbn text,
1950
    edition text,
1951 689 aaronmk
    numberofvolumes int(11),
1952
    chapternumber int(11),
1953
    reportnumber int(11),
1954 841 aaronmk
    communicationtype text,
1955
    degree text,
1956 689 aaronmk
    url text,
1957
    doi text,
1958
    additionalinfo text,
1959 5499 aaronmk
    pubdate date,
1960
    accessdate date,
1961
    conferencedate date,
1962 841 aaronmk
    accessioncode text
1963 689 aaronmk
);
1964
1965
1966
--
1967
-- Name: reference_reference_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1968
--
1969
1970
1971
1972
1973
--
1974
-- Name: reference_reference_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1975
--
1976
1977
1978
1979
1980
--
1981
-- Name: referencealtident; Type: TABLE; Schema: public; Owner: -; Tablespace:
1982
--
1983
1984
CREATE TABLE referencealtident (
1985
    referencealtident_id int(11) NOT NULL,
1986
    reference_id int(11) NOT NULL,
1987 841 aaronmk
    system text,
1988
    identifier text NOT NULL
1989 689 aaronmk
);
1990
1991
1992
--
1993
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1994
--
1995
1996
1997
1998
1999
--
2000
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2001
--
2002
2003
2004
2005
2006
--
2007
-- Name: referencecontributor; Type: TABLE; Schema: public; Owner: -; Tablespace:
2008
--
2009
2010
CREATE TABLE referencecontributor (
2011
    referencecontributor_id int(11) NOT NULL,
2012
    reference_id int(11) NOT NULL,
2013
    referenceparty_id int(11) NOT NULL,
2014 841 aaronmk
    roletype text,
2015 689 aaronmk
    `position` int(11)
2016
);
2017
2018
2019
--
2020
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2021
--
2022
2023
2024
2025
2026
--
2027
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2028
--
2029
2030
2031
2032
2033
--
2034
-- Name: referencejournal; Type: TABLE; Schema: public; Owner: -; Tablespace:
2035
--
2036
2037
CREATE TABLE referencejournal (
2038
    referencejournal_id int(11) NOT NULL,
2039 841 aaronmk
    journal text NOT NULL,
2040
    issn text,
2041
    abbreviation text,
2042
    accessioncode text
2043 689 aaronmk
);
2044
2045
2046
--
2047
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2048
--
2049
2050
2051
2052
2053
--
2054
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2055
--
2056
2057
2058
2059
2060
--
2061
-- Name: referenceparty; Type: TABLE; Schema: public; Owner: -; Tablespace:
2062
--
2063
2064
CREATE TABLE referenceparty (
2065
    referenceparty_id int(11) NOT NULL,
2066 841 aaronmk
    type text,
2067
    positionname text,
2068
    salutation text,
2069
    givenname text,
2070
    surname text,
2071
    suffix text,
2072
    organizationname text,
2073 689 aaronmk
    currentparty_id int(11),
2074 841 aaronmk
    accessioncode text
2075 689 aaronmk
);
2076
2077
2078
--
2079
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2080
--
2081
2082
2083
2084
2085
--
2086
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2087
--
2088
2089
2090
2091
2092
--
2093
-- Name: revision; Type: TABLE; Schema: public; Owner: -; Tablespace:
2094
--
2095
2096
CREATE TABLE revision (
2097
    revision_id int(11) NOT NULL,
2098 841 aaronmk
    tablename text NOT NULL,
2099
    tableattribute text NOT NULL,
2100 689 aaronmk
    tablerecord int(11) NOT NULL,
2101
    previousvaluetext text NOT NULL,
2102 841 aaronmk
    previousvaluetype text NOT NULL,
2103 689 aaronmk
    previousrevision_id int(11),
2104 5499 aaronmk
    revisiondate date NOT NULL
2105 689 aaronmk
);
2106
2107
2108
--
2109
-- Name: revision_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2110
--
2111
2112
2113
2114
2115
--
2116
-- Name: revision_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2117
--
2118
2119
2120
2121
2122
--
2123
-- Name: soilobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
2124
--
2125
2126
CREATE TABLE soilobs (
2127
    soilobs_id int(11) NOT NULL,
2128
    locationevent_id int(11) NOT NULL,
2129 1231 aaronmk
    horizon text DEFAULT 'unknown' NOT NULL,
2130 1228 aaronmk
    description text,
2131 4754 aaronmk
    depthtop_m double precision,
2132
    depthbottom_m double precision,
2133 1228 aaronmk
    color text,
2134
    texture text,
2135 4787 aaronmk
    organic_fraction double precision,
2136
    sand_fraction double precision,
2137
    silt_fraction double precision,
2138
    clay_fraction double precision,
2139
    coarse_fraction double precision,
2140 1228 aaronmk
    ph double precision,
2141 4787 aaronmk
    acidity_fraction double precision,
2142
    basesaturation_fraction double precision,
2143 4754 aaronmk
    cationexchangecapacity_cmol_kg double precision,
2144 1224 aaronmk
    conductivity double precision,
2145 4787 aaronmk
    carbon_fraction double precision,
2146
    phosphorus_fraction double precision,
2147
    potassium_fraction double precision,
2148
    magnesium_fraction double precision,
2149
    nitrogen_fraction double precision,
2150
    calcium_fraction double precision,
2151
    sodium_fraction double precision
2152 689 aaronmk
);
2153
2154
2155
--
2156
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2157
--
2158
2159
2160
2161
2162
--
2163
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2164
--
2165
2166
2167
2168
2169
--
2170
-- Name: soiltaxon; Type: TABLE; Schema: public; Owner: -; Tablespace:
2171
--
2172
2173
CREATE TABLE soiltaxon (
2174
    soiltaxon_id int(11) NOT NULL,
2175 841 aaronmk
    soilcode text,
2176
    soilname text,
2177 689 aaronmk
    soillevel int(11),
2178
    soilparent_id int(11),
2179 841 aaronmk
    soilframework text,
2180
    accessioncode text
2181 689 aaronmk
);
2182
2183
2184
--
2185
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2186
--
2187
2188
2189
2190
2191
--
2192
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2193
--
2194
2195
2196
2197
2198
--
2199
-- Name: specimen; Type: TABLE; Schema: public; Owner: -; Tablespace:
2200
--
2201
2202
CREATE TABLE specimen (
2203
    specimen_id int(11) NOT NULL
2204
);
2205
2206
2207
--
2208
-- Name: TABLE specimen; Type: COMMENT; Schema: public; Owner: -
2209
--
2210
2211
2212
2213
2214
--
2215
-- Name: specimen_specimen_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2216
--
2217
2218
2219
2220
2221
--
2222
-- Name: specimen_specimen_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2223
--
2224
2225
2226
2227
2228
--
2229 3934 aaronmk
-- Name: specimenreplicate_specimenreplicate_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2230 689 aaronmk
--
2231
2232
2233
2234
2235
--
2236 3934 aaronmk
-- Name: specimenreplicate_specimenreplicate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2237 3199 aaronmk
--
2238
2239
2240
2241
2242
--
2243 689 aaronmk
-- Name: stemobservation; Type: TABLE; Schema: public; Owner: -; Tablespace:
2244
--
2245
2246
CREATE TABLE stemobservation (
2247
    stemobservation_id int(11) NOT NULL,
2248 5242 aaronmk
    creator_id int(11) NOT NULL,
2249 3615 aaronmk
    sourceaccessioncode text,
2250 689 aaronmk
    plantobservation_id int(11) NOT NULL,
2251 841 aaronmk
    authorstemcode text,
2252 4827 aaronmk
    tag text,
2253
    tags text,
2254 4753 aaronmk
    xposition_m double precision,
2255
    yposition_m double precision,
2256
    diameterbreastheight_m double precision,
2257
    basaldiameter_m double precision,
2258
    diameteraccuracy_m double precision,
2259
    height_m double precision,
2260
    heightfirstbranch_m double precision,
2261
    heightaccuracy_m double precision,
2262 1210 aaronmk
    health text,
2263 689 aaronmk
    age double precision,
2264 1212 aaronmk
    accessioncode text
2265 689 aaronmk
);
2266
2267
2268
--
2269
-- Name: TABLE stemobservation; Type: COMMENT; Schema: public; Owner: -
2270
--
2271
2272
2273
2274
2275
--
2276 4827 aaronmk
-- Name: COLUMN stemobservation.tags; Type: COMMENT; Schema: public; Owner: -
2277
--
2278
2279
2280
2281
2282
--
2283 689 aaronmk
-- Name: stemobservation_stemobservation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2284
--
2285
2286
2287
2288
2289
--
2290
-- Name: stemobservation_stemobservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2291
--
2292
2293
2294
2295
2296
--
2297
-- Name: stratum; Type: TABLE; Schema: public; Owner: -; Tablespace:
2298
--
2299
2300
CREATE TABLE stratum (
2301
    stratum_id int(11) NOT NULL,
2302
    locationevent_id int(11) NOT NULL,
2303
    stratumheight double precision,
2304
    stratumbase double precision,
2305
    stratumcover double precision,
2306 1029 aaronmk
    area double precision,
2307
    method_id int(11)
2308 689 aaronmk
);
2309
2310
2311
--
2312
-- Name: stratum_stratum_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2313
--
2314
2315
2316
2317
2318
--
2319
-- Name: stratum_stratum_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2320
--
2321
2322
2323
2324
2325
--
2326
-- Name: taxonalt; Type: TABLE; Schema: public; Owner: -; Tablespace:
2327
--
2328
2329
CREATE TABLE taxonalt (
2330
    taxonalt_id int(11) NOT NULL,
2331
    taxondetermination_id int(11) NOT NULL,
2332 5225 aaronmk
    taxonconcept_id int(11) NOT NULL,
2333 841 aaronmk
    taxonaltfit text,
2334
    taxonaltconfidence text,
2335 1212 aaronmk
    taxonaltnotes text
2336 689 aaronmk
);
2337
2338
2339
--
2340
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2341
--
2342
2343
2344
2345
2346
--
2347
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2348
--
2349
2350
2351
2352
2353
--
2354 5274 aaronmk
-- Name: taxonconcept_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace:
2355
--
2356
2357
CREATE TABLE taxonconcept_ancestor (
2358
    taxonconcept_id int(11) NOT NULL,
2359
    ancestor_id int(11) NOT NULL
2360
);
2361
2362
2363
--
2364 5440 aaronmk
-- Name: TABLE taxonconcept_ancestor; Type: COMMENT; Schema: public; Owner: -
2365
--
2366
2367
2368
2369
2370
--
2371 5225 aaronmk
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2372 689 aaronmk
--
2373
2374
2375
2376
2377
--
2378 5225 aaronmk
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2379 689 aaronmk
--
2380
2381
2382
2383
2384
--
2385 5286 aaronmk
-- Name: taxoncorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
2386
--
2387
2388
CREATE TABLE taxoncorrelation (
2389
    taxoncorrelation_id int(11) NOT NULL,
2390
    taxonstatus_id int(11) NOT NULL,
2391
    taxonconcept_id int(11) NOT NULL,
2392
    plantconvergence text NOT NULL,
2393 5499 aaronmk
    correlationstart date NOT NULL,
2394
    correlationstop date
2395 5286 aaronmk
);
2396
2397
2398
--
2399
-- Name: taxoncorrelation_taxoncorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2400
--
2401
2402
2403
2404
2405
--
2406
-- Name: taxoncorrelation_taxoncorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2407
--
2408
2409
2410
2411
2412
--
2413 5225 aaronmk
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2414 3934 aaronmk
--
2415
2416
2417
2418
2419
--
2420 5225 aaronmk
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2421 3934 aaronmk
--
2422
2423
2424
2425
2426
--
2427 5286 aaronmk
-- Name: taxonlineage; Type: TABLE; Schema: public; Owner: -; Tablespace:
2428
--
2429
2430
CREATE TABLE taxonlineage (
2431
    taxonlineage_id int(11) NOT NULL,
2432
    childtaxonstatus_id int(11) NOT NULL,
2433
    parenttaxonstatus_id int(11) NOT NULL
2434
);
2435
2436
2437
--
2438
-- Name: taxonlineage_taxonlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2439
--
2440
2441
2442
2443
2444
--
2445
-- Name: taxonlineage_taxonlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2446
--
2447
2448
2449
2450
2451
--
2452 5225 aaronmk
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2453 4718 aaronmk
--
2454
2455
2456
2457
2458
--
2459 5225 aaronmk
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2460 4718 aaronmk
--
2461
2462
2463
2464
2465
--
2466 5286 aaronmk
-- Name: taxonstatus; Type: TABLE; Schema: public; Owner: -; Tablespace:
2467
--
2468
2469
CREATE TABLE taxonstatus (
2470
    taxonstatus_id int(11) NOT NULL,
2471
    taxonconcept_id int(11) NOT NULL,
2472
    party_id int(11),
2473
    taxonconceptstatus text DEFAULT 'undetermined' NOT NULL,
2474
    reference_id int(11),
2475
    plantpartycomments text,
2476 5499 aaronmk
    startdate date,
2477
    stopdate date,
2478 5286 aaronmk
    accessioncode text
2479
);
2480
2481
2482
--
2483
-- Name: taxonstatus_taxonstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2484
--
2485
2486
2487
2488
2489
--
2490
-- Name: taxonstatus_taxonstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2491
--
2492
2493
2494
2495
2496
--
2497
-- Name: taxonusage; Type: TABLE; Schema: public; Owner: -; Tablespace:
2498
--
2499
2500
CREATE TABLE taxonusage (
2501
    taxonusage_id int(11) NOT NULL,
2502
    taxonconcept_id int(11) NOT NULL,
2503
    taxonstatus text,
2504
    taxon text,
2505
    classsystem text,
2506
    acceptedsynonym text,
2507
    party_id int(11),
2508
    taxonstatus_id int(11),
2509 5499 aaronmk
    usagestart date,
2510
    usagestop date
2511 5286 aaronmk
);
2512
2513
2514
--
2515
-- Name: taxonusage_taxonusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2516
--
2517
2518
2519
2520
2521
--
2522
-- Name: taxonusage_taxonusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2523
--
2524
2525
2526
2527
2528
--
2529 689 aaronmk
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace:
2530
--
2531
2532
CREATE TABLE telephone (
2533
    telephone_id int(11) NOT NULL,
2534
    party_id int(11) NOT NULL,
2535 841 aaronmk
    phonenumber text NOT NULL,
2536
    phonetype text NOT NULL
2537 689 aaronmk
);
2538
2539
2540
--
2541
-- Name: telephone_telephone_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2542
--
2543
2544
2545
2546
2547
--
2548
-- Name: telephone_telephone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2549
--
2550
2551
2552
2553
2554
--
2555
-- Name: trait; Type: TABLE; Schema: public; Owner: -; Tablespace:
2556
--
2557
2558
CREATE TABLE trait (
2559
    trait_id int(11) NOT NULL,
2560
    stemobservation_id int(11) NOT NULL,
2561 841 aaronmk
    type text NOT NULL,
2562
    value text
2563 689 aaronmk
);
2564
2565
2566
--
2567
-- Name: trait_trait_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2568
--
2569
2570
2571
2572
2573
--
2574
-- Name: trait_trait_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2575
--
2576
2577
2578
2579
2580
--
2581
-- Name: userdefined; Type: TABLE; Schema: public; Owner: -; Tablespace:
2582
--
2583
2584
CREATE TABLE userdefined (
2585
    userdefined_id int(11) NOT NULL,
2586 1221 aaronmk
    userdefinedname text NOT NULL,
2587 689 aaronmk
    userdefinedmetadata text,
2588 841 aaronmk
    userdefinedcategory text,
2589 1231 aaronmk
    userdefinedtype text DEFAULT 'text' NOT NULL,
2590 841 aaronmk
    tablename text NOT NULL,
2591
    accessioncode text
2592 689 aaronmk
);
2593
2594
2595
--
2596
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2597
--
2598
2599
2600
2601
2602
--
2603
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2604
--
2605
2606
2607
2608
2609
--
2610
-- Name: voucher; Type: TABLE; Schema: public; Owner: -; Tablespace:
2611
--
2612
2613
CREATE TABLE voucher (
2614
    voucher_id int(11) NOT NULL,
2615
    taxonoccurrence_id int(11) NOT NULL,
2616 5243 aaronmk
    specimenreplicate_id int(11) NOT NULL
2617 689 aaronmk
);
2618
2619
2620
--
2621
-- Name: voucher_voucher_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2622
--
2623
2624
2625
2626
2627
--
2628
-- Name: voucher_voucher_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2629
--
2630
2631
2632
2633
2634
--
2635
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: -
2636
--
2637
2638
2639
2640
2641
--
2642
-- Name: aggregateoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
2643
--
2644
2645
2646
2647
2648
--
2649
-- Name: classcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2650
--
2651
2652
2653
2654
2655
--
2656
-- Name: commclass_id; Type: DEFAULT; Schema: public; Owner: -
2657
--
2658
2659
2660
2661
2662
--
2663
-- Name: commconcept_id; Type: DEFAULT; Schema: public; Owner: -
2664
--
2665
2666
2667
2668
2669
--
2670
-- Name: commcorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2671
--
2672
2673
2674
2675
2676
--
2677
-- Name: commdetermination_id; Type: DEFAULT; Schema: public; Owner: -
2678
--
2679
2680
2681
2682
2683
--
2684
-- Name: commlineage_id; Type: DEFAULT; Schema: public; Owner: -
2685
--
2686
2687
2688
2689
2690
--
2691
-- Name: commname_id; Type: DEFAULT; Schema: public; Owner: -
2692
--
2693
2694
2695
2696
2697
--
2698
-- Name: commstatus_id; Type: DEFAULT; Schema: public; Owner: -
2699
--
2700
2701
2702
2703
2704
--
2705
-- Name: commusage_id; Type: DEFAULT; Schema: public; Owner: -
2706
--
2707
2708
2709
2710
2711
--
2712
-- Name: coverindex_id; Type: DEFAULT; Schema: public; Owner: -
2713
--
2714
2715
2716
2717
2718
--
2719
-- Name: covermethod_id; Type: DEFAULT; Schema: public; Owner: -
2720
--
2721
2722
2723
2724
2725
--
2726
-- Name: definedvalue_id; Type: DEFAULT; Schema: public; Owner: -
2727
--
2728
2729
2730
2731
2732
--
2733
-- Name: disturbanceobs_id; Type: DEFAULT; Schema: public; Owner: -
2734
--
2735
2736
2737
2738
2739
--
2740
-- Name: graphic_id; Type: DEFAULT; Schema: public; Owner: -
2741
--
2742
2743
2744
2745
2746
--
2747
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: -
2748
--
2749
2750
2751
2752
2753
--
2754 4726 aaronmk
-- Name: locationcoords_id; Type: DEFAULT; Schema: public; Owner: -
2755 689 aaronmk
--
2756
2757
2758
2759
2760
--
2761 906 aaronmk
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
2762 689 aaronmk
--
2763
2764
2765
2766
2767
--
2768 906 aaronmk
-- Name: locationeventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2769 689 aaronmk
--
2770
2771
2772
2773
2774
--
2775 906 aaronmk
-- Name: locationeventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
2776 689 aaronmk
--
2777
2778
2779
2780
2781
--
2782 4726 aaronmk
-- Name: locationplace_id; Type: DEFAULT; Schema: public; Owner: -
2783
--
2784
2785
2786
2787
2788
--
2789 907 aaronmk
-- Name: method_id; Type: DEFAULT; Schema: public; Owner: -
2790
--
2791
2792
2793
2794
2795
--
2796 1101 aaronmk
-- Name: methodtaxonclass_id; Type: DEFAULT; Schema: public; Owner: -
2797
--
2798
2799
2800
2801
2802
--
2803 4730 aaronmk
-- Name: note_id; Type: DEFAULT; Schema: public; Owner: -
2804 689 aaronmk
--
2805
2806
2807
2808
2809
--
2810 4730 aaronmk
-- Name: notelink_id; Type: DEFAULT; Schema: public; Owner: -
2811 689 aaronmk
--
2812
2813
2814
2815
2816
--
2817 4730 aaronmk
-- Name: party_id; Type: DEFAULT; Schema: public; Owner: -
2818 689 aaronmk
--
2819
2820
2821
2822
2823
--
2824 4730 aaronmk
-- Name: partymember_id; Type: DEFAULT; Schema: public; Owner: -
2825 689 aaronmk
--
2826
2827
2828
2829
2830
--
2831 4730 aaronmk
-- Name: place_id; Type: DEFAULT; Schema: public; Owner: -
2832 689 aaronmk
--
2833
2834
2835
2836
2837
--
2838 4730 aaronmk
-- Name: placecorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2839 689 aaronmk
--
2840
2841
2842
2843
2844
--
2845 4727 aaronmk
-- Name: placepath_id; Type: DEFAULT; Schema: public; Owner: -
2846
--
2847
2848
2849
2850
2851
--
2852 689 aaronmk
-- Name: plant_id; Type: DEFAULT; Schema: public; Owner: -
2853
--
2854
2855
2856
2857
2858
--
2859 5286 aaronmk
-- Name: plantobservation_id; Type: DEFAULT; Schema: public; Owner: -
2860 903 aaronmk
--
2861
2862
2863
2864
2865
--
2866 5286 aaronmk
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: -
2867 689 aaronmk
--
2868
2869
2870
2871
2872
--
2873 5286 aaronmk
-- Name: projectcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2874 689 aaronmk
--
2875
2876
2877
2878
2879
--
2880 5286 aaronmk
-- Name: reference_id; Type: DEFAULT; Schema: public; Owner: -
2881 689 aaronmk
--
2882
2883
2884
2885
2886
--
2887 5286 aaronmk
-- Name: referencealtident_id; Type: DEFAULT; Schema: public; Owner: -
2888 689 aaronmk
--
2889
2890
2891
2892
2893
--
2894 5286 aaronmk
-- Name: referencecontributor_id; Type: DEFAULT; Schema: public; Owner: -
2895 689 aaronmk
--
2896
2897
2898
2899
2900
--
2901 5286 aaronmk
-- Name: referencejournal_id; Type: DEFAULT; Schema: public; Owner: -
2902 689 aaronmk
--
2903
2904
2905
2906
2907
--
2908 5286 aaronmk
-- Name: referenceparty_id; Type: DEFAULT; Schema: public; Owner: -
2909 689 aaronmk
--
2910
2911
2912
2913
2914
--
2915 5286 aaronmk
-- Name: revision_id; Type: DEFAULT; Schema: public; Owner: -
2916 689 aaronmk
--
2917
2918
2919
2920
2921
--
2922 5286 aaronmk
-- Name: soilobs_id; Type: DEFAULT; Schema: public; Owner: -
2923 689 aaronmk
--
2924
2925
2926
2927
2928
--
2929 5286 aaronmk
-- Name: soiltaxon_id; Type: DEFAULT; Schema: public; Owner: -
2930 689 aaronmk
--
2931
2932
2933
2934
2935
--
2936 5286 aaronmk
-- Name: specimen_id; Type: DEFAULT; Schema: public; Owner: -
2937 689 aaronmk
--
2938
2939
2940
2941
2942
--
2943 5286 aaronmk
-- Name: specimenreplicate_id; Type: DEFAULT; Schema: public; Owner: -
2944 689 aaronmk
--
2945
2946
2947
2948
2949
--
2950 5286 aaronmk
-- Name: stemobservation_id; Type: DEFAULT; Schema: public; Owner: -
2951 689 aaronmk
--
2952
2953
2954
2955
2956
--
2957 5286 aaronmk
-- Name: stratum_id; Type: DEFAULT; Schema: public; Owner: -
2958 689 aaronmk
--
2959
2960
2961
2962
2963
--
2964 5286 aaronmk
-- Name: taxonalt_id; Type: DEFAULT; Schema: public; Owner: -
2965 689 aaronmk
--
2966
2967
2968
2969
2970
--
2971 5286 aaronmk
-- Name: taxonconcept_id; Type: DEFAULT; Schema: public; Owner: -
2972 3934 aaronmk
--
2973
2974
2975
2976
2977
--
2978 5286 aaronmk
-- Name: taxoncorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2979 689 aaronmk
--
2980
2981
2982
2983
2984
--
2985 5286 aaronmk
-- Name: taxondetermination_id; Type: DEFAULT; Schema: public; Owner: -
2986 689 aaronmk
--
2987
2988
2989
2990
2991
--
2992 5286 aaronmk
-- Name: taxonlineage_id; Type: DEFAULT; Schema: public; Owner: -
2993 689 aaronmk
--
2994
2995
2996
2997
2998
--
2999 5286 aaronmk
-- Name: taxonoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
3000 689 aaronmk
--
3001
3002
3003
3004
3005
--
3006 5286 aaronmk
-- Name: taxonstatus_id; Type: DEFAULT; Schema: public; Owner: -
3007 689 aaronmk
--
3008
3009
3010
3011
3012
--
3013 5286 aaronmk
-- Name: taxonusage_id; Type: DEFAULT; Schema: public; Owner: -
3014 4718 aaronmk
--
3015
3016
3017
3018
3019
--
3020 689 aaronmk
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: -
3021
--
3022
3023
3024
3025
3026
--
3027
-- Name: trait_id; Type: DEFAULT; Schema: public; Owner: -
3028
--
3029
3030
3031
3032
3033
--
3034
-- Name: userdefined_id; Type: DEFAULT; Schema: public; Owner: -
3035
--
3036
3037
3038
3039
3040
--
3041
-- Name: voucher_id; Type: DEFAULT; Schema: public; Owner: -
3042
--
3043
3044
3045
3046
3047
--
3048
-- Name: address_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3049
--
3050
3051
ALTER TABLE address
3052
    ADD CONSTRAINT address_pkey PRIMARY KEY (address_id);
3053
3054
3055
--
3056 1113 aaronmk
-- Name: aggregateoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3057 689 aaronmk
--
3058
3059
ALTER TABLE aggregateoccurrence
3060 1113 aaronmk
    ADD CONSTRAINT aggregateoccurrence_pkey PRIMARY KEY (aggregateoccurrence_id);
3061 689 aaronmk
3062
3063
--
3064
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3065
--
3066
3067
ALTER TABLE classcontributor
3068
    ADD CONSTRAINT classcontributor_pkey PRIMARY KEY (classcontributor_id);
3069
3070
3071
--
3072 1113 aaronmk
-- Name: commclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3073 689 aaronmk
--
3074
3075
ALTER TABLE commclass
3076 1113 aaronmk
    ADD CONSTRAINT commclass_pkey PRIMARY KEY (commclass_id);
3077 689 aaronmk
3078
3079
--
3080 1113 aaronmk
-- Name: commconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3081 689 aaronmk
--
3082
3083
ALTER TABLE commconcept
3084 1113 aaronmk
    ADD CONSTRAINT commconcept_pkey PRIMARY KEY (commconcept_id);
3085 689 aaronmk
3086
3087
--
3088 1113 aaronmk
-- Name: commconcept_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3089 689 aaronmk
--
3090
3091
ALTER TABLE commconcept
3092 1113 aaronmk
    ADD CONSTRAINT commconcept_unique UNIQUE (commname_id);
3093 689 aaronmk
3094
3095
--
3096
-- Name: commcorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3097
--
3098
3099
ALTER TABLE commcorrelation
3100
    ADD CONSTRAINT commcorrelation_pkey PRIMARY KEY (commcorrelation_id);
3101
3102
3103
--
3104 1113 aaronmk
-- Name: commdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3105 689 aaronmk
--
3106
3107
ALTER TABLE commdetermination
3108 1113 aaronmk
    ADD CONSTRAINT commdetermination_pkey PRIMARY KEY (commdetermination_id);
3109 689 aaronmk
3110
3111
--
3112 1113 aaronmk
-- Name: commdetermination_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3113 689 aaronmk
--
3114
3115
ALTER TABLE commdetermination
3116 1113 aaronmk
    ADD CONSTRAINT commdetermination_unique UNIQUE (commclass_id, commconcept_id);
3117 689 aaronmk
3118
3119
--
3120
-- Name: commlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3121
--
3122
3123
ALTER TABLE commlineage
3124
    ADD CONSTRAINT commlineage_pkey PRIMARY KEY (commlineage_id);
3125
3126
3127
--
3128 1113 aaronmk
-- Name: commname_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3129 689 aaronmk
--
3130
3131
ALTER TABLE commname
3132 1113 aaronmk
    ADD CONSTRAINT commname_pkey PRIMARY KEY (commname_id);
3133 689 aaronmk
3134
3135
--
3136 1113 aaronmk
-- Name: commname_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3137 689 aaronmk
--
3138
3139
ALTER TABLE commname
3140 1113 aaronmk
    ADD CONSTRAINT commname_unique UNIQUE (commname);
3141 689 aaronmk
3142
3143
--
3144
-- Name: commstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3145
--
3146
3147
ALTER TABLE commstatus
3148
    ADD CONSTRAINT commstatus_pkey PRIMARY KEY (commstatus_id);
3149
3150
3151
--
3152
-- Name: commusage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3153
--
3154
3155
ALTER TABLE commusage
3156
    ADD CONSTRAINT commusage_pkey PRIMARY KEY (commusage_id);
3157
3158
3159
--
3160
-- Name: coverindex_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3161
--
3162
3163
ALTER TABLE coverindex
3164
    ADD CONSTRAINT coverindex_pkey PRIMARY KEY (coverindex_id);
3165
3166
3167
--
3168
-- Name: covermethod_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3169
--
3170
3171
ALTER TABLE covermethod
3172
    ADD CONSTRAINT covermethod_pkey PRIMARY KEY (covermethod_id);
3173
3174
3175
--
3176
-- Name: definedvalue_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3177
--
3178
3179
ALTER TABLE definedvalue
3180
    ADD CONSTRAINT definedvalue_pkey PRIMARY KEY (definedvalue_id);
3181
3182
3183
--
3184 1221 aaronmk
-- Name: definedvalue_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3185
--
3186
3187
ALTER TABLE definedvalue
3188
    ADD CONSTRAINT definedvalue_unique UNIQUE (userdefined_id, tablerecord_id);
3189
3190
3191
--
3192 689 aaronmk
-- Name: disturbanceobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3193
--
3194
3195
ALTER TABLE disturbanceobs
3196
    ADD CONSTRAINT disturbanceobs_pkey PRIMARY KEY (disturbanceobs_id);
3197
3198
3199
--
3200
-- Name: graphic_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3201
--
3202
3203
ALTER TABLE graphic
3204
    ADD CONSTRAINT graphic_pkey PRIMARY KEY (graphic_id);
3205
3206
3207
--
3208 1113 aaronmk
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3209 689 aaronmk
--
3210
3211
ALTER TABLE location
3212 1113 aaronmk
    ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);
3213 689 aaronmk
3214
3215
--
3216 4726 aaronmk
-- Name: locationcoords_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3217 906 aaronmk
--
3218
3219 4726 aaronmk
ALTER TABLE locationcoords
3220
    ADD CONSTRAINT locationcoords_pkey PRIMARY KEY (locationcoords_id);
3221 906 aaronmk
3222
3223
--
3224 1113 aaronmk
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3225 1074 aaronmk
--
3226
3227
ALTER TABLE locationevent
3228 1113 aaronmk
    ADD CONSTRAINT locationevent_pkey PRIMARY KEY (locationevent_id);
3229 1074 aaronmk
3230
3231
--
3232 689 aaronmk
-- Name: locationeventcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3233
--
3234
3235
ALTER TABLE locationeventcontributor
3236
    ADD CONSTRAINT locationeventcontributor_pkey PRIMARY KEY (locationeventcontributor_id);
3237
3238
3239
--
3240
-- Name: locationeventsynonym_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3241
--
3242
3243
ALTER TABLE locationeventsynonym
3244
    ADD CONSTRAINT locationeventsynonym_pkey PRIMARY KEY (locationeventsynonym_id);
3245
3246
3247
--
3248 4726 aaronmk
-- Name: locationplace_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3249
--
3250
3251
ALTER TABLE locationplace
3252
    ADD CONSTRAINT locationplace_pkey PRIMARY KEY (locationplace_id);
3253
3254
3255
--
3256 907 aaronmk
-- Name: method_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3257
--
3258
3259
ALTER TABLE method
3260
    ADD CONSTRAINT method_pkey PRIMARY KEY (method_id);
3261
3262
3263
--
3264 1101 aaronmk
-- Name: methodtaxonclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3265
--
3266
3267
ALTER TABLE methodtaxonclass
3268
    ADD CONSTRAINT methodtaxonclass_pkey PRIMARY KEY (methodtaxonclass_id);
3269
3270
3271
--
3272 1160 aaronmk
-- Name: methodtaxonclass_unique_description; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3273
--
3274
3275
ALTER TABLE methodtaxonclass
3276 1174 aaronmk
    ADD CONSTRAINT methodtaxonclass_unique_description UNIQUE (method_id, taxonclass);
3277 1160 aaronmk
3278
3279
--
3280 5225 aaronmk
-- Name: methodtaxonclass_unique_taxonconcept_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3281 1160 aaronmk
--
3282
3283
ALTER TABLE methodtaxonclass
3284 5225 aaronmk
    ADD CONSTRAINT methodtaxonclass_unique_taxonconcept_id UNIQUE (method_id, taxonconcept_id);
3285 1160 aaronmk
3286
3287
--
3288 4730 aaronmk
-- Name: note_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3289 1555 aaronmk
--
3290
3291 4730 aaronmk
ALTER TABLE note
3292
    ADD CONSTRAINT note_pkey PRIMARY KEY (note_id);
3293 1555 aaronmk
3294
3295
--
3296 4730 aaronmk
-- Name: notelink_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3297 689 aaronmk
--
3298
3299 4730 aaronmk
ALTER TABLE notelink
3300
    ADD CONSTRAINT notelink_pkey PRIMARY KEY (notelink_id);
3301 689 aaronmk
3302
3303
--
3304 4730 aaronmk
-- Name: party_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3305 689 aaronmk
--
3306
3307 4730 aaronmk
ALTER TABLE party
3308
    ADD CONSTRAINT party_pkey PRIMARY KEY (party_id);
3309 689 aaronmk
3310
3311
--
3312 4730 aaronmk
-- Name: partymember_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3313 689 aaronmk
--
3314
3315 4730 aaronmk
ALTER TABLE partymember
3316
    ADD CONSTRAINT partymember_pkey PRIMARY KEY (partymember_id);
3317 689 aaronmk
3318
3319
--
3320 4730 aaronmk
-- Name: place_ancestor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3321 689 aaronmk
--
3322
3323 4730 aaronmk
ALTER TABLE place_ancestor
3324
    ADD CONSTRAINT place_ancestor_pkey PRIMARY KEY (place_id, ancestor_id);
3325 689 aaronmk
3326
3327
--
3328 4730 aaronmk
-- Name: place_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3329 689 aaronmk
--
3330
3331 4730 aaronmk
ALTER TABLE place
3332
    ADD CONSTRAINT place_pkey PRIMARY KEY (place_id);
3333 689 aaronmk
3334
3335
--
3336 4730 aaronmk
-- Name: placecorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3337 689 aaronmk
--
3338
3339 4730 aaronmk
ALTER TABLE placecorrelation
3340
    ADD CONSTRAINT placecorrelation_pkey PRIMARY KEY (placecorrelation_id);
3341 689 aaronmk
3342
3343
--
3344 4727 aaronmk
-- Name: placepath_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3345
--
3346
3347
ALTER TABLE placepath
3348
    ADD CONSTRAINT placepath_pkey PRIMARY KEY (placepath_id);
3349
3350
3351
--
3352 689 aaronmk
-- Name: plant_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3353
--
3354
3355
ALTER TABLE plant
3356
    ADD CONSTRAINT plant_pkey PRIMARY KEY (plant_id);
3357
3358
3359
--
3360
-- Name: plantobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3361
--
3362
3363
ALTER TABLE plantobservation
3364
    ADD CONSTRAINT plantobservation_pkey PRIMARY KEY (plantobservation_id);
3365
3366
3367
--
3368 1113 aaronmk
-- Name: project_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3369 689 aaronmk
--
3370
3371
ALTER TABLE project
3372 1113 aaronmk
    ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);
3373 689 aaronmk
3374
3375
--
3376 1113 aaronmk
-- Name: project_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3377 689 aaronmk
--
3378
3379
ALTER TABLE project
3380 5242 aaronmk
    ADD CONSTRAINT project_unique UNIQUE (creator_id, projectname);
3381 689 aaronmk
3382
3383
--
3384
-- Name: projectcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3385
--
3386
3387
ALTER TABLE projectcontributor
3388
    ADD CONSTRAINT projectcontributor_pkey PRIMARY KEY (projectcontributor_id);
3389
3390
3391
--
3392
-- Name: reference_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3393
--
3394
3395
ALTER TABLE reference
3396
    ADD CONSTRAINT reference_pkey PRIMARY KEY (reference_id);
3397
3398
3399
--
3400
-- Name: referencealtident_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3401
--
3402
3403
ALTER TABLE referencealtident
3404
    ADD CONSTRAINT referencealtident_pkey PRIMARY KEY (referencealtident_id);
3405
3406
3407
--
3408
-- Name: referencecontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3409
--
3410
3411
ALTER TABLE referencecontributor
3412
    ADD CONSTRAINT referencecontributor_pkey PRIMARY KEY (referencecontributor_id);
3413
3414
3415
--
3416
-- Name: referencejournal_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3417
--
3418
3419
ALTER TABLE referencejournal
3420
    ADD CONSTRAINT referencejournal_pkey PRIMARY KEY (referencejournal_id);
3421
3422
3423
--
3424
-- Name: referenceparty_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3425
--
3426
3427
ALTER TABLE referenceparty
3428
    ADD CONSTRAINT referenceparty_pkey PRIMARY KEY (referenceparty_id);
3429
3430
3431
--
3432
-- Name: revision_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3433
--
3434
3435
ALTER TABLE revision
3436
    ADD CONSTRAINT revision_pkey PRIMARY KEY (revision_id);
3437
3438
3439
--
3440 1113 aaronmk
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3441 689 aaronmk
--
3442
3443
ALTER TABLE soilobs
3444 1113 aaronmk
    ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);
3445 689 aaronmk
3446
3447
--
3448 1113 aaronmk
-- Name: soilobs_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3449 689 aaronmk
--
3450
3451
ALTER TABLE soilobs
3452 1113 aaronmk
    ADD CONSTRAINT soilobs_unique UNIQUE (locationevent_id);
3453 689 aaronmk
3454
3455
--
3456
-- Name: soiltaxon_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3457
--
3458
3459
ALTER TABLE soiltaxon
3460
    ADD CONSTRAINT soiltaxon_pkey PRIMARY KEY (soiltaxon_id);
3461
3462
3463
--
3464
-- Name: specimen_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3465
--
3466
3467
ALTER TABLE specimen
3468
    ADD CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id);
3469
3470
3471
--
3472 1113 aaronmk
-- Name: specimenreplicate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3473 689 aaronmk
--
3474
3475
ALTER TABLE specimenreplicate
3476 3934 aaronmk
    ADD CONSTRAINT specimenreplicate_pkey PRIMARY KEY (specimenreplicate_id);
3477 689 aaronmk
3478
3479
--
3480 1113 aaronmk
-- Name: stemobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3481 689 aaronmk
--
3482
3483
ALTER TABLE stemobservation
3484 1113 aaronmk
    ADD CONSTRAINT stemobservation_pkey PRIMARY KEY (stemobservation_id);
3485 689 aaronmk
3486
3487
--
3488
-- Name: stratum_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3489
--
3490
3491
ALTER TABLE stratum
3492
    ADD CONSTRAINT stratum_pkey PRIMARY KEY (stratum_id);
3493
3494
3495
--
3496
-- Name: taxonalt_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3497
--
3498
3499
ALTER TABLE taxonalt
3500
    ADD CONSTRAINT taxonalt_pkey PRIMARY KEY (taxonalt_id);
3501
3502
3503
--
3504 5274 aaronmk
-- Name: taxonconcept_ancestor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3505
--
3506
3507
ALTER TABLE taxonconcept_ancestor
3508
    ADD CONSTRAINT taxonconcept_ancestor_pkey PRIMARY KEY (taxonconcept_id, ancestor_id);
3509
3510
3511
--
3512 5225 aaronmk
-- Name: taxonconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3513
--
3514
3515
ALTER TABLE taxonconcept
3516
    ADD CONSTRAINT taxonconcept_pkey PRIMARY KEY (taxonconcept_id);
3517
3518
3519
--
3520 5286 aaronmk
-- Name: taxoncorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3521
--
3522
3523
ALTER TABLE taxoncorrelation
3524
    ADD CONSTRAINT taxoncorrelation_pkey PRIMARY KEY (taxoncorrelation_id);
3525
3526
3527
--
3528 689 aaronmk
-- Name: taxondetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3529
--
3530
3531
ALTER TABLE taxondetermination
3532
    ADD CONSTRAINT taxondetermination_pkey PRIMARY KEY (taxondetermination_id);
3533
3534
3535
--
3536 5286 aaronmk
-- Name: taxonlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3537
--
3538
3539
ALTER TABLE taxonlineage
3540
    ADD CONSTRAINT taxonlineage_pkey PRIMARY KEY (taxonlineage_id);
3541
3542
3543
--
3544 689 aaronmk
-- Name: taxonoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3545
--
3546
3547
ALTER TABLE taxonoccurrence
3548
    ADD CONSTRAINT taxonoccurrence_pkey PRIMARY KEY (taxonoccurrence_id);
3549
3550
3551
--
3552 5286 aaronmk
-- Name: taxonstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3553
--
3554
3555
ALTER TABLE taxonstatus
3556
    ADD CONSTRAINT taxonstatus_pkey PRIMARY KEY (taxonstatus_id);
3557
3558
3559
--
3560
-- Name: taxonstatus_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3561
--
3562
3563
ALTER TABLE taxonstatus
3564
    ADD CONSTRAINT taxonstatus_unique UNIQUE (taxonconcept_id, party_id);
3565
3566
3567
--
3568
-- Name: taxonusage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3569
--
3570
3571
ALTER TABLE taxonusage
3572
    ADD CONSTRAINT taxonusage_pkey PRIMARY KEY (taxonusage_id);
3573
3574
3575
--
3576 689 aaronmk
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3577
--
3578
3579
ALTER TABLE telephone
3580
    ADD CONSTRAINT telephone_pkey PRIMARY KEY (telephone_id);
3581
3582
3583
--
3584
-- Name: trait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3585
--
3586
3587
ALTER TABLE trait
3588
    ADD CONSTRAINT trait_pkey PRIMARY KEY (trait_id);
3589
3590
3591
--
3592
-- Name: userdefined_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3593
--
3594
3595
ALTER TABLE userdefined
3596
    ADD CONSTRAINT userdefined_pkey PRIMARY KEY (userdefined_id);
3597
3598
3599
--
3600 1221 aaronmk
-- Name: userdefined_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3601
--
3602
3603
ALTER TABLE userdefined
3604
    ADD CONSTRAINT userdefined_unique UNIQUE (tablename, userdefinedname);
3605
3606
3607
--
3608 1113 aaronmk
-- Name: voucher_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3609 689 aaronmk
--
3610
3611
ALTER TABLE voucher
3612 1113 aaronmk
    ADD CONSTRAINT voucher_pkey PRIMARY KEY (voucher_id);
3613 689 aaronmk
3614
3615
--
3616 1113 aaronmk
-- Name: voucher_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
3617 689 aaronmk
--
3618
3619
ALTER TABLE voucher
3620 1113 aaronmk
    ADD CONSTRAINT voucher_unique UNIQUE (taxonoccurrence_id, specimenreplicate_id);
3621 689 aaronmk
3622
3623
--
3624 4791 aaronmk
-- Name: aggregateoccurrence_taxonoccurrence; Type: INDEX; Schema: public; Owner: -; Tablespace:
3625
--
3626
3627
CREATE INDEX aggregateoccurrence_taxonoccurrence ON aggregateoccurrence  (taxonoccurrence_id);
3628
3629
3630
--
3631 3737 aaronmk
-- Name: aggregateoccurrence_taxonoccurrence_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace:
3632 3615 aaronmk
--
3633
3634
3635
3636
3637
--
3638 5242 aaronmk
-- Name: aggregateoccurrence_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3639 3712 aaronmk
--
3640
3641
3642
3643
3644
--
3645 689 aaronmk
-- Name: commclass_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3646
--
3647
3648
CREATE UNIQUE INDEX commclass_accessioncode_index ON commclass  (accessioncode);
3649
3650
3651
--
3652 3214 aaronmk
-- Name: commclass_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3653
--
3654
3655
3656
3657
3658
--
3659 689 aaronmk
-- Name: commconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3660
--
3661
3662
CREATE UNIQUE INDEX commconcept_accessioncode_index ON commconcept  (accessioncode);
3663
3664
3665
--
3666
-- Name: commstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3667
--
3668
3669
CREATE UNIQUE INDEX commstatus_accessioncode_index ON commstatus  (accessioncode);
3670
3671
3672
--
3673
-- Name: covermethod_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3674
--
3675
3676
CREATE UNIQUE INDEX covermethod_accessioncode_index ON covermethod  (accessioncode);
3677
3678
3679
--
3680
-- Name: graphic_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3681
--
3682
3683
CREATE UNIQUE INDEX graphic_accessioncode_index ON graphic  (accessioncode);
3684
3685
3686
--
3687
-- Name: location_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3688
--
3689
3690
CREATE UNIQUE INDEX location_accessioncode_index ON location  (accessioncode);
3691
3692
3693
--
3694 5242 aaronmk
-- Name: location_unique_within_creator_by_authorlocationcode; Type: INDEX; Schema: public; Owner: -; Tablespace:
3695 3989 aaronmk
--
3696
3697
3698
3699
3700
--
3701 5242 aaronmk
-- Name: location_unique_within_creator_by_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace:
3702 3615 aaronmk
--
3703
3704
3705
3706 3997 aaronmk
3707 3615 aaronmk
--
3708 3988 aaronmk
-- Name: location_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace:
3709 3986 aaronmk
--
3710
3711
3712
3713
3714
--
3715 4726 aaronmk
-- Name: locationcoords_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3716
--
3717
3718
3719
3720
3721
--
3722 689 aaronmk
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3723
--
3724
3725
CREATE UNIQUE INDEX locationevent_accessioncode_index ON locationevent  (accessioncode);
3726
3727
3728
--
3729 4791 aaronmk
-- Name: locationevent_location; Type: INDEX; Schema: public; Owner: -; Tablespace:
3730
--
3731
3732
CREATE INDEX locationevent_location ON locationevent  (location_id);
3733
3734
3735
--
3736 5242 aaronmk
-- Name: locationevent_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3737 689 aaronmk
--
3738
3739
3740
3741 3219 aaronmk
3742 689 aaronmk
--
3743 3733 aaronmk
-- Name: locationevent_unique_within_location; Type: INDEX; Schema: public; Owner: -; Tablespace:
3744 3615 aaronmk
--
3745
3746
3747
3748
3749
--
3750 3953 aaronmk
-- Name: locationevent_unique_within_parent_by_authoreventcode; Type: INDEX; Schema: public; Owner: -; Tablespace:
3751 689 aaronmk
--
3752
3753
3754
3755 3234 aaronmk
3756 689 aaronmk
--
3757 3733 aaronmk
-- Name: locationevent_unique_within_parent_by_location; Type: INDEX; Schema: public; Owner: -; Tablespace:
3758 2886 aaronmk
--
3759
3760
3761
3762
3763
--
3764 3733 aaronmk
-- Name: locationevent_unique_within_project; Type: INDEX; Schema: public; Owner: -; Tablespace:
3765 3202 aaronmk
--
3766
3767
3768
3769
3770
--
3771 689 aaronmk
-- Name: locationeventsynonym_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3772
--
3773
3774
CREATE UNIQUE INDEX locationeventsynonym_accessioncode_index ON locationeventsynonym  (accessioncode);
3775
3776
3777
--
3778 4734 aaronmk
-- Name: locationplace_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3779
--
3780
3781
3782
3783
3784
--
3785 907 aaronmk
-- Name: method_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace:
3786
--
3787
3788
CREATE UNIQUE INDEX method_accessioncode ON method  (accessioncode);
3789
3790
3791
--
3792 1113 aaronmk
-- Name: method_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3793 1067 aaronmk
--
3794
3795
3796
3797
3798
--
3799 4730 aaronmk
-- Name: note_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3800 689 aaronmk
--
3801
3802 4730 aaronmk
CREATE UNIQUE INDEX note_accessioncode_index ON note  (accessioncode);
3803 689 aaronmk
3804
3805
--
3806 4730 aaronmk
-- Name: party_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3807 2869 aaronmk
--
3808
3809 4730 aaronmk
CREATE UNIQUE INDEX party_accessioncode_index ON party  (accessioncode);
3810 2869 aaronmk
3811
3812
--
3813 5236 aaronmk
-- Name: party_unique_root; Type: INDEX; Schema: public; Owner: -; Tablespace:
3814 689 aaronmk
--
3815
3816
3817
3818 4730 aaronmk
3819 689 aaronmk
--
3820 5242 aaronmk
-- Name: party_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3821 5236 aaronmk
--
3822
3823
3824
3825
3826
--
3827 4730 aaronmk
-- Name: place_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3828 689 aaronmk
--
3829
3830 4730 aaronmk
CREATE UNIQUE INDEX place_accessioncode_index ON place  (accessioncode);
3831 689 aaronmk
3832
3833
--
3834 4730 aaronmk
-- Name: place_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3835 1247 aaronmk
--
3836
3837
3838
3839
3840
--
3841 5242 aaronmk
-- Name: placepath_unique_within_creator_by_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
3842 4727 aaronmk
--
3843
3844
3845
3846
3847
--
3848 5242 aaronmk
-- Name: placepath_unique_within_creator_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
3849 4727 aaronmk
--
3850
3851
3852
3853
3854
--
3855 3735 aaronmk
-- Name: plantobservation_aggregateoccurrence_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace:
3856
--
3857
3858
CREATE UNIQUE INDEX plantobservation_aggregateoccurrence_1_to_1 ON plantobservation  (aggregateoccurrence_id);
3859
3860
3861
--
3862 5242 aaronmk
-- Name: plantobservation_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3863 3615 aaronmk
--
3864
3865
3866
3867
3868
--
3869 689 aaronmk
-- Name: project_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3870
--
3871
3872
CREATE UNIQUE INDEX project_accessioncode_index ON project  (accessioncode);
3873
3874
3875
--
3876 4468 aaronmk
-- Name: project_unique_name_date; Type: INDEX; Schema: public; Owner: -; Tablespace:
3877
--
3878
3879
3880
3881
3882
--
3883 5242 aaronmk
-- Name: project_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3884 3615 aaronmk
--
3885
3886
3887
3888
3889
--
3890 689 aaronmk
-- Name: reference_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3891
--
3892
3893
CREATE UNIQUE INDEX reference_accessioncode_index ON reference  (accessioncode);
3894
3895
3896
--
3897
-- Name: referencejournal_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3898
--
3899
3900
CREATE UNIQUE INDEX referencejournal_accessioncode_index ON referencejournal  (accessioncode);
3901
3902
3903
--
3904
-- Name: referenceparty_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3905
--
3906
3907
CREATE UNIQUE INDEX referenceparty_accessioncode_index ON referenceparty  (accessioncode);
3908
3909
3910
--
3911
-- Name: soiltaxon_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3912
--
3913
3914
CREATE UNIQUE INDEX soiltaxon_accessioncode_index ON soiltaxon  (accessioncode);
3915
3916
3917
--
3918 4792 aaronmk
-- Name: specimenreplicate_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace:
3919
--
3920
3921
CREATE INDEX specimenreplicate_plantobservation ON specimenreplicate  (plantobservation_id);
3922
3923
3924
--
3925 3734 aaronmk
-- Name: specimenreplicate_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace:
3926 3232 aaronmk
--
3927
3928
3929
3930
3931
--
3932 3734 aaronmk
-- Name: specimenreplicate_unique_catalognumber; Type: INDEX; Schema: public; Owner: -; Tablespace:
3933 1253 aaronmk
--
3934
3935
3936
3937
3938
--
3939 5242 aaronmk
-- Name: specimenreplicate_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3940 3342 aaronmk
--
3941
3942
3943
3944
3945
--
3946 3736 aaronmk
-- Name: stemobservation_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace:
3947 3615 aaronmk
--
3948
3949
3950
3951
3952
--
3953 5242 aaronmk
-- Name: stemobservation_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
3954 3727 aaronmk
--
3955
3956
3957
3958
3959
--
3960 3740 aaronmk
-- Name: stemobservation_unique_within_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace:
3961
--
3962
3963
3964
3965
3966
--
3967 5297 aaronmk
-- Name: taxonconcept_0_unique_identifying_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
3968 689 aaronmk
--
3969
3970
3971
3972 5297 aaronmk
3973 689 aaronmk
--
3974 5469 aaronmk
-- Name: taxonconcept_1_unique_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace:
3975
--
3976
3977
3978
3979
3980
--
3981 5297 aaronmk
-- Name: taxonconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
3982 1113 aaronmk
--
3983
3984 5297 aaronmk
CREATE UNIQUE INDEX taxonconcept_accessioncode_index ON taxonconcept  (accessioncode);
3985 1113 aaronmk
3986
3987
--
3988 5517 aaronmk
-- Name: taxonconcept_matched_concept_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
3989
--
3990
3991
CREATE INDEX taxonconcept_matched_concept_id_idx ON taxonconcept  (matched_concept_id);
3992
3993
3994
--
3995 5298 aaronmk
-- Name: taxonconcept_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
3996 5267 aaronmk
--
3997
3998
3999
4000
4001
--
4002 5225 aaronmk
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
4003 4791 aaronmk
--
4004
4005 5225 aaronmk
CREATE UNIQUE INDEX taxondetermination_accessioncode_index ON taxondetermination  (accessioncode);
4006 4791 aaronmk
4007
4008
--
4009 5225 aaronmk
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
4010 3615 aaronmk
--
4011
4012
4013
4014
4015
--
4016 5225 aaronmk
-- Name: taxonoccurrence_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
4017 3711 aaronmk
--
4018
4019 5225 aaronmk
CREATE UNIQUE INDEX taxonoccurrence_accessioncode_index ON taxonoccurrence  (accessioncode);
4020 3711 aaronmk
4021
4022
--
4023 5225 aaronmk
-- Name: taxonoccurrence_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
4024 4718 aaronmk
--
4025
4026 5225 aaronmk
CREATE INDEX taxonoccurrence_locationevent ON taxonoccurrence  (locationevent_id);
4027 4718 aaronmk
4028
4029
--
4030 5242 aaronmk
-- Name: taxonoccurrence_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace:
4031 4718 aaronmk
--
4032
4033
4034
4035 5134 aaronmk
4036 4718 aaronmk
--
4037 5225 aaronmk
-- Name: taxonoccurrence_unique_within_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
4038 5134 aaronmk
--
4039
4040
4041
4042
4043
--
4044 5286 aaronmk
-- Name: taxonstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
4045
--
4046
4047
CREATE UNIQUE INDEX taxonstatus_accessioncode_index ON taxonstatus  (accessioncode);
4048
4049
4050
--
4051 689 aaronmk
-- Name: userdefined_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
4052
--
4053
4054
CREATE UNIQUE INDEX userdefined_accessioncode_index ON userdefined  (accessioncode);
4055
4056
4057
--
4058 5242 aaronmk
-- Name: party_creator_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4059 5234 aaronmk
--
4060
4061
4062
4063
4064
--
4065 4730 aaronmk
-- Name: place_update_ancestors; Type: TRIGGER; Schema: public; Owner: -
4066 704 aaronmk
--
4067
4068
4069
4070 705 aaronmk
4071 704 aaronmk
--
4072 5465 aaronmk
-- Name: placepath_matched_placepath_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4073 5032 aaronmk
--
4074
4075
4076
4077
4078
--
4079 4717 aaronmk
-- Name: plantobservation_aggregateoccurrence_count_1; Type: TRIGGER; Schema: public; Owner: -
4080 1555 aaronmk
--
4081
4082
4083
4084
4085
--
4086 5465 aaronmk
-- Name: taxonconcept_0_matched_concept_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4087 5032 aaronmk
--
4088
4089
4090
4091
4092
--
4093 5465 aaronmk
-- Name: taxonconcept_1_matched_concept_min_fit; Type: TRIGGER; Schema: public; Owner: -
4094 5412 aaronmk
--
4095
4096
4097
4098
4099
--
4100 5473 aaronmk
-- Name: taxonconcept_2_propagate_accepted_concept_id; Type: TRIGGER; Schema: public; Owner: -
4101
--
4102
4103
4104
4105
4106
--
4107 5274 aaronmk
-- Name: taxonconcept_update_ancestors; Type: TRIGGER; Schema: public; Owner: -
4108
--
4109
4110
4111
4112
4113
--
4114 3731 aaronmk
-- Name: address_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4115 689 aaronmk
--
4116
4117
ALTER TABLE address
4118 3731 aaronmk
    ADD CONSTRAINT address_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4119 689 aaronmk
4120
4121
--
4122 3731 aaronmk
-- Name: address_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4123 689 aaronmk
--
4124
4125
ALTER TABLE address
4126 3731 aaronmk
    ADD CONSTRAINT address_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4127 689 aaronmk
4128
4129
--
4130 3731 aaronmk
-- Name: aggregateoccurrence_coverindex_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4131 1151 aaronmk
--
4132
4133
4134
4135 3992 aaronmk
4136 1151 aaronmk
--
4137 5242 aaronmk
-- Name: aggregateoccurrence_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4138 3654 aaronmk
--
4139
4140
4141
4142
4143
--
4144 3731 aaronmk
-- Name: aggregateoccurrence_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4145 1028 aaronmk
--
4146
4147
4148
4149 3992 aaronmk
4150 1028 aaronmk
--
4151 3731 aaronmk
-- Name: aggregateoccurrence_stratum_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4152 689 aaronmk
--
4153
4154
ALTER TABLE aggregateoccurrence
4155 3731 aaronmk
    ADD CONSTRAINT aggregateoccurrence_stratum_id_fkey FOREIGN KEY (stratum_id) REFERENCES stratum(stratum_id) ON UPDATE CASCADE ON DELETE CASCADE;
4156 689 aaronmk
4157
4158
--
4159 3731 aaronmk
-- Name: aggregateoccurrence_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4160 689 aaronmk
--
4161
4162
ALTER TABLE aggregateoccurrence
4163 3731 aaronmk
    ADD CONSTRAINT aggregateoccurrence_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4164 689 aaronmk
4165
4166
--
4167 3731 aaronmk
-- Name: classcontributor_commclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4168 689 aaronmk
--
4169
4170
ALTER TABLE classcontributor
4171 3731 aaronmk
    ADD CONSTRAINT classcontributor_commclass_id_fkey FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id) ON UPDATE CASCADE ON DELETE CASCADE;
4172 689 aaronmk
4173
4174
--
4175 3731 aaronmk
-- Name: classcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4176 689 aaronmk
--
4177
4178
4179
4180 812 aaronmk
4181 689 aaronmk
--
4182 3731 aaronmk
-- Name: commclass_classpublication_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4183 689 aaronmk
--
4184
4185
4186
4187 812 aaronmk
4188 689 aaronmk
--
4189 3731 aaronmk
-- Name: commclass_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4190 689 aaronmk
--
4191
4192
4193
4194 3992 aaronmk
4195 689 aaronmk
--
4196 3731 aaronmk
-- Name: commconcept_commname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4197 689 aaronmk
--
4198
4199
ALTER TABLE commconcept
4200 3731 aaronmk
    ADD CONSTRAINT commconcept_commname_id_fkey FOREIGN KEY (commname_id) REFERENCES commname(commname_id) ON UPDATE CASCADE ON DELETE CASCADE;
4201 689 aaronmk
4202
4203
--
4204 3731 aaronmk
-- Name: commconcept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4205 689 aaronmk
--
4206
4207
4208
4209 812 aaronmk
4210 689 aaronmk
--
4211 3731 aaronmk
-- Name: commcorrelation_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4212 689 aaronmk
--
4213
4214
ALTER TABLE commcorrelation
4215 3731 aaronmk
    ADD CONSTRAINT commcorrelation_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4216 689 aaronmk
4217
4218
--
4219 3731 aaronmk
-- Name: commcorrelation_commstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4220 689 aaronmk
--
4221
4222
ALTER TABLE commcorrelation
4223 3731 aaronmk
    ADD CONSTRAINT commcorrelation_commstatus_id_fkey FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4224 689 aaronmk
4225
4226
--
4227 3731 aaronmk
-- Name: commdetermination_commauthority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4228 689 aaronmk
--
4229
4230
4231
4232 812 aaronmk
4233 689 aaronmk
--
4234 3731 aaronmk
-- Name: commdetermination_commclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4235 689 aaronmk
--
4236
4237
ALTER TABLE commdetermination
4238 3731 aaronmk
    ADD CONSTRAINT commdetermination_commclass_id_fkey FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id) ON UPDATE CASCADE ON DELETE CASCADE;
4239 689 aaronmk
4240
4241
--
4242 3731 aaronmk
-- Name: commdetermination_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4243 689 aaronmk
--
4244
4245
ALTER TABLE commdetermination
4246 3731 aaronmk
    ADD CONSTRAINT commdetermination_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4247 689 aaronmk
4248
4249
--
4250 3731 aaronmk
-- Name: commlineage_childcommstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4251 689 aaronmk
--
4252
4253
ALTER TABLE commlineage
4254 3731 aaronmk
    ADD CONSTRAINT commlineage_childcommstatus_id_fkey FOREIGN KEY (childcommstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4255 689 aaronmk
4256
4257
--
4258 3731 aaronmk
-- Name: commlineage_parentcommstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4259 689 aaronmk
--
4260
4261
ALTER TABLE commlineage
4262 3731 aaronmk
    ADD CONSTRAINT commlineage_parentcommstatus_id_fkey FOREIGN KEY (parentcommstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4263 689 aaronmk
4264
4265
--
4266 3731 aaronmk
-- Name: commname_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4267 689 aaronmk
--
4268
4269
4270
4271 812 aaronmk
4272 689 aaronmk
--
4273 3731 aaronmk
-- Name: commstatus_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4274 689 aaronmk
--
4275
4276
ALTER TABLE commstatus
4277 3731 aaronmk
    ADD CONSTRAINT commstatus_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4278 689 aaronmk
4279
4280
--
4281 3731 aaronmk
-- Name: commstatus_commparent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4282 689 aaronmk
--
4283
4284
ALTER TABLE commstatus
4285 3731 aaronmk
    ADD CONSTRAINT commstatus_commparent_id_fkey FOREIGN KEY (commparent_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4286 689 aaronmk
4287
4288
--
4289 3731 aaronmk
-- Name: commstatus_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4290 689 aaronmk
--
4291
4292
4293
4294 812 aaronmk
4295 689 aaronmk
--
4296 3731 aaronmk
-- Name: commstatus_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4297 689 aaronmk
--
4298
4299
4300
4301 812 aaronmk
4302 689 aaronmk
--
4303 3731 aaronmk
-- Name: commusage_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4304 689 aaronmk
--
4305
4306
ALTER TABLE commusage
4307 3731 aaronmk
    ADD CONSTRAINT commusage_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4308 689 aaronmk
4309
4310
--
4311 3731 aaronmk
-- Name: commusage_commname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4312 689 aaronmk
--
4313
4314
ALTER TABLE commusage
4315 3731 aaronmk
    ADD CONSTRAINT commusage_commname_id_fkey FOREIGN KEY (commname_id) REFERENCES commname(commname_id) ON UPDATE CASCADE ON DELETE CASCADE;
4316 689 aaronmk
4317
4318
--
4319 3731 aaronmk
-- Name: commusage_commstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4320 689 aaronmk
--
4321
4322
ALTER TABLE commusage
4323 3731 aaronmk
    ADD CONSTRAINT commusage_commstatus_id_fkey FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4324 689 aaronmk
4325
4326
--
4327 3731 aaronmk
-- Name: commusage_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4328 689 aaronmk
--
4329
4330
4331
4332 812 aaronmk
4333 689 aaronmk
--
4334 3731 aaronmk
-- Name: coverindex_covermethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4335 689 aaronmk
--
4336
4337
ALTER TABLE coverindex
4338 3731 aaronmk
    ADD CONSTRAINT coverindex_covermethod_id_fkey FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
4339 689 aaronmk
4340
4341
--
4342 3731 aaronmk
-- Name: covermethod_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4343 689 aaronmk
--
4344
4345
4346
4347 812 aaronmk
4348 689 aaronmk
--
4349 3731 aaronmk
-- Name: definedvalue_userdefined_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4350 689 aaronmk
--
4351
4352
ALTER TABLE definedvalue
4353 3731 aaronmk
    ADD CONSTRAINT definedvalue_userdefined_id_fkey FOREIGN KEY (userdefined_id) REFERENCES userdefined(userdefined_id) ON UPDATE CASCADE ON DELETE CASCADE;
4354 689 aaronmk
4355
4356
--
4357 3731 aaronmk
-- Name: disturbanceobs_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4358 689 aaronmk
--
4359
4360
ALTER TABLE disturbanceobs
4361 3731 aaronmk
    ADD CONSTRAINT disturbanceobs_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4362 689 aaronmk
4363
4364
--
4365 3731 aaronmk
-- Name: graphic_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4366 689 aaronmk
--
4367
4368
ALTER TABLE graphic
4369 3731 aaronmk
    ADD CONSTRAINT graphic_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4370 689 aaronmk
4371
4372
--
4373 5242 aaronmk
-- Name: location_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4374 3201 aaronmk
--
4375
4376
4377
4378
4379
--
4380 3731 aaronmk
-- Name: location_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4381 689 aaronmk
--
4382
4383
ALTER TABLE location
4384 3731 aaronmk
    ADD CONSTRAINT location_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4385 689 aaronmk
4386
4387
--
4388 4726 aaronmk
-- Name: locationcoords_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4389 906 aaronmk
--
4390
4391
4392
4393
4394
--
4395 4726 aaronmk
-- Name: locationcoords_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4396 906 aaronmk
--
4397
4398 4726 aaronmk
ALTER TABLE locationcoords
4399
    ADD CONSTRAINT locationcoords_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4400 906 aaronmk
4401
4402
--
4403 5242 aaronmk
-- Name: locationevent_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4404 3654 aaronmk
--
4405
4406
4407
4408
4409
--
4410 3731 aaronmk
-- Name: locationevent_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4411 689 aaronmk
--
4412
4413
ALTER TABLE locationevent
4414 3731 aaronmk
    ADD CONSTRAINT locationevent_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4415 689 aaronmk
4416
4417
--
4418 3731 aaronmk
-- Name: locationevent_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4419 898 aaronmk
--
4420
4421
4422
4423 3992 aaronmk
4424 898 aaronmk
--
4425 3731 aaronmk
-- Name: locationevent_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4426 910 aaronmk
--
4427
4428
ALTER TABLE locationevent
4429 3731 aaronmk
    ADD CONSTRAINT locationevent_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4430 910 aaronmk
4431
4432
--
4433 3731 aaronmk
-- Name: locationevent_previous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4434 689 aaronmk
--
4435
4436
ALTER TABLE locationevent
4437 3731 aaronmk
    ADD CONSTRAINT locationevent_previous_id_fkey FOREIGN KEY (previous_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4438 689 aaronmk
4439
4440
--
4441 3731 aaronmk
-- Name: locationevent_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4442 689 aaronmk
--
4443
4444
ALTER TABLE locationevent
4445 3731 aaronmk
    ADD CONSTRAINT locationevent_project_id_fkey FOREIGN KEY (project_id) REFERENCES project(project_id) ON UPDATE CASCADE ON DELETE CASCADE;
4446 689 aaronmk
4447
4448
--
4449 3731 aaronmk
-- Name: locationevent_soiltaxon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4450 689 aaronmk
--
4451
4452
ALTER TABLE locationevent
4453 3731 aaronmk
    ADD CONSTRAINT locationevent_soiltaxon_id_fkey FOREIGN KEY (soiltaxon_id) REFERENCES soiltaxon(soiltaxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
4454 689 aaronmk
4455
4456
--
4457 3731 aaronmk
-- Name: locationeventcontributor_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4458 689 aaronmk
--
4459
4460
ALTER TABLE locationeventcontributor
4461 3731 aaronmk
    ADD CONSTRAINT locationeventcontributor_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4462 689 aaronmk
4463
4464
--
4465 3731 aaronmk
-- Name: locationeventcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4466 689 aaronmk
--
4467
4468
4469
4470 812 aaronmk
4471 689 aaronmk
--
4472 3731 aaronmk
-- Name: locationeventsynonym_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4473 689 aaronmk
--
4474
4475
4476
4477 812 aaronmk
4478 689 aaronmk
--
4479 3731 aaronmk
-- Name: locationeventsynonym_primarylocationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4480 689 aaronmk
--
4481
4482
ALTER TABLE locationeventsynonym
4483 3731 aaronmk
    ADD CONSTRAINT locationeventsynonym_primarylocationevent_id_fkey FOREIGN KEY (primarylocationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4484 689 aaronmk
4485
4486
--
4487 3731 aaronmk
-- Name: locationeventsynonym_synonymlocationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4488 689 aaronmk
--
4489
4490
ALTER TABLE locationeventsynonym
4491 3731 aaronmk
    ADD CONSTRAINT locationeventsynonym_synonymlocationevent_id_fkey FOREIGN KEY (synonymlocationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4492 689 aaronmk
4493
4494
--
4495 4734 aaronmk
-- Name: locationplace_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4496
--
4497
4498
4499
4500
4501
--
4502 4726 aaronmk
-- Name: locationplace_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4503
--
4504
4505
ALTER TABLE locationplace
4506
    ADD CONSTRAINT locationplace_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4507
4508
4509
--
4510 4727 aaronmk
-- Name: locationplace_placepath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4511 4726 aaronmk
--
4512
4513
ALTER TABLE locationplace
4514 4727 aaronmk
    ADD CONSTRAINT locationplace_placepath_id_fkey FOREIGN KEY (placepath_id) REFERENCES placepath(placepath_id) ON UPDATE CASCADE ON DELETE CASCADE;
4515 4726 aaronmk
4516
4517
--
4518 3731 aaronmk
-- Name: method_covermethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4519 1031 aaronmk
--
4520
4521
ALTER TABLE method
4522 3731 aaronmk
    ADD CONSTRAINT method_covermethod_id_fkey FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
4523 1031 aaronmk
4524
4525
--
4526 3731 aaronmk
-- Name: method_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4527 907 aaronmk
--
4528
4529
4530
4531
4532
--
4533 3731 aaronmk
-- Name: method_subplotmethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4534 1162 aaronmk
--
4535
4536
ALTER TABLE method
4537 3731 aaronmk
    ADD CONSTRAINT method_subplotmethod_id_fkey FOREIGN KEY (subplotmethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
4538 1162 aaronmk
4539
4540
--
4541 3731 aaronmk
-- Name: methodtaxonclass_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4542 1101 aaronmk
--
4543
4544
ALTER TABLE methodtaxonclass
4545 3731 aaronmk
    ADD CONSTRAINT methodtaxonclass_method_id_fkey FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
4546 1101 aaronmk
4547
4548
--
4549 4718 aaronmk
-- Name: methodtaxonclass_submethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4550 1101 aaronmk
--
4551
4552
ALTER TABLE methodtaxonclass
4553 4718 aaronmk
    ADD CONSTRAINT methodtaxonclass_submethod_id_fkey FOREIGN KEY (submethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
4554 1101 aaronmk
4555
4556
--
4557 5225 aaronmk
-- Name: methodtaxonclass_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4558 1105 aaronmk
--
4559
4560
ALTER TABLE methodtaxonclass
4561 5225 aaronmk
    ADD CONSTRAINT methodtaxonclass_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4562 1105 aaronmk
4563
4564
--
4565 4730 aaronmk
-- Name: note_notelink_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4566 1555 aaronmk
--
4567
4568 4730 aaronmk
ALTER TABLE note
4569
    ADD CONSTRAINT note_notelink_id_fkey FOREIGN KEY (notelink_id) REFERENCES notelink(notelink_id) ON UPDATE CASCADE ON DELETE CASCADE;
4570 1555 aaronmk
4571
4572
--
4573 4730 aaronmk
-- Name: note_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4574 1555 aaronmk
--
4575
4576
4577
4578 4730 aaronmk
4579 1555 aaronmk
--
4580 5242 aaronmk
-- Name: party_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4581 689 aaronmk
--
4582
4583 4730 aaronmk
ALTER TABLE party
4584 5242 aaronmk
    ADD CONSTRAINT party_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4585 689 aaronmk
4586
4587
--
4588 5242 aaronmk
-- Name: party_currentname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4589 5234 aaronmk
--
4590
4591
ALTER TABLE party
4592 5242 aaronmk
    ADD CONSTRAINT party_currentname_id_fkey FOREIGN KEY (currentname_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4593 5234 aaronmk
4594
4595
--
4596 4730 aaronmk
-- Name: partymember_childparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4597 689 aaronmk
--
4598
4599 4730 aaronmk
ALTER TABLE partymember
4600
    ADD CONSTRAINT partymember_childparty_id_fkey FOREIGN KEY (childparty_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4601 689 aaronmk
4602
4603
--
4604 4730 aaronmk
-- Name: partymember_parentparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4605 689 aaronmk
--
4606
4607 4730 aaronmk
ALTER TABLE partymember
4608
    ADD CONSTRAINT partymember_parentparty_id_fkey FOREIGN KEY (parentparty_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4609 689 aaronmk
4610
4611
--
4612 4730 aaronmk
-- Name: place_ancestor_ancestor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4613 689 aaronmk
--
4614
4615 4730 aaronmk
ALTER TABLE place_ancestor
4616
    ADD CONSTRAINT place_ancestor_ancestor_id_fkey FOREIGN KEY (ancestor_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4617 689 aaronmk
4618
4619
--
4620 4730 aaronmk
-- Name: place_ancestor_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4621 689 aaronmk
--
4622
4623 4730 aaronmk
ALTER TABLE place_ancestor
4624
    ADD CONSTRAINT place_ancestor_place_id_fkey FOREIGN KEY (place_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4625 689 aaronmk
4626
4627
--
4628 4730 aaronmk
-- Name: place_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4629 689 aaronmk
--
4630
4631 4730 aaronmk
ALTER TABLE place
4632
    ADD CONSTRAINT place_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4633 689 aaronmk
4634
4635
--
4636 4730 aaronmk
-- Name: placecorrelation_childplace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4637 689 aaronmk
--
4638
4639 4730 aaronmk
ALTER TABLE placecorrelation
4640
    ADD CONSTRAINT placecorrelation_childplace_id_fkey FOREIGN KEY (childplace_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4641 689 aaronmk
4642
4643
--
4644 4730 aaronmk
-- Name: placecorrelation_parentplace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4645 689 aaronmk
--
4646
4647 4730 aaronmk
ALTER TABLE placecorrelation
4648
    ADD CONSTRAINT placecorrelation_parentplace_id_fkey FOREIGN KEY (parentplace_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4649 689 aaronmk
4650
4651
--
4652 5465 aaronmk
-- Name: placepath_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4653 4970 aaronmk
--
4654
4655
4656
4657 5465 aaronmk
4658 4970 aaronmk
--
4659 5465 aaronmk
-- Name: placepath_matched_placepath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4660 4727 aaronmk
--
4661
4662 5465 aaronmk
ALTER TABLE placepath
4663
    ADD CONSTRAINT placepath_matched_placepath_id_fkey FOREIGN KEY (matched_placepath_id) REFERENCES placepath(placepath_id) ON UPDATE CASCADE ON DELETE CASCADE;
4664 4727 aaronmk
4665
4666
--
4667 4730 aaronmk
-- Name: placepath_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4668 4727 aaronmk
--
4669
4670
ALTER TABLE placepath
4671 4730 aaronmk
    ADD CONSTRAINT placepath_place_id_fkey FOREIGN KEY (place_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4672 4727 aaronmk
4673
4674
--
4675 3731 aaronmk
-- Name: plantobservation_aggregateoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4676 3722 aaronmk
--
4677
4678
ALTER TABLE plantobservation
4679 3731 aaronmk
    ADD CONSTRAINT plantobservation_aggregateoccurrence_id_fkey FOREIGN KEY (aggregateoccurrence_id) REFERENCES aggregateoccurrence(aggregateoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4680 3722 aaronmk
4681
4682
--
4683 5242 aaronmk
-- Name: plantobservation_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4684 3654 aaronmk
--
4685
4686
4687
4688
4689
--
4690 3731 aaronmk
-- Name: plantobservation_plant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4691 689 aaronmk
--
4692
4693
ALTER TABLE plantobservation
4694 3731 aaronmk
    ADD CONSTRAINT plantobservation_plant_id_fkey FOREIGN KEY (plant_id) REFERENCES plant(plant_id) ON UPDATE CASCADE ON DELETE CASCADE;
4695 689 aaronmk
4696
4697
--
4698 5242 aaronmk
-- Name: project_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4699 719 aaronmk
--
4700
4701
4702
4703 812 aaronmk
4704 719 aaronmk
--
4705 3731 aaronmk
-- Name: projectcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4706 689 aaronmk
--
4707
4708
4709
4710 812 aaronmk
4711 689 aaronmk
--
4712 3731 aaronmk
-- Name: projectcontributor_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4713 689 aaronmk
--
4714
4715
ALTER TABLE projectcontributor
4716 3731 aaronmk
    ADD CONSTRAINT projectcontributor_project_id_fkey FOREIGN KEY (project_id) REFERENCES project(project_id) ON UPDATE CASCADE ON DELETE CASCADE;
4717 689 aaronmk
4718
4719
--
4720 3731 aaronmk
-- Name: reference_referencejournal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4721 689 aaronmk
--
4722
4723
ALTER TABLE reference
4724 3731 aaronmk
    ADD CONSTRAINT reference_referencejournal_id_fkey FOREIGN KEY (referencejournal_id) REFERENCES referencejournal(referencejournal_id) ON UPDATE CASCADE ON DELETE CASCADE;
4725 689 aaronmk
4726
4727
--
4728 3731 aaronmk
-- Name: referencealtident_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4729 689 aaronmk
--
4730
4731
ALTER TABLE referencealtident
4732 3731 aaronmk
    ADD CONSTRAINT referencealtident_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
4733 689 aaronmk
4734
4735
--
4736 3731 aaronmk
-- Name: referencecontributor_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4737 689 aaronmk
--
4738
4739
ALTER TABLE referencecontributor
4740 3731 aaronmk
    ADD CONSTRAINT referencecontributor_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
4741 689 aaronmk
4742
4743
--
4744 3731 aaronmk
-- Name: referencecontributor_referenceparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4745 689 aaronmk
--
4746
4747
ALTER TABLE referencecontributor
4748 3731 aaronmk
    ADD CONSTRAINT referencecontributor_referenceparty_id_fkey FOREIGN KEY (referenceparty_id) REFERENCES referenceparty(referenceparty_id) ON UPDATE CASCADE ON DELETE CASCADE;
4749 689 aaronmk
4750
4751
--
4752 3731 aaronmk
-- Name: referenceparty_currentparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4753 689 aaronmk
--
4754
4755
ALTER TABLE referenceparty
4756 3731 aaronmk
    ADD CONSTRAINT referenceparty_currentparty_id_fkey FOREIGN KEY (currentparty_id) REFERENCES referenceparty(referenceparty_id) ON UPDATE CASCADE ON DELETE CASCADE;
4757 689 aaronmk
4758
4759
--
4760 3731 aaronmk
-- Name: revision_previousrevision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4761 689 aaronmk
--
4762
4763
ALTER TABLE revision
4764 3731 aaronmk
    ADD CONSTRAINT revision_previousrevision_id_fkey FOREIGN KEY (previousrevision_id) REFERENCES revision(revision_id) ON UPDATE CASCADE ON DELETE CASCADE;
4765 689 aaronmk
4766
4767
--
4768 3731 aaronmk
-- Name: soilobs_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4769 689 aaronmk
--
4770
4771
ALTER TABLE soilobs
4772 3731 aaronmk
    ADD CONSTRAINT soilobs_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4773 689 aaronmk
4774
4775
--
4776 3731 aaronmk
-- Name: soiltaxon_soilparent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4777 689 aaronmk
--
4778
4779
ALTER TABLE soiltaxon
4780 3731 aaronmk
    ADD CONSTRAINT soiltaxon_soilparent_id_fkey FOREIGN KEY (soilparent_id) REFERENCES soiltaxon(soiltaxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
4781 689 aaronmk
4782
4783
--
4784 5242 aaronmk
-- Name: specimenreplicate_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4785 689 aaronmk
--
4786
4787
4788
4789 812 aaronmk
4790 689 aaronmk
--
4791 3731 aaronmk
-- Name: specimenreplicate_institution_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4792 689 aaronmk
--
4793
4794
4795
4796 812 aaronmk
4797 689 aaronmk
--
4798 3731 aaronmk
-- Name: specimenreplicate_plantobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4799 3222 aaronmk
--
4800
4801
ALTER TABLE specimenreplicate
4802 3731 aaronmk
    ADD CONSTRAINT specimenreplicate_plantobservation_id_fkey FOREIGN KEY (plantobservation_id) REFERENCES plantobservation(plantobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
4803 3222 aaronmk
4804
4805
--
4806 3731 aaronmk
-- Name: specimenreplicate_specimen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4807 689 aaronmk
--
4808
4809
ALTER TABLE specimenreplicate
4810 3731 aaronmk
    ADD CONSTRAINT specimenreplicate_specimen_id_fkey FOREIGN KEY (specimen_id) REFERENCES specimen(specimen_id) ON UPDATE CASCADE ON DELETE CASCADE;
4811 689 aaronmk
4812
4813
--
4814 5242 aaronmk
-- Name: stemobservation_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4815 3654 aaronmk
--
4816
4817
4818
4819
4820
--
4821 3731 aaronmk
-- Name: stemobservation_plantobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4822 689 aaronmk
--
4823
4824
ALTER TABLE stemobservation
4825 3731 aaronmk
    ADD CONSTRAINT stemobservation_plantobservation_id_fkey FOREIGN KEY (plantobservation_id) REFERENCES plantobservation(plantobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
4826 689 aaronmk
4827
4828
--
4829 3731 aaronmk
-- Name: stratum_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4830 689 aaronmk
--
4831
4832
ALTER TABLE stratum
4833 3731 aaronmk
    ADD CONSTRAINT stratum_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4834 689 aaronmk
4835
4836
--
4837 3731 aaronmk
-- Name: stratum_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4838 689 aaronmk
--
4839
4840
4841
4842 3992 aaronmk
4843 689 aaronmk
--
4844 5225 aaronmk
-- Name: taxonalt_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4845 689 aaronmk
--
4846
4847
ALTER TABLE taxonalt
4848 5225 aaronmk
    ADD CONSTRAINT taxonalt_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4849 689 aaronmk
4850
4851
--
4852 5225 aaronmk
-- Name: taxonalt_taxondetermination_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4853 689 aaronmk
--
4854
4855
ALTER TABLE taxonalt
4856 5225 aaronmk
    ADD CONSTRAINT taxonalt_taxondetermination_id_fkey FOREIGN KEY (taxondetermination_id) REFERENCES taxondetermination(taxondetermination_id) ON UPDATE CASCADE ON DELETE CASCADE;
4857 689 aaronmk
4858
4859
--
4860 5464 aaronmk
-- Name: taxonconcept_accepted_concept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4861
--
4862
4863
ALTER TABLE taxonconcept
4864
    ADD CONSTRAINT taxonconcept_accepted_concept_id_fkey FOREIGN KEY (accepted_concept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4865
4866
4867
--
4868 5274 aaronmk
-- Name: taxonconcept_ancestor_ancestor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4869
--
4870
4871
ALTER TABLE taxonconcept_ancestor
4872
    ADD CONSTRAINT taxonconcept_ancestor_ancestor_id_fkey FOREIGN KEY (ancestor_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4873
4874
4875
--
4876
-- Name: taxonconcept_ancestor_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4877
--
4878
4879
ALTER TABLE taxonconcept_ancestor
4880
    ADD CONSTRAINT taxonconcept_ancestor_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4881
4882
4883
--
4884 5465 aaronmk
-- Name: taxonconcept_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4885 689 aaronmk
--
4886
4887
4888
4889 5465 aaronmk
4890 689 aaronmk
--
4891 5465 aaronmk
-- Name: taxonconcept_matched_concept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4892 689 aaronmk
--
4893
4894 5465 aaronmk
ALTER TABLE taxonconcept
4895
    ADD CONSTRAINT taxonconcept_matched_concept_id_fkey FOREIGN KEY (matched_concept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4896 689 aaronmk
4897
4898
--
4899 5271 aaronmk
-- Name: taxonconcept_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4900
--
4901
4902
ALTER TABLE taxonconcept
4903
    ADD CONSTRAINT taxonconcept_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4904
4905
4906
--
4907 5286 aaronmk
-- Name: taxoncorrelation_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4908
--
4909
4910
4911
4912
4913
--
4914
-- Name: taxoncorrelation_taxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4915
--
4916
4917
ALTER TABLE taxoncorrelation
4918
    ADD CONSTRAINT taxoncorrelation_taxonstatus_id_fkey FOREIGN KEY (taxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4919
4920
4921
--
4922 5225 aaronmk
-- Name: taxondetermination_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4923 3654 aaronmk
--
4924
4925
4926
4927
4928
--
4929 5225 aaronmk
-- Name: taxondetermination_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4930 689 aaronmk
--
4931
4932
4933
4934 5225 aaronmk
4935 689 aaronmk
--
4936 5225 aaronmk
-- Name: taxondetermination_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4937 4941 aaronmk
--
4938
4939 5225 aaronmk
ALTER TABLE taxondetermination
4940
    ADD CONSTRAINT taxondetermination_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4941 4941 aaronmk
4942
4943
--
4944 5225 aaronmk
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4945 5134 aaronmk
--
4946
4947 5225 aaronmk
ALTER TABLE taxondetermination
4948
    ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4949 5134 aaronmk
4950
4951
--
4952 5286 aaronmk
-- Name: taxonlineage_childtaxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4953
--
4954
4955
ALTER TABLE taxonlineage
4956
    ADD CONSTRAINT taxonlineage_childtaxonstatus_id_fkey FOREIGN KEY (childtaxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4957
4958
4959
--
4960
-- Name: taxonlineage_parenttaxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4961
--
4962
4963
ALTER TABLE taxonlineage
4964
    ADD CONSTRAINT taxonlineage_parenttaxonstatus_id_fkey FOREIGN KEY (parenttaxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4965
4966
4967
--
4968 5242 aaronmk
-- Name: taxonoccurrence_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4969 4934 aaronmk
--
4970
4971
4972
4973 5225 aaronmk
4974 4934 aaronmk
--
4975 5225 aaronmk
-- Name: taxonoccurrence_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4976 4718 aaronmk
--
4977
4978 5225 aaronmk
ALTER TABLE taxonoccurrence
4979
    ADD CONSTRAINT taxonoccurrence_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4980 4718 aaronmk
4981
4982
--
4983 5286 aaronmk
-- Name: taxonstatus_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4984
--
4985
4986
4987
4988
4989
--
4990
-- Name: taxonstatus_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4991
--
4992
4993
4994
4995
4996
--
4997
-- Name: taxonstatus_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4998
--
4999
5000
ALTER TABLE taxonstatus
5001
    ADD CONSTRAINT taxonstatus_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
5002
5003
5004
--
5005
-- Name: taxonusage_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5006
--
5007
5008
5009
5010
5011
--
5012
-- Name: taxonusage_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5013
--
5014
5015
5016
5017
5018
--
5019
-- Name: taxonusage_taxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5020
--
5021
5022
ALTER TABLE taxonusage
5023
    ADD CONSTRAINT taxonusage_taxonstatus_id_fkey FOREIGN KEY (taxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
5024
5025
5026
--
5027 3731 aaronmk
-- Name: telephone_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5028 689 aaronmk
--
5029
5030
ALTER TABLE telephone
5031 3731 aaronmk
    ADD CONSTRAINT telephone_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5032 689 aaronmk
5033
5034
--
5035
-- Name: trait_stemobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5036
--
5037
5038
ALTER TABLE trait
5039
    ADD CONSTRAINT trait_stemobservation_id_fkey FOREIGN KEY (stemobservation_id) REFERENCES stemobservation(stemobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
5040
5041
5042
--
5043 3731 aaronmk
-- Name: voucher_specimenreplicate_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5044 689 aaronmk
--
5045
5046
ALTER TABLE voucher
5047 3934 aaronmk
    ADD CONSTRAINT voucher_specimenreplicate_id_fkey FOREIGN KEY (specimenreplicate_id) REFERENCES specimenreplicate(specimenreplicate_id) ON UPDATE CASCADE ON DELETE CASCADE;
5048 689 aaronmk
5049
5050
--
5051 3731 aaronmk
-- Name: voucher_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5052 689 aaronmk
--
5053
5054
ALTER TABLE voucher
5055 3731 aaronmk
    ADD CONSTRAINT voucher_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
5056 689 aaronmk
5057
5058
--
5059
-- PostgreSQL database dump complete
5060
--