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