Project

General

Profile

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