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