Project

General

Profile

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