Project

General

Profile

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