Project

General

Profile

1
--
2
-- PostgreSQL database dump
3
--
4

    
5

    
6

    
7

    
8

    
9

    
10

    
11

    
12

    
13

    
14
--
15
-- Name: establishmentmeans_dwc; Type: TYPE; Schema: public; Owner: -
16
--
17

    
18

    
19

    
20

    
21
--
22
-- Name: TYPE establishmentmeans_dwc; Type: COMMENT; Schema: public; Owner: -
23
--
24

    
25

    
26

    
27

    
28
--
29
-- Name: growthform; Type: TYPE; Schema: public; Owner: -
30
--
31

    
32

    
33

    
34

    
35
--
36
-- Name: occurrencestatus_dwc; Type: TYPE; Schema: public; Owner: -
37
--
38

    
39

    
40

    
41

    
42
--
43
-- Name: placerank; Type: TYPE; Schema: public; Owner: -
44
--
45

    
46

    
47

    
48

    
49
--
50
-- Name: TYPE placerank; Type: COMMENT; Schema: public; Owner: -
51
--
52

    
53

    
54

    
55

    
56
--
57
-- Name: rankedplacename; Type: TYPE; Schema: public; Owner: -
58
--
59

    
60

    
61

    
62

    
63
--
64
-- Name: taxonrank; Type: TYPE; Schema: public; Owner: -
65
--
66

    
67

    
68

    
69

    
70
--
71
-- Name: TYPE taxonrank; Type: COMMENT; Schema: public; Owner: -
72
--
73

    
74

    
75

    
76

    
77
--
78
-- Name: rankedtaxonname; Type: TYPE; Schema: public; Owner: -
79
--
80

    
81

    
82

    
83

    
84
--
85
-- Name: role; Type: TYPE; Schema: public; Owner: -
86
--
87

    
88

    
89

    
90

    
91
--
92
-- Name: taxonclass; Type: TYPE; Schema: public; Owner: -
93
--
94

    
95

    
96

    
97

    
98
--
99
-- Name: TYPE taxonclass; Type: COMMENT; Schema: public; Owner: -
100
--
101

    
102

    
103

    
104

    
105
--
106
-- Name: _fraction_to_percent(double precision); Type: FUNCTION; Schema: public; Owner: -
107
--
108

    
109

    
110

    
111

    
112
--
113
-- Name: _taxonconcept_set_matched_concept_id(int(11), int(11), double precision); Type: FUNCTION; Schema: public; Owner: -
114
--
115

    
116

    
117

    
118

    
119
--
120
-- Name: _taxonconcept_set_parent_id(int(11), int(11)); Type: FUNCTION; Schema: public; Owner: -
121
--
122

    
123

    
124

    
125

    
126
--
127
-- Name: make_analytical_db(); Type: FUNCTION; Schema: public; Owner: -
128
--
129

    
130

    
131

    
132

    
133
--
134
-- Name: party_creator_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
135
--
136

    
137

    
138

    
139

    
140
--
141
-- Name: place_update_ancestors(); Type: FUNCTION; Schema: public; Owner: -
142
--
143

    
144

    
145

    
146

    
147
--
148
-- Name: placepath_matched_placepath_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
149
--
150

    
151

    
152

    
153

    
154
--
155
-- Name: plantobservation_aggregateoccurrence_count_1(); Type: FUNCTION; Schema: public; Owner: -
156
--
157

    
158

    
159

    
160

    
161
--
162
-- Name: taxonconcept_0_matched_concept_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
163
--
164

    
165

    
166

    
167

    
168
--
169
-- Name: taxonconcept_1_matched_concept_min_fit(); Type: FUNCTION; Schema: public; Owner: -
170
--
171

    
172

    
173

    
174

    
175
--
176
-- Name: taxonconcept_2_propagate_accepted_concept_id(); Type: FUNCTION; Schema: public; Owner: -
177
--
178

    
179

    
180

    
181

    
182
--
183
-- Name: taxonconcept_update_ancestors(); Type: FUNCTION; Schema: public; Owner: -
184
--
185

    
186

    
187

    
188

    
189
--
190
-- Name: concat(text); Type: AGGREGATE; Schema: public; Owner: -
191
--
192

    
193

    
194

    
195

    
196

    
197

    
198

    
199

    
200
--
201
-- Name: address; Type: TABLE; Schema: public; Owner: -; Tablespace: 
202
--
203

    
204
CREATE TABLE address (
205
    address_id int(11) NOT NULL,
206
    party_id int(11) NOT NULL,
207
    organization_id int(11),
208
    orgposition text,
209
    email text,
210
    deliverypoint text,
211
    city text,
212
    administrativearea text,
213
    postalcode text,
214
    country text,
215
    currentflag int(1),
216
    addressstartdate date
217
);
218

    
219

    
220
--
221
-- Name: address_address_id_seq; Type: SEQUENCE; Schema: public; Owner: -
222
--
223

    
224

    
225

    
226

    
227
--
228
-- Name: address_address_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
229
--
230

    
231

    
232

    
233

    
234
--
235
-- Name: aggregateoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace: 
236
--
237

    
238
CREATE TABLE aggregateoccurrence (
239
    aggregateoccurrence_id int(11) NOT NULL,
240
    creator_id int(11) NOT NULL,
241
    sourceaccessioncode text,
242
    taxonoccurrence_id int(11) NOT NULL,
243
    collectiondate date,
244
    cover_fraction double precision,
245
    linecover_m double precision,
246
    basalarea_m2 double precision,
247
    biomass_kg_m2 double precision,
248
    inferencearea_m2 double precision,
249
    count int(11),
250
    stratum_id int(11),
251
    coverindex_id int(11),
252
    occurrencestatus_dwc text DEFAULT 'present' NOT NULL,
253
    method_id int(11),
254
    notes text,
255
    accessioncode text
256
);
257

    
258

    
259
--
260
-- Name: TABLE aggregateoccurrence; Type: COMMENT; Schema: public; Owner: -
261
--
262

    
263

    
264

    
265

    
266
--
267
-- Name: COLUMN aggregateoccurrence.linecover_m; Type: COMMENT; Schema: public; Owner: -
268
--
269

    
270

    
271

    
272

    
273
--
274
-- Name: COLUMN aggregateoccurrence.occurrencestatus_dwc; Type: COMMENT; Schema: public; Owner: -
275
--
276

    
277

    
278

    
279

    
280
--
281
-- Name: aggregateoccurrence_aggregateoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
282
--
283

    
284

    
285

    
286

    
287
--
288
-- Name: aggregateoccurrence_aggregateoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
289
--
290

    
291

    
292

    
293

    
294
--
295
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace: 
296
--
297

    
298
CREATE TABLE location (
299
    location_id int(11) NOT NULL,
300
    creator_id int(11) NOT NULL,
301
    sourceaccessioncode text,
302
    parent_id int(11),
303
    authorlocationcode text,
304
    confidentialitystatus int(11) DEFAULT 0 NOT NULL,
305
    confidentialityreason text,
306
    sublocationxposition_m double precision,
307
    sublocationyposition_m double precision,
308
    authorzone text,
309
    authordatum text,
310
    authorlocation text,
311
    locationnarrative text,
312
    azimuth double precision,
313
    shape text,
314
    area_m2 double precision,
315
    standsize text,
316
    placementmethod text,
317
    permanence int(1),
318
    layoutnarrative text,
319
    elevation_m double precision,
320
    elevationaccuracy_m double precision,
321
    elevationrange_m double precision,
322
    verbatimelevation text,
323
    slopeaspect_deg double precision,
324
    minslopeaspect_deg double precision,
325
    maxslopeaspect_deg double precision,
326
    slopegradient_fraction double precision,
327
    minslopegradient_fraction double precision,
328
    maxslopegradient_fraction double precision,
329
    topoposition text,
330
    landform text,
331
    surficialdeposits text,
332
    rocktype text,
333
    submitter_surname text,
334
    submitter_givenname text,
335
    submitter_email text,
336
    notespublic int(1),
337
    notesmgt int(1),
338
    revisions int(1),
339
    dateentered date ,
340
    locationrationalenarrative text,
341
    accessioncode text
342
);
343

    
344

    
345
--
346
-- Name: TABLE location; Type: COMMENT; Schema: public; Owner: -
347
--
348

    
349

    
350

    
351

    
352
--
353
-- Name: locationcoords; Type: TABLE; Schema: public; Owner: -; Tablespace: 
354
--
355

    
356
CREATE TABLE locationcoords (
357
    locationcoords_id int(11) NOT NULL,
358
    location_id int(11) NOT NULL,
359
    latitude_deg double precision,
360
    longitude_deg double precision,
361
    verbatimlatitude text,
362
    verbatimlongitude text,
363
    verbatimcoordinates text,
364
    footprintgeometry_dwc text,
365
    coordsaccuracy_deg double precision,
366
    identifier_id int(11),
367
    determinationdate date,
368
    isoriginal int(1) DEFAULT false NOT NULL,
369
    iscurrent int(1) DEFAULT false NOT NULL,
370
    calculated int(1)
371
);
372

    
373

    
374
--
375
-- Name: COLUMN locationcoords.footprintgeometry_dwc; Type: COMMENT; Schema: public; Owner: -
376
--
377

    
378

    
379

    
380

    
381
--
382
-- Name: COLUMN locationcoords.coordsaccuracy_deg; Type: COMMENT; Schema: public; Owner: -
383
--
384

    
385

    
386

    
387

    
388
--
389
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace: 
390
--
391

    
392
CREATE TABLE locationevent (
393
    locationevent_id int(11) NOT NULL,
394
    creator_id int(11) NOT NULL,
395
    sourceaccessioncode text,
396
    parent_id int(11),
397
    location_id int(11),
398
    project_id int(11),
399
    authoreventcode text,
400
    previous_id int(11),
401
    obsstartdate date,
402
    obsenddate date,
403
    dateaccuracy text,
404
    method_id int(11),
405
    temperature_c double precision,
406
    precipitation_m double precision,
407
    autotaxoncover int(1),
408
    originaldata text,
409
    effortlevel text,
410
    floristicquality text,
411
    bryophytequality text,
412
    lichenquality text,
413
    locationeventnarrative text,
414
    landscapenarrative text,
415
    homogeneity text,
416
    phenologicaspect text,
417
    representativeness text,
418
    standmaturity text,
419
    successionalstatus text,
420
    basalarea double precision,
421
    hydrologicregime text,
422
    soilmoistureregime text,
423
    soildrainage text,
424
    watersalinity text,
425
    waterdepth_m double precision,
426
    shoredistance double precision,
427
    soildepth double precision,
428
    organicdepth double precision,
429
    soiltaxon_id int(11),
430
    soiltaxonsrc text,
431
    percentbedrock double precision,
432
    percentrockgravel double precision,
433
    percentwood double precision,
434
    percentlitter double precision,
435
    percentbaresoil double precision,
436
    percentwater double precision,
437
    percentother double precision,
438
    nameother text,
439
    treeht double precision,
440
    shrubht double precision,
441
    fieldht double precision,
442
    nonvascularht double precision,
443
    submergedht double precision,
444
    treecover double precision,
445
    shrubcover double precision,
446
    fieldcover double precision,
447
    nonvascularcover double precision,
448
    floatingcover double precision,
449
    submergedcover double precision,
450
    dominantstratum text,
451
    growthform1type text,
452
    growthform2type text,
453
    growthform3type text,
454
    growthform1cover double precision,
455
    growthform2cover double precision,
456
    growthform3cover double precision,
457
    totalcover double precision,
458
    notespublic int(1),
459
    notesmgt int(1),
460
    revisions int(1),
461
    dateentered date ,
462
    toptaxon1name text,
463
    toptaxon2name text,
464
    toptaxon3name text,
465
    toptaxon4name text,
466
    toptaxon5name text,
467
    numberoftaxa int(11),
468
    accessioncode text
469
);
470

    
471

    
472
--
473
-- Name: TABLE locationevent; Type: COMMENT; Schema: public; Owner: -
474
--
475

    
476

    
477

    
478

    
479
--
480
-- Name: locationplace; Type: TABLE; Schema: public; Owner: -; Tablespace: 
481
--
482

    
483
CREATE TABLE locationplace (
484
    locationplace_id int(11) NOT NULL,
485
    location_id int(11) NOT NULL,
486
    placepath_id int(11) NOT NULL,
487
    identifier_id int(11)
488
);
489

    
490

    
491
--
492
-- Name: TABLE locationplace; Type: COMMENT; Schema: public; Owner: -
493
--
494

    
495

    
496

    
497

    
498
--
499
-- Name: method; Type: TABLE; Schema: public; Owner: -; Tablespace: 
500
--
501

    
502
CREATE TABLE method (
503
    method_id int(11) NOT NULL,
504
    reference_id int(11),
505
    name text NOT NULL,
506
    description text,
507
    diameterheight_m double precision,
508
    mindiameter_m double precision,
509
    maxdiameter_m double precision,
510
    minheight_m double precision,
511
    maxheight_m double precision,
512
    observationtype text,
513
    observationmeasure text,
514
    covermethod_id int(11),
515
    samplingfactor double precision DEFAULT 1 NOT NULL,
516
    coverbasis text,
517
    stemsamplemethod text,
518
    shape text,
519
    length_m double precision,
520
    width_m double precision,
521
    radius_m double precision,
522
    area_m2 double precision,
523
    samplearea_m2 double precision,
524
    subplotspacing_m double precision,
525
    subplotmethod_id int(11),
526
    pointsperline int(11),
527
    accessioncode text
528
);
529

    
530

    
531
--
532
-- Name: TABLE method; Type: COMMENT; Schema: public; Owner: -
533
--
534

    
535

    
536

    
537

    
538
--
539
-- Name: COLUMN method.reference_id; Type: COMMENT; Schema: public; Owner: -
540
--
541

    
542

    
543

    
544

    
545
--
546
-- Name: COLUMN method.name; Type: COMMENT; Schema: public; Owner: -
547
--
548

    
549

    
550

    
551

    
552
--
553
-- Name: COLUMN method.description; Type: COMMENT; Schema: public; Owner: -
554
--
555

    
556

    
557

    
558

    
559
--
560
-- Name: COLUMN method.diameterheight_m; Type: COMMENT; Schema: public; Owner: -
561
--
562

    
563

    
564

    
565

    
566
--
567
-- Name: COLUMN method.mindiameter_m; Type: COMMENT; Schema: public; Owner: -
568
--
569

    
570

    
571

    
572

    
573
--
574
-- Name: COLUMN method.maxdiameter_m; Type: COMMENT; Schema: public; Owner: -
575
--
576

    
577

    
578

    
579

    
580
--
581
-- Name: COLUMN method.minheight_m; Type: COMMENT; Schema: public; Owner: -
582
--
583

    
584

    
585

    
586

    
587
--
588
-- Name: COLUMN method.maxheight_m; Type: COMMENT; Schema: public; Owner: -
589
--
590

    
591

    
592

    
593

    
594
--
595
-- Name: COLUMN method.observationtype; Type: COMMENT; Schema: public; Owner: -
596
--
597

    
598

    
599

    
600

    
601
--
602
-- Name: COLUMN method.observationmeasure; Type: COMMENT; Schema: public; Owner: -
603
--
604

    
605

    
606

    
607

    
608
--
609
-- Name: COLUMN method.samplingfactor; Type: COMMENT; Schema: public; Owner: -
610
--
611

    
612

    
613

    
614

    
615
--
616
-- Name: COLUMN method.coverbasis; Type: COMMENT; Schema: public; Owner: -
617
--
618

    
619

    
620

    
621

    
622
--
623
-- Name: COLUMN method.stemsamplemethod; Type: COMMENT; Schema: public; Owner: -
624
--
625

    
626

    
627

    
628

    
629
--
630
-- Name: COLUMN method.shape; Type: COMMENT; Schema: public; Owner: -
631
--
632

    
633

    
634

    
635

    
636
--
637
-- Name: COLUMN method.samplearea_m2; Type: COMMENT; Schema: public; Owner: -
638
--
639

    
640

    
641

    
642

    
643
--
644
-- Name: COLUMN method.subplotspacing_m; Type: COMMENT; Schema: public; Owner: -
645
--
646

    
647

    
648

    
649

    
650
--
651
-- Name: COLUMN method.subplotmethod_id; Type: COMMENT; Schema: public; Owner: -
652
--
653

    
654

    
655

    
656

    
657
--
658
-- Name: COLUMN method.pointsperline; Type: COMMENT; Schema: public; Owner: -
659
--
660

    
661

    
662

    
663

    
664
--
665
-- Name: party; Type: TABLE; Schema: public; Owner: -; Tablespace: 
666
--
667

    
668
CREATE TABLE party (
669
    party_id int(11) NOT NULL,
670
    creator_id int(11) NOT NULL,
671
    salutation text,
672
    givenname text,
673
    middlename text,
674
    surname text,
675
    organizationname text,
676
    currentname_id int(11),
677
    contactinstructions text,
678
    email text,
679
    partytype text,
680
    partypublic int(1) DEFAULT true,
681
    d_obscount int(11),
682
    accessioncode text
683
);
684

    
685

    
686
--
687
-- Name: COLUMN party.creator_id; Type: COMMENT; Schema: public; Owner: -
688
--
689

    
690

    
691

    
692

    
693
--
694
-- Name: placepath; Type: TABLE; Schema: public; Owner: -; Tablespace: 
695
--
696

    
697
CREATE TABLE placepath (
698
    placepath_id int(11) NOT NULL,
699
    creator_id int(11) NOT NULL,
700
    placecode text,
701
    matched_placepath_id int(11),
702
    place_id int(11),
703
    continent text,
704
    country text,
705
    stateprovince text,
706
    county text,
707
    municipality text,
708
    site text,
709
    otherranks text
710
);
711

    
712

    
713
--
714
-- Name: TABLE placepath; Type: COMMENT; Schema: public; Owner: -
715
--
716

    
717

    
718

    
719

    
720
--
721
-- Name: COLUMN placepath.matched_placepath_id; Type: COMMENT; Schema: public; Owner: -
722
--
723

    
724

    
725

    
726

    
727
--
728
-- Name: COLUMN placepath.otherranks; Type: COMMENT; Schema: public; Owner: -
729
--
730

    
731

    
732

    
733

    
734
--
735
-- Name: plantobservation; Type: TABLE; Schema: public; Owner: -; Tablespace: 
736
--
737

    
738
CREATE TABLE plantobservation (
739
    plantobservation_id int(11) NOT NULL,
740
    creator_id int(11) NOT NULL,
741
    sourceaccessioncode text,
742
    aggregateoccurrence_id int(11) NOT NULL,
743
    overallheight_m double precision,
744
    overallheightaccuracy_m double precision,
745
    collectionnumber text,
746
    stemcount int(11),
747
    plant_id int(11),
748
    accessioncode text
749
);
750

    
751

    
752
--
753
-- Name: TABLE plantobservation; Type: COMMENT; Schema: public; Owner: -
754
--
755

    
756

    
757

    
758

    
759
--
760
-- Name: COLUMN plantobservation.collectionnumber; Type: COMMENT; Schema: public; Owner: -
761
--
762

    
763

    
764

    
765

    
766
--
767
-- Name: specimenreplicate; Type: TABLE; Schema: public; Owner: -; Tablespace: 
768
--
769

    
770
CREATE TABLE specimenreplicate (
771
    specimenreplicate_id int(11) NOT NULL,
772
    creator_id int(11) NOT NULL,
773
    sourceaccessioncode text,
774
    plantobservation_id int(11),
775
    institution_id int(11),
776
    collectioncode_dwc text,
777
    catalognumber_dwc text,
778
    description text,
779
    specimen_id int(11),
780
    accessioncode text
781
);
782

    
783

    
784
--
785
-- Name: TABLE specimenreplicate; Type: COMMENT; Schema: public; Owner: -
786
--
787

    
788

    
789

    
790

    
791
--
792
-- Name: COLUMN specimenreplicate.institution_id; Type: COMMENT; Schema: public; Owner: -
793
--
794

    
795

    
796

    
797

    
798
--
799
-- Name: COLUMN specimenreplicate.collectioncode_dwc; Type: COMMENT; Schema: public; Owner: -
800
--
801

    
802

    
803

    
804

    
805
--
806
-- Name: taxonconcept; Type: TABLE; Schema: public; Owner: -; Tablespace: 
807
--
808

    
809
CREATE TABLE taxonconcept (
810
    taxonconcept_id int(11) NOT NULL,
811
    creator_id int(11) NOT NULL,
812
    sourceaccessioncode text,
813
    creationdate date,
814
    accepted_concept_id int(11),
815
    matched_concept_id int(11),
816
    matched_concept_fit_fraction double precision,
817
    parent_id int(11),
818
    taxonname text,
819
    rank text,
820
    verbatimrank text,
821
    identifyingtaxonomicname text,
822
    taxonomicname text,
823
    author text,
824
    taxonomicnamewithauthor text,
825
    family text,
826
    genus text,
827
    species text,
828
    description text,
829
    accessioncode text
830
);
831

    
832

    
833
--
834
-- Name: TABLE taxonconcept; Type: COMMENT; Schema: public; Owner: -
835
--
836

    
837

    
838

    
839

    
840
--
841
-- Name: COLUMN taxonconcept.creator_id; Type: COMMENT; Schema: public; Owner: -
842
--
843

    
844

    
845

    
846

    
847
--
848
-- Name: COLUMN taxonconcept.sourceaccessioncode; Type: COMMENT; Schema: public; Owner: -
849
--
850

    
851

    
852

    
853

    
854
--
855
-- Name: COLUMN taxonconcept.creationdate; Type: COMMENT; Schema: public; Owner: -
856
--
857

    
858

    
859

    
860

    
861
--
862
-- Name: COLUMN taxonconcept.accepted_concept_id; Type: COMMENT; Schema: public; Owner: -
863
--
864

    
865

    
866

    
867

    
868
--
869
-- Name: COLUMN taxonconcept.matched_concept_id; Type: COMMENT; Schema: public; Owner: -
870
--
871

    
872

    
873

    
874

    
875
--
876
-- Name: COLUMN taxonconcept.matched_concept_fit_fraction; Type: COMMENT; Schema: public; Owner: -
877
--
878

    
879

    
880

    
881

    
882
--
883
-- Name: COLUMN taxonconcept.parent_id; Type: COMMENT; Schema: public; Owner: -
884
--
885

    
886

    
887

    
888

    
889
--
890
-- Name: COLUMN taxonconcept.taxonname; Type: COMMENT; Schema: public; Owner: -
891
--
892

    
893

    
894

    
895

    
896
--
897
-- Name: COLUMN taxonconcept.rank; Type: COMMENT; Schema: public; Owner: -
898
--
899

    
900

    
901

    
902

    
903
--
904
-- Name: COLUMN taxonconcept.verbatimrank; Type: COMMENT; Schema: public; Owner: -
905
--
906

    
907

    
908

    
909

    
910
--
911
-- Name: COLUMN taxonconcept.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
912
--
913

    
914

    
915

    
916

    
917
--
918
-- Name: COLUMN taxonconcept.taxonomicname; Type: COMMENT; Schema: public; Owner: -
919
--
920

    
921

    
922

    
923

    
924
--
925
-- Name: COLUMN taxonconcept.author; Type: COMMENT; Schema: public; Owner: -
926
--
927

    
928

    
929

    
930

    
931
--
932
-- Name: COLUMN taxonconcept.taxonomicnamewithauthor; Type: COMMENT; Schema: public; Owner: -
933
--
934

    
935

    
936

    
937

    
938
--
939
-- Name: COLUMN taxonconcept.family; Type: COMMENT; Schema: public; Owner: -
940
--
941

    
942

    
943

    
944

    
945
--
946
-- Name: COLUMN taxonconcept.genus; Type: COMMENT; Schema: public; Owner: -
947
--
948

    
949

    
950

    
951

    
952
--
953
-- Name: COLUMN taxonconcept.species; Type: COMMENT; Schema: public; Owner: -
954
--
955

    
956

    
957

    
958

    
959
--
960
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
961
--
962

    
963
CREATE TABLE taxondetermination (
964
    taxondetermination_id int(11) NOT NULL,
965
    taxonoccurrence_id int(11) NOT NULL,
966
    taxonconcept_id int(11) NOT NULL,
967
    party_id int(11),
968
    role text DEFAULT 'unknown' NOT NULL,
969
    determinationtype text,
970
    reference_id int(11),
971
    isoriginal int(1) DEFAULT false NOT NULL,
972
    iscurrent int(1) DEFAULT false NOT NULL,
973
    taxonfit text,
974
    taxonconfidence text,
975
    grouptype text,
976
    notes text,
977
    notespublic int(1),
978
    notesmgt int(1),
979
    revisions int(1),
980
    determinationdate date,
981
    accessioncode text
982
);
983

    
984

    
985
--
986
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
987
--
988

    
989

    
990

    
991

    
992
--
993
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace: 
994
--
995

    
996
CREATE TABLE taxonoccurrence (
997
    taxonoccurrence_id int(11) NOT NULL,
998
    creator_id int(11) NOT NULL,
999
    sourceaccessioncode text,
1000
    locationevent_id int(11),
1001
    authortaxoncode text,
1002
    verbatimcollectorname text,
1003
    growthform text,
1004
    iscultivated int(1),
1005
    cultivatedbasis text,
1006
    isnative int(1),
1007
    accessioncode text
1008
);
1009

    
1010

    
1011
--
1012
-- Name: TABLE taxonoccurrence; Type: COMMENT; Schema: public; Owner: -
1013
--
1014

    
1015

    
1016

    
1017

    
1018
--
1019
-- Name: COLUMN taxonoccurrence.iscultivated; Type: COMMENT; Schema: public; Owner: -
1020
--
1021

    
1022

    
1023

    
1024

    
1025
--
1026
-- Name: COLUMN taxonoccurrence.cultivatedbasis; Type: COMMENT; Schema: public; Owner: -
1027
--
1028

    
1029

    
1030

    
1031

    
1032
--
1033
-- Name: COLUMN taxonoccurrence.isnative; Type: COMMENT; Schema: public; Owner: -
1034
--
1035

    
1036

    
1037

    
1038

    
1039
--
1040
-- Name: analytical_db_view; Type: VIEW; Schema: public; Owner: -
1041
--
1042

    
1043
CREATE VIEW analytical_db_view AS
1044
    SELECT datasource.organizationname AS `dataSourceName`, accepted_taxonconcept.family, accepted_taxonconcept.genus, accepted_taxonconcept.species, COALESCE(accepted_taxonconcept.taxonomicnamewithauthor, accepted_taxonconcept.taxonomicname) AS taxon, accepted_taxonconcept.author AS `taxonAuthor`, accepted_taxonconcept.taxonname AS `taxonMorphospecies`, placepath.country, placepath.stateprovince AS `stateProvince`, placepath.county AS `countyParish`, taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS `collectionNumber`, array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], CAST(' ' AS text)) AS `identifiedBy`, aggregateoccurrence.collectiondate AS `observationDate`, location.authorlocationcode AS `plotCode`, functions._m2_to_ha(location.area_m2) AS `plotAreaHa`, method.name AS `plotMethod`, locationcoords.latitude_deg AS latitude, locationcoords.longitude_deg AS longitude, location.elevation_m, taxonoccurrence.iscultivated AS `isCultivated`, taxonoccurrence.cultivatedbasis AS `isCultivatedReason`, _fraction_to_percent(aggregateoccurrence.cover_fraction) AS `pctCover` FROM ((((((((((((((location JOIN party datasource ON (((datasource.party_id = location.creator_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonconcept datasource_taxonconcept USING (taxonconcept_id)) JOIN taxonconcept accepted_taxonconcept ON ((accepted_taxonconcept.taxonconcept_id = datasource_taxonconcept.accepted_concept_id))) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
1045

    
1046

    
1047
--
1048
-- Name: classcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1049
--
1050

    
1051
CREATE TABLE classcontributor (
1052
    classcontributor_id int(11) NOT NULL,
1053
    commclass_id int(11) NOT NULL,
1054
    party_id int(11) NOT NULL,
1055
    role text
1056
);
1057

    
1058

    
1059
--
1060
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1061
--
1062

    
1063

    
1064

    
1065

    
1066
--
1067
-- Name: classcontributor_classcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1068
--
1069

    
1070

    
1071

    
1072

    
1073
--
1074
-- Name: commclass; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1075
--
1076

    
1077
CREATE TABLE commclass (
1078
    commclass_id int(11) NOT NULL,
1079
    locationevent_id int(11) NOT NULL,
1080
    inspection int(1),
1081
    tableanalysis int(1),
1082
    multivariateanalysis int(1),
1083
    classpublication_id int(11),
1084
    classnotes text,
1085
    commname text,
1086
    commcode text,
1087
    commframework text,
1088
    commlevel text,
1089
    classstartdate date,
1090
    classstopdate date,
1091
    expertsystem text,
1092
    accessioncode text
1093
);
1094

    
1095

    
1096
--
1097
-- Name: commclass_commclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1098
--
1099

    
1100

    
1101

    
1102

    
1103
--
1104
-- Name: commclass_commclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1105
--
1106

    
1107

    
1108

    
1109

    
1110
--
1111
-- Name: commconcept; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1112
--
1113

    
1114
CREATE TABLE commconcept (
1115
    commconcept_id int(11) NOT NULL,
1116
    commname_id int(11) NOT NULL,
1117
    reference_id int(11),
1118
    commdescription text,
1119
    d_obscount int(11),
1120
    commname text,
1121
    d_currentaccepted int(1),
1122
    accessioncode text
1123
);
1124

    
1125

    
1126
--
1127
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1128
--
1129

    
1130

    
1131

    
1132

    
1133
--
1134
-- Name: commconcept_commconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1135
--
1136

    
1137

    
1138

    
1139

    
1140
--
1141
-- Name: commcorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1142
--
1143

    
1144
CREATE TABLE commcorrelation (
1145
    commcorrelation_id int(11) NOT NULL,
1146
    commstatus_id int(11) NOT NULL,
1147
    commconcept_id int(11) NOT NULL,
1148
    commconvergence text NOT NULL,
1149
    correlationstart date NOT NULL,
1150
    correlationstop date
1151
);
1152

    
1153

    
1154
--
1155
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1156
--
1157

    
1158

    
1159

    
1160

    
1161
--
1162
-- Name: commcorrelation_commcorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1163
--
1164

    
1165

    
1166

    
1167

    
1168
--
1169
-- Name: commdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1170
--
1171

    
1172
CREATE TABLE commdetermination (
1173
    commdetermination_id int(11) NOT NULL,
1174
    commclass_id int(11) NOT NULL,
1175
    commconcept_id int(11) NOT NULL,
1176
    commcode text,
1177
    commname text,
1178
    classfit text,
1179
    classconfidence text,
1180
    commauthority_id int(11),
1181
    notes text,
1182
    type int(1),
1183
    nomenclaturaltype int(1)
1184
);
1185

    
1186

    
1187
--
1188
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1189
--
1190

    
1191

    
1192

    
1193

    
1194
--
1195
-- Name: commdetermination_commdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1196
--
1197

    
1198

    
1199

    
1200

    
1201
--
1202
-- Name: commlineage; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1203
--
1204

    
1205
CREATE TABLE commlineage (
1206
    commlineage_id int(11) NOT NULL,
1207
    parentcommstatus_id int(11) NOT NULL,
1208
    childcommstatus_id int(11) NOT NULL
1209
);
1210

    
1211

    
1212
--
1213
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1214
--
1215

    
1216

    
1217

    
1218

    
1219
--
1220
-- Name: commlineage_commlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1221
--
1222

    
1223

    
1224

    
1225

    
1226
--
1227
-- Name: commname; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1228
--
1229

    
1230
CREATE TABLE commname (
1231
    commname_id int(11) NOT NULL,
1232
    commname text NOT NULL,
1233
    reference_id int(11),
1234
    dateentered date 
1235
);
1236

    
1237

    
1238
--
1239
-- Name: commname_commname_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1240
--
1241

    
1242

    
1243

    
1244

    
1245
--
1246
-- Name: commname_commname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1247
--
1248

    
1249

    
1250

    
1251

    
1252
--
1253
-- Name: commstatus; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1254
--
1255

    
1256
CREATE TABLE commstatus (
1257
    commstatus_id int(11) NOT NULL,
1258
    commconcept_id int(11) NOT NULL,
1259
    reference_id int(11),
1260
    commconceptstatus text NOT NULL,
1261
    commparent_id int(11),
1262
    commlevel text,
1263
    commpartycomments text,
1264
    party_id int(11) NOT NULL,
1265
    startdate date NOT NULL,
1266
    stopdate date,
1267
    accessioncode text
1268
);
1269

    
1270

    
1271
--
1272
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1273
--
1274

    
1275

    
1276

    
1277

    
1278
--
1279
-- Name: commstatus_commstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1280
--
1281

    
1282

    
1283

    
1284

    
1285
--
1286
-- Name: commusage; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1287
--
1288

    
1289
CREATE TABLE commusage (
1290
    commusage_id int(11) NOT NULL,
1291
    commname_id int(11) NOT NULL,
1292
    commname text,
1293
    commconcept_id int(11),
1294
    commnamestatus text,
1295
    classsystem text,
1296
    party_id int(11),
1297
    commstatus_id int(11),
1298
    usagestart date,
1299
    usagestop date
1300
);
1301

    
1302

    
1303
--
1304
-- Name: commusage_commusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1305
--
1306

    
1307

    
1308

    
1309

    
1310
--
1311
-- Name: commusage_commusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1312
--
1313

    
1314

    
1315

    
1316

    
1317
--
1318
-- Name: coverindex; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1319
--
1320

    
1321
CREATE TABLE coverindex (
1322
    coverindex_id int(11) NOT NULL,
1323
    covermethod_id int(11) NOT NULL,
1324
    covercode text NOT NULL,
1325
    upperlimit double precision,
1326
    lowerlimit double precision,
1327
    coverpercent double precision NOT NULL,
1328
    indexdescription text
1329
);
1330

    
1331

    
1332
--
1333
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1334
--
1335

    
1336

    
1337

    
1338

    
1339
--
1340
-- Name: coverindex_coverindex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1341
--
1342

    
1343

    
1344

    
1345

    
1346
--
1347
-- Name: covermethod; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1348
--
1349

    
1350
CREATE TABLE covermethod (
1351
    covermethod_id int(11) NOT NULL,
1352
    reference_id int(11),
1353
    covertype text NOT NULL,
1354
    coverestimationmethod text,
1355
    accessioncode text
1356
);
1357

    
1358

    
1359
--
1360
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1361
--
1362

    
1363

    
1364

    
1365

    
1366
--
1367
-- Name: covermethod_covermethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1368
--
1369

    
1370

    
1371

    
1372

    
1373
--
1374
-- Name: dba_preassignacccode_dba_requestnumber_seq; Type: SEQUENCE; Schema: public; Owner: -
1375
--
1376

    
1377

    
1378

    
1379

    
1380
--
1381
-- Name: definedvalue; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1382
--
1383

    
1384
CREATE TABLE definedvalue (
1385
    definedvalue_id int(11) NOT NULL,
1386
    userdefined_id int(11) NOT NULL,
1387
    tablerecord_id int(11) NOT NULL,
1388
    definedvalue text
1389
);
1390

    
1391

    
1392
--
1393
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1394
--
1395

    
1396

    
1397

    
1398

    
1399
--
1400
-- Name: definedvalue_definedvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1401
--
1402

    
1403

    
1404

    
1405

    
1406
--
1407
-- Name: disturbanceobs; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1408
--
1409

    
1410
CREATE TABLE disturbanceobs (
1411
    disturbanceobs_id int(11) NOT NULL,
1412
    locationevent_id int(11) NOT NULL,
1413
    disturbancetype text NOT NULL,
1414
    disturbanceintensity text,
1415
    disturbanceage double precision,
1416
    disturbanceextent double precision,
1417
    disturbancecomment text
1418
);
1419

    
1420

    
1421
--
1422
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1423
--
1424

    
1425

    
1426

    
1427

    
1428
--
1429
-- Name: disturbanceobs_disturbanceobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1430
--
1431

    
1432

    
1433

    
1434

    
1435
--
1436
-- Name: graphic; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1437
--
1438

    
1439
CREATE TABLE graphic (
1440
    graphic_id int(11) NOT NULL,
1441
    locationevent_id int(11) NOT NULL,
1442
    graphicname text,
1443
    graphiclocation text,
1444
    graphicdescription text,
1445
    graphictype text,
1446
    graphicdata int(11),
1447
    graphicdate date,
1448
    accessioncode text
1449
);
1450

    
1451

    
1452
--
1453
-- Name: graphic_graphic_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1454
--
1455

    
1456

    
1457

    
1458

    
1459
--
1460
-- Name: graphic_graphic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1461
--
1462

    
1463

    
1464

    
1465

    
1466
--
1467
-- Name: location_location_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1468
--
1469

    
1470

    
1471

    
1472

    
1473
--
1474
-- Name: location_location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1475
--
1476

    
1477

    
1478

    
1479

    
1480
--
1481
-- Name: locationcoords_locationcoords_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1482
--
1483

    
1484

    
1485

    
1486

    
1487
--
1488
-- Name: locationcoords_locationcoords_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1489
--
1490

    
1491

    
1492

    
1493

    
1494
--
1495
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1496
--
1497

    
1498

    
1499

    
1500

    
1501
--
1502
-- Name: locationevent_locationevent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1503
--
1504

    
1505

    
1506

    
1507

    
1508
--
1509
-- Name: locationeventcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1510
--
1511

    
1512
CREATE TABLE locationeventcontributor (
1513
    locationeventcontributor_id int(11) NOT NULL,
1514
    locationevent_id int(11) NOT NULL,
1515
    party_id int(11) NOT NULL,
1516
    role text NOT NULL,
1517
    contributiondate date
1518
);
1519

    
1520

    
1521
--
1522
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1523
--
1524

    
1525

    
1526

    
1527

    
1528
--
1529
-- Name: locationeventcontributor_locationeventcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1530
--
1531

    
1532

    
1533

    
1534

    
1535
--
1536
-- Name: locationeventsynonym; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1537
--
1538

    
1539
CREATE TABLE locationeventsynonym (
1540
    locationeventsynonym_id int(11) NOT NULL,
1541
    synonymlocationevent_id int(11) NOT NULL,
1542
    primarylocationevent_id int(11) NOT NULL,
1543
    party_id int(11) NOT NULL,
1544
    role text NOT NULL,
1545
    synonymcomment text,
1546
    classstartdate date  NOT NULL,
1547
    classstopdate date,
1548
    accessioncode text
1549
);
1550

    
1551

    
1552
--
1553
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1554
--
1555

    
1556

    
1557

    
1558

    
1559
--
1560
-- Name: locationeventsynonym_locationeventsynonym_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1561
--
1562

    
1563

    
1564

    
1565

    
1566
--
1567
-- Name: locationplace_locationplace_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1568
--
1569

    
1570

    
1571

    
1572

    
1573
--
1574
-- Name: locationplace_locationplace_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1575
--
1576

    
1577

    
1578

    
1579

    
1580
--
1581
-- Name: method_method_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1582
--
1583

    
1584

    
1585

    
1586

    
1587
--
1588
-- Name: method_method_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1589
--
1590

    
1591

    
1592

    
1593

    
1594
--
1595
-- Name: methodtaxonclass; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1596
--
1597

    
1598
CREATE TABLE methodtaxonclass (
1599
    methodtaxonclass_id int(11) NOT NULL,
1600
    method_id int(11) NOT NULL,
1601
    taxonconcept_id int(11),
1602
    included int(1) NOT NULL,
1603
    submethod_id int(11),
1604
    taxonclass text
1605
);
1606

    
1607

    
1608
--
1609
-- Name: COLUMN methodtaxonclass.included; Type: COMMENT; Schema: public; Owner: -
1610
--
1611

    
1612

    
1613

    
1614

    
1615
--
1616
-- Name: COLUMN methodtaxonclass.submethod_id; Type: COMMENT; Schema: public; Owner: -
1617
--
1618

    
1619

    
1620

    
1621

    
1622
--
1623
-- Name: methodtaxonclass_methodtaxonclass_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1624
--
1625

    
1626

    
1627

    
1628

    
1629
--
1630
-- Name: methodtaxonclass_methodtaxonclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1631
--
1632

    
1633

    
1634

    
1635

    
1636
--
1637
-- Name: note; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1638
--
1639

    
1640
CREATE TABLE note (
1641
    note_id int(11) NOT NULL,
1642
    notelink_id int(11) NOT NULL,
1643
    party_id int(11) NOT NULL,
1644
    role text NOT NULL,
1645
    notetype text NOT NULL,
1646
    notetext text NOT NULL,
1647
    notedate date,
1648
    accessioncode text
1649
);
1650

    
1651

    
1652
--
1653
-- Name: note_note_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1654
--
1655

    
1656

    
1657

    
1658

    
1659
--
1660
-- Name: note_note_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1661
--
1662

    
1663

    
1664

    
1665

    
1666
--
1667
-- Name: notelink; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1668
--
1669

    
1670
CREATE TABLE notelink (
1671
    notelink_id int(11) NOT NULL,
1672
    tablename text NOT NULL,
1673
    attributename text,
1674
    tablerecord int(11) NOT NULL
1675
);
1676

    
1677

    
1678
--
1679
-- Name: notelink_notelink_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1680
--
1681

    
1682

    
1683

    
1684

    
1685
--
1686
-- Name: notelink_notelink_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1687
--
1688

    
1689

    
1690

    
1691

    
1692
--
1693
-- Name: party_party_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1694
--
1695

    
1696

    
1697

    
1698

    
1699
--
1700
-- Name: party_party_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1701
--
1702

    
1703

    
1704

    
1705

    
1706
--
1707
-- Name: partymember; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1708
--
1709

    
1710
CREATE TABLE partymember (
1711
    partymember_id int(11) NOT NULL,
1712
    parentparty_id int(11) NOT NULL,
1713
    childparty_id int(11) NOT NULL,
1714
    role text,
1715
    memberstart date  NOT NULL,
1716
    memberstop date
1717
);
1718

    
1719

    
1720
--
1721
-- Name: partymember_partymember_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1722
--
1723

    
1724

    
1725

    
1726

    
1727
--
1728
-- Name: partymember_partymember_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1729
--
1730

    
1731

    
1732

    
1733

    
1734
--
1735
-- Name: place; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1736
--
1737

    
1738
CREATE TABLE place (
1739
    place_id int(11) NOT NULL,
1740
    parent_id int(11),
1741
    rank text NOT NULL,
1742
    placename text NOT NULL,
1743
    placecode text,
1744
    placedescription text,
1745
    accessioncode text
1746
);
1747

    
1748

    
1749
--
1750
-- Name: TABLE place; Type: COMMENT; Schema: public; Owner: -
1751
--
1752

    
1753

    
1754

    
1755

    
1756
--
1757
-- Name: place_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1758
--
1759

    
1760
CREATE TABLE place_ancestor (
1761
    place_id int(11) NOT NULL,
1762
    ancestor_id int(11) NOT NULL
1763
);
1764

    
1765

    
1766
--
1767
-- Name: TABLE place_ancestor; Type: COMMENT; Schema: public; Owner: -
1768
--
1769

    
1770

    
1771

    
1772

    
1773
--
1774
-- Name: place_place_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1775
--
1776

    
1777

    
1778

    
1779

    
1780
--
1781
-- Name: place_place_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1782
--
1783

    
1784

    
1785

    
1786

    
1787
--
1788
-- Name: placecorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1789
--
1790

    
1791
CREATE TABLE placecorrelation (
1792
    placecorrelation_id int(11) NOT NULL,
1793
    parentplace_id int(11) NOT NULL,
1794
    childplace_id int(11) NOT NULL,
1795
    placeconvergence text NOT NULL
1796
);
1797

    
1798

    
1799
--
1800
-- Name: placecorrelation_placecorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1801
--
1802

    
1803

    
1804

    
1805

    
1806
--
1807
-- Name: placecorrelation_placecorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1808
--
1809

    
1810

    
1811

    
1812

    
1813
--
1814
-- Name: placepath_placepath_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1815
--
1816

    
1817

    
1818

    
1819

    
1820
--
1821
-- Name: placepath_placepath_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1822
--
1823

    
1824

    
1825

    
1826

    
1827
--
1828
-- Name: plant; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1829
--
1830

    
1831
CREATE TABLE plant (
1832
    plant_id int(11) NOT NULL
1833
);
1834

    
1835

    
1836
--
1837
-- Name: TABLE plant; Type: COMMENT; Schema: public; Owner: -
1838
--
1839

    
1840

    
1841

    
1842

    
1843
--
1844
-- Name: plant_plant_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1845
--
1846

    
1847

    
1848

    
1849

    
1850
--
1851
-- Name: plant_plant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1852
--
1853

    
1854

    
1855

    
1856

    
1857
--
1858
-- Name: plantobservation_plantobservation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1859
--
1860

    
1861

    
1862

    
1863

    
1864
--
1865
-- Name: plantobservation_plantobservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1866
--
1867

    
1868

    
1869

    
1870

    
1871
--
1872
-- Name: project; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1873
--
1874

    
1875
CREATE TABLE project (
1876
    project_id int(11) NOT NULL,
1877
    creator_id int(11) NOT NULL,
1878
    sourceaccessioncode text,
1879
    projectname text,
1880
    projectdescription text,
1881
    startdate date,
1882
    stopdate date,
1883
    d_obscount int(11),
1884
    d_lastlocationaddeddate date,
1885
    accessioncode text
1886
);
1887

    
1888

    
1889
--
1890
-- Name: project_project_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1891
--
1892

    
1893

    
1894

    
1895

    
1896
--
1897
-- Name: project_project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1898
--
1899

    
1900

    
1901

    
1902

    
1903
--
1904
-- Name: projectcontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1905
--
1906

    
1907
CREATE TABLE projectcontributor (
1908
    projectcontributor_id int(11) NOT NULL,
1909
    project_id int(11) NOT NULL,
1910
    party_id int(11) NOT NULL,
1911
    role text,
1912
    surname text,
1913
    cheatrole text
1914
);
1915

    
1916

    
1917
--
1918
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1919
--
1920

    
1921

    
1922

    
1923

    
1924
--
1925
-- Name: projectcontributor_projectcontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1926
--
1927

    
1928

    
1929

    
1930

    
1931
--
1932
-- Name: reference; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1933
--
1934

    
1935
CREATE TABLE reference (
1936
    reference_id int(11) NOT NULL,
1937
    shortname text,
1938
    `fulltext` text,
1939
    referencetype text,
1940
    title text,
1941
    titlesuperior text,
1942
    referencejournal_id int(11),
1943
    volume text,
1944
    issue text,
1945
    pagerange text,
1946
    totalpages int(11),
1947
    publisher text,
1948
    publicationplace text,
1949
    isbn text,
1950
    edition text,
1951
    numberofvolumes int(11),
1952
    chapternumber int(11),
1953
    reportnumber int(11),
1954
    communicationtype text,
1955
    degree text,
1956
    url text,
1957
    doi text,
1958
    additionalinfo text,
1959
    pubdate date,
1960
    accessdate date,
1961
    conferencedate date,
1962
    accessioncode text
1963
);
1964

    
1965

    
1966
--
1967
-- Name: reference_reference_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1968
--
1969

    
1970

    
1971

    
1972

    
1973
--
1974
-- Name: reference_reference_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1975
--
1976

    
1977

    
1978

    
1979

    
1980
--
1981
-- Name: referencealtident; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1982
--
1983

    
1984
CREATE TABLE referencealtident (
1985
    referencealtident_id int(11) NOT NULL,
1986
    reference_id int(11) NOT NULL,
1987
    system text,
1988
    identifier text NOT NULL
1989
);
1990

    
1991

    
1992
--
1993
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1994
--
1995

    
1996

    
1997

    
1998

    
1999
--
2000
-- Name: referencealtident_referencealtident_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2001
--
2002

    
2003

    
2004

    
2005

    
2006
--
2007
-- Name: referencecontributor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2008
--
2009

    
2010
CREATE TABLE referencecontributor (
2011
    referencecontributor_id int(11) NOT NULL,
2012
    reference_id int(11) NOT NULL,
2013
    referenceparty_id int(11) NOT NULL,
2014
    roletype text,
2015
    `position` int(11)
2016
);
2017

    
2018

    
2019
--
2020
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2021
--
2022

    
2023

    
2024

    
2025

    
2026
--
2027
-- Name: referencecontributor_referencecontributor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2028
--
2029

    
2030

    
2031

    
2032

    
2033
--
2034
-- Name: referencejournal; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2035
--
2036

    
2037
CREATE TABLE referencejournal (
2038
    referencejournal_id int(11) NOT NULL,
2039
    journal text NOT NULL,
2040
    issn text,
2041
    abbreviation text,
2042
    accessioncode text
2043
);
2044

    
2045

    
2046
--
2047
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2048
--
2049

    
2050

    
2051

    
2052

    
2053
--
2054
-- Name: referencejournal_referencejournal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2055
--
2056

    
2057

    
2058

    
2059

    
2060
--
2061
-- Name: referenceparty; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2062
--
2063

    
2064
CREATE TABLE referenceparty (
2065
    referenceparty_id int(11) NOT NULL,
2066
    type text,
2067
    positionname text,
2068
    salutation text,
2069
    givenname text,
2070
    surname text,
2071
    suffix text,
2072
    organizationname text,
2073
    currentparty_id int(11),
2074
    accessioncode text
2075
);
2076

    
2077

    
2078
--
2079
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2080
--
2081

    
2082

    
2083

    
2084

    
2085
--
2086
-- Name: referenceparty_referenceparty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2087
--
2088

    
2089

    
2090

    
2091

    
2092
--
2093
-- Name: revision; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2094
--
2095

    
2096
CREATE TABLE revision (
2097
    revision_id int(11) NOT NULL,
2098
    tablename text NOT NULL,
2099
    tableattribute text NOT NULL,
2100
    tablerecord int(11) NOT NULL,
2101
    previousvaluetext text NOT NULL,
2102
    previousvaluetype text NOT NULL,
2103
    previousrevision_id int(11),
2104
    revisiondate date NOT NULL
2105
);
2106

    
2107

    
2108
--
2109
-- Name: revision_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2110
--
2111

    
2112

    
2113

    
2114

    
2115
--
2116
-- Name: revision_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2117
--
2118

    
2119

    
2120

    
2121

    
2122
--
2123
-- Name: soilobs; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2124
--
2125

    
2126
CREATE TABLE soilobs (
2127
    soilobs_id int(11) NOT NULL,
2128
    locationevent_id int(11) NOT NULL,
2129
    horizon text DEFAULT 'unknown' NOT NULL,
2130
    description text,
2131
    depthtop_m double precision,
2132
    depthbottom_m double precision,
2133
    color text,
2134
    texture text,
2135
    organic_fraction double precision,
2136
    sand_fraction double precision,
2137
    silt_fraction double precision,
2138
    clay_fraction double precision,
2139
    coarse_fraction double precision,
2140
    ph double precision,
2141
    acidity_fraction double precision,
2142
    basesaturation_fraction double precision,
2143
    cationexchangecapacity_cmol_kg double precision,
2144
    conductivity double precision,
2145
    carbon_fraction double precision,
2146
    phosphorus_fraction double precision,
2147
    potassium_fraction double precision,
2148
    magnesium_fraction double precision,
2149
    nitrogen_fraction double precision,
2150
    calcium_fraction double precision,
2151
    sodium_fraction double precision
2152
);
2153

    
2154

    
2155
--
2156
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2157
--
2158

    
2159

    
2160

    
2161

    
2162
--
2163
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2164
--
2165

    
2166

    
2167

    
2168

    
2169
--
2170
-- Name: soiltaxon; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2171
--
2172

    
2173
CREATE TABLE soiltaxon (
2174
    soiltaxon_id int(11) NOT NULL,
2175
    soilcode text,
2176
    soilname text,
2177
    soillevel int(11),
2178
    soilparent_id int(11),
2179
    soilframework text,
2180
    accessioncode text
2181
);
2182

    
2183

    
2184
--
2185
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2186
--
2187

    
2188

    
2189

    
2190

    
2191
--
2192
-- Name: soiltaxon_soiltaxon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2193
--
2194

    
2195

    
2196

    
2197

    
2198
--
2199
-- Name: specimen; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2200
--
2201

    
2202
CREATE TABLE specimen (
2203
    specimen_id int(11) NOT NULL
2204
);
2205

    
2206

    
2207
--
2208
-- Name: TABLE specimen; Type: COMMENT; Schema: public; Owner: -
2209
--
2210

    
2211

    
2212

    
2213

    
2214
--
2215
-- Name: specimen_specimen_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2216
--
2217

    
2218

    
2219

    
2220

    
2221
--
2222
-- Name: specimen_specimen_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2223
--
2224

    
2225

    
2226

    
2227

    
2228
--
2229
-- Name: specimenreplicate_specimenreplicate_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2230
--
2231

    
2232

    
2233

    
2234

    
2235
--
2236
-- Name: specimenreplicate_specimenreplicate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2237
--
2238

    
2239

    
2240

    
2241

    
2242
--
2243
-- Name: stemobservation; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2244
--
2245

    
2246
CREATE TABLE stemobservation (
2247
    stemobservation_id int(11) NOT NULL,
2248
    creator_id int(11) NOT NULL,
2249
    sourceaccessioncode text,
2250
    plantobservation_id int(11) NOT NULL,
2251
    authorstemcode text,
2252
    tag text,
2253
    tags text,
2254
    xposition_m double precision,
2255
    yposition_m double precision,
2256
    diameterbreastheight_m double precision,
2257
    basaldiameter_m double precision,
2258
    diameteraccuracy_m double precision,
2259
    height_m double precision,
2260
    heightfirstbranch_m double precision,
2261
    heightaccuracy_m double precision,
2262
    health text,
2263
    age double precision,
2264
    accessioncode text
2265
);
2266

    
2267

    
2268
--
2269
-- Name: TABLE stemobservation; Type: COMMENT; Schema: public; Owner: -
2270
--
2271

    
2272

    
2273

    
2274

    
2275
--
2276
-- Name: COLUMN stemobservation.tags; Type: COMMENT; Schema: public; Owner: -
2277
--
2278

    
2279

    
2280

    
2281

    
2282
--
2283
-- Name: stemobservation_stemobservation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2284
--
2285

    
2286

    
2287

    
2288

    
2289
--
2290
-- Name: stemobservation_stemobservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2291
--
2292

    
2293

    
2294

    
2295

    
2296
--
2297
-- Name: stratum; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2298
--
2299

    
2300
CREATE TABLE stratum (
2301
    stratum_id int(11) NOT NULL,
2302
    locationevent_id int(11) NOT NULL,
2303
    stratumheight double precision,
2304
    stratumbase double precision,
2305
    stratumcover double precision,
2306
    area double precision,
2307
    method_id int(11)
2308
);
2309

    
2310

    
2311
--
2312
-- Name: stratum_stratum_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2313
--
2314

    
2315

    
2316

    
2317

    
2318
--
2319
-- Name: stratum_stratum_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2320
--
2321

    
2322

    
2323

    
2324

    
2325
--
2326
-- Name: taxonalt; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2327
--
2328

    
2329
CREATE TABLE taxonalt (
2330
    taxonalt_id int(11) NOT NULL,
2331
    taxondetermination_id int(11) NOT NULL,
2332
    taxonconcept_id int(11) NOT NULL,
2333
    taxonaltfit text,
2334
    taxonaltconfidence text,
2335
    taxonaltnotes text
2336
);
2337

    
2338

    
2339
--
2340
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2341
--
2342

    
2343

    
2344

    
2345

    
2346
--
2347
-- Name: taxonalt_taxonalt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2348
--
2349

    
2350

    
2351

    
2352

    
2353
--
2354
-- Name: taxonconcept_ancestor; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2355
--
2356

    
2357
CREATE TABLE taxonconcept_ancestor (
2358
    taxonconcept_id int(11) NOT NULL,
2359
    ancestor_id int(11) NOT NULL
2360
);
2361

    
2362

    
2363
--
2364
-- Name: TABLE taxonconcept_ancestor; Type: COMMENT; Schema: public; Owner: -
2365
--
2366

    
2367

    
2368

    
2369

    
2370
--
2371
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2372
--
2373

    
2374

    
2375

    
2376

    
2377
--
2378
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2379
--
2380

    
2381

    
2382

    
2383

    
2384
--
2385
-- Name: taxoncorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2386
--
2387

    
2388
CREATE TABLE taxoncorrelation (
2389
    taxoncorrelation_id int(11) NOT NULL,
2390
    taxonstatus_id int(11) NOT NULL,
2391
    taxonconcept_id int(11) NOT NULL,
2392
    plantconvergence text NOT NULL,
2393
    correlationstart date NOT NULL,
2394
    correlationstop date
2395
);
2396

    
2397

    
2398
--
2399
-- Name: taxoncorrelation_taxoncorrelation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2400
--
2401

    
2402

    
2403

    
2404

    
2405
--
2406
-- Name: taxoncorrelation_taxoncorrelation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2407
--
2408

    
2409

    
2410

    
2411

    
2412
--
2413
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2414
--
2415

    
2416

    
2417

    
2418

    
2419
--
2420
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2421
--
2422

    
2423

    
2424

    
2425

    
2426
--
2427
-- Name: taxonlineage; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2428
--
2429

    
2430
CREATE TABLE taxonlineage (
2431
    taxonlineage_id int(11) NOT NULL,
2432
    childtaxonstatus_id int(11) NOT NULL,
2433
    parenttaxonstatus_id int(11) NOT NULL
2434
);
2435

    
2436

    
2437
--
2438
-- Name: taxonlineage_taxonlineage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2439
--
2440

    
2441

    
2442

    
2443

    
2444
--
2445
-- Name: taxonlineage_taxonlineage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2446
--
2447

    
2448

    
2449

    
2450

    
2451
--
2452
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2453
--
2454

    
2455

    
2456

    
2457

    
2458
--
2459
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2460
--
2461

    
2462

    
2463

    
2464

    
2465
--
2466
-- Name: taxonstatus; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2467
--
2468

    
2469
CREATE TABLE taxonstatus (
2470
    taxonstatus_id int(11) NOT NULL,
2471
    taxonconcept_id int(11) NOT NULL,
2472
    party_id int(11),
2473
    taxonconceptstatus text DEFAULT 'undetermined' NOT NULL,
2474
    reference_id int(11),
2475
    plantpartycomments text,
2476
    startdate date,
2477
    stopdate date,
2478
    accessioncode text
2479
);
2480

    
2481

    
2482
--
2483
-- Name: taxonstatus_taxonstatus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2484
--
2485

    
2486

    
2487

    
2488

    
2489
--
2490
-- Name: taxonstatus_taxonstatus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2491
--
2492

    
2493

    
2494

    
2495

    
2496
--
2497
-- Name: taxonusage; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2498
--
2499

    
2500
CREATE TABLE taxonusage (
2501
    taxonusage_id int(11) NOT NULL,
2502
    taxonconcept_id int(11) NOT NULL,
2503
    taxonstatus text,
2504
    taxon text,
2505
    classsystem text,
2506
    acceptedsynonym text,
2507
    party_id int(11),
2508
    taxonstatus_id int(11),
2509
    usagestart date,
2510
    usagestop date
2511
);
2512

    
2513

    
2514
--
2515
-- Name: taxonusage_taxonusage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2516
--
2517

    
2518

    
2519

    
2520

    
2521
--
2522
-- Name: taxonusage_taxonusage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2523
--
2524

    
2525

    
2526

    
2527

    
2528
--
2529
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2530
--
2531

    
2532
CREATE TABLE telephone (
2533
    telephone_id int(11) NOT NULL,
2534
    party_id int(11) NOT NULL,
2535
    phonenumber text NOT NULL,
2536
    phonetype text NOT NULL
2537
);
2538

    
2539

    
2540
--
2541
-- Name: telephone_telephone_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2542
--
2543

    
2544

    
2545

    
2546

    
2547
--
2548
-- Name: telephone_telephone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2549
--
2550

    
2551

    
2552

    
2553

    
2554
--
2555
-- Name: trait; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2556
--
2557

    
2558
CREATE TABLE trait (
2559
    trait_id int(11) NOT NULL,
2560
    stemobservation_id int(11) NOT NULL,
2561
    type text NOT NULL,
2562
    value text
2563
);
2564

    
2565

    
2566
--
2567
-- Name: trait_trait_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2568
--
2569

    
2570

    
2571

    
2572

    
2573
--
2574
-- Name: trait_trait_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2575
--
2576

    
2577

    
2578

    
2579

    
2580
--
2581
-- Name: userdefined; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2582
--
2583

    
2584
CREATE TABLE userdefined (
2585
    userdefined_id int(11) NOT NULL,
2586
    userdefinedname text NOT NULL,
2587
    userdefinedmetadata text,
2588
    userdefinedcategory text,
2589
    userdefinedtype text DEFAULT 'text' NOT NULL,
2590
    tablename text NOT NULL,
2591
    accessioncode text
2592
);
2593

    
2594

    
2595
--
2596
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2597
--
2598

    
2599

    
2600

    
2601

    
2602
--
2603
-- Name: userdefined_userdefined_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2604
--
2605

    
2606

    
2607

    
2608

    
2609
--
2610
-- Name: voucher; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2611
--
2612

    
2613
CREATE TABLE voucher (
2614
    voucher_id int(11) NOT NULL,
2615
    taxonoccurrence_id int(11) NOT NULL,
2616
    specimenreplicate_id int(11) NOT NULL
2617
);
2618

    
2619

    
2620
--
2621
-- Name: voucher_voucher_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2622
--
2623

    
2624

    
2625

    
2626

    
2627
--
2628
-- Name: voucher_voucher_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2629
--
2630

    
2631

    
2632

    
2633

    
2634
--
2635
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: -
2636
--
2637

    
2638

    
2639

    
2640

    
2641
--
2642
-- Name: aggregateoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
2643
--
2644

    
2645

    
2646

    
2647

    
2648
--
2649
-- Name: classcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2650
--
2651

    
2652

    
2653

    
2654

    
2655
--
2656
-- Name: commclass_id; Type: DEFAULT; Schema: public; Owner: -
2657
--
2658

    
2659

    
2660

    
2661

    
2662
--
2663
-- Name: commconcept_id; Type: DEFAULT; Schema: public; Owner: -
2664
--
2665

    
2666

    
2667

    
2668

    
2669
--
2670
-- Name: commcorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2671
--
2672

    
2673

    
2674

    
2675

    
2676
--
2677
-- Name: commdetermination_id; Type: DEFAULT; Schema: public; Owner: -
2678
--
2679

    
2680

    
2681

    
2682

    
2683
--
2684
-- Name: commlineage_id; Type: DEFAULT; Schema: public; Owner: -
2685
--
2686

    
2687

    
2688

    
2689

    
2690
--
2691
-- Name: commname_id; Type: DEFAULT; Schema: public; Owner: -
2692
--
2693

    
2694

    
2695

    
2696

    
2697
--
2698
-- Name: commstatus_id; Type: DEFAULT; Schema: public; Owner: -
2699
--
2700

    
2701

    
2702

    
2703

    
2704
--
2705
-- Name: commusage_id; Type: DEFAULT; Schema: public; Owner: -
2706
--
2707

    
2708

    
2709

    
2710

    
2711
--
2712
-- Name: coverindex_id; Type: DEFAULT; Schema: public; Owner: -
2713
--
2714

    
2715

    
2716

    
2717

    
2718
--
2719
-- Name: covermethod_id; Type: DEFAULT; Schema: public; Owner: -
2720
--
2721

    
2722

    
2723

    
2724

    
2725
--
2726
-- Name: definedvalue_id; Type: DEFAULT; Schema: public; Owner: -
2727
--
2728

    
2729

    
2730

    
2731

    
2732
--
2733
-- Name: disturbanceobs_id; Type: DEFAULT; Schema: public; Owner: -
2734
--
2735

    
2736

    
2737

    
2738

    
2739
--
2740
-- Name: graphic_id; Type: DEFAULT; Schema: public; Owner: -
2741
--
2742

    
2743

    
2744

    
2745

    
2746
--
2747
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: -
2748
--
2749

    
2750

    
2751

    
2752

    
2753
--
2754
-- Name: locationcoords_id; Type: DEFAULT; Schema: public; Owner: -
2755
--
2756

    
2757

    
2758

    
2759

    
2760
--
2761
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
2762
--
2763

    
2764

    
2765

    
2766

    
2767
--
2768
-- Name: locationeventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2769
--
2770

    
2771

    
2772

    
2773

    
2774
--
2775
-- Name: locationeventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
2776
--
2777

    
2778

    
2779

    
2780

    
2781
--
2782
-- Name: locationplace_id; Type: DEFAULT; Schema: public; Owner: -
2783
--
2784

    
2785

    
2786

    
2787

    
2788
--
2789
-- Name: method_id; Type: DEFAULT; Schema: public; Owner: -
2790
--
2791

    
2792

    
2793

    
2794

    
2795
--
2796
-- Name: methodtaxonclass_id; Type: DEFAULT; Schema: public; Owner: -
2797
--
2798

    
2799

    
2800

    
2801

    
2802
--
2803
-- Name: note_id; Type: DEFAULT; Schema: public; Owner: -
2804
--
2805

    
2806

    
2807

    
2808

    
2809
--
2810
-- Name: notelink_id; Type: DEFAULT; Schema: public; Owner: -
2811
--
2812

    
2813

    
2814

    
2815

    
2816
--
2817
-- Name: party_id; Type: DEFAULT; Schema: public; Owner: -
2818
--
2819

    
2820

    
2821

    
2822

    
2823
--
2824
-- Name: partymember_id; Type: DEFAULT; Schema: public; Owner: -
2825
--
2826

    
2827

    
2828

    
2829

    
2830
--
2831
-- Name: place_id; Type: DEFAULT; Schema: public; Owner: -
2832
--
2833

    
2834

    
2835

    
2836

    
2837
--
2838
-- Name: placecorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2839
--
2840

    
2841

    
2842

    
2843

    
2844
--
2845
-- Name: placepath_id; Type: DEFAULT; Schema: public; Owner: -
2846
--
2847

    
2848

    
2849

    
2850

    
2851
--
2852
-- Name: plant_id; Type: DEFAULT; Schema: public; Owner: -
2853
--
2854

    
2855

    
2856

    
2857

    
2858
--
2859
-- Name: plantobservation_id; Type: DEFAULT; Schema: public; Owner: -
2860
--
2861

    
2862

    
2863

    
2864

    
2865
--
2866
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: -
2867
--
2868

    
2869

    
2870

    
2871

    
2872
--
2873
-- Name: projectcontributor_id; Type: DEFAULT; Schema: public; Owner: -
2874
--
2875

    
2876

    
2877

    
2878

    
2879
--
2880
-- Name: reference_id; Type: DEFAULT; Schema: public; Owner: -
2881
--
2882

    
2883

    
2884

    
2885

    
2886
--
2887
-- Name: referencealtident_id; Type: DEFAULT; Schema: public; Owner: -
2888
--
2889

    
2890

    
2891

    
2892

    
2893
--
2894
-- Name: referencecontributor_id; Type: DEFAULT; Schema: public; Owner: -
2895
--
2896

    
2897

    
2898

    
2899

    
2900
--
2901
-- Name: referencejournal_id; Type: DEFAULT; Schema: public; Owner: -
2902
--
2903

    
2904

    
2905

    
2906

    
2907
--
2908
-- Name: referenceparty_id; Type: DEFAULT; Schema: public; Owner: -
2909
--
2910

    
2911

    
2912

    
2913

    
2914
--
2915
-- Name: revision_id; Type: DEFAULT; Schema: public; Owner: -
2916
--
2917

    
2918

    
2919

    
2920

    
2921
--
2922
-- Name: soilobs_id; Type: DEFAULT; Schema: public; Owner: -
2923
--
2924

    
2925

    
2926

    
2927

    
2928
--
2929
-- Name: soiltaxon_id; Type: DEFAULT; Schema: public; Owner: -
2930
--
2931

    
2932

    
2933

    
2934

    
2935
--
2936
-- Name: specimen_id; Type: DEFAULT; Schema: public; Owner: -
2937
--
2938

    
2939

    
2940

    
2941

    
2942
--
2943
-- Name: specimenreplicate_id; Type: DEFAULT; Schema: public; Owner: -
2944
--
2945

    
2946

    
2947

    
2948

    
2949
--
2950
-- Name: stemobservation_id; Type: DEFAULT; Schema: public; Owner: -
2951
--
2952

    
2953

    
2954

    
2955

    
2956
--
2957
-- Name: stratum_id; Type: DEFAULT; Schema: public; Owner: -
2958
--
2959

    
2960

    
2961

    
2962

    
2963
--
2964
-- Name: taxonalt_id; Type: DEFAULT; Schema: public; Owner: -
2965
--
2966

    
2967

    
2968

    
2969

    
2970
--
2971
-- Name: taxonconcept_id; Type: DEFAULT; Schema: public; Owner: -
2972
--
2973

    
2974

    
2975

    
2976

    
2977
--
2978
-- Name: taxoncorrelation_id; Type: DEFAULT; Schema: public; Owner: -
2979
--
2980

    
2981

    
2982

    
2983

    
2984
--
2985
-- Name: taxondetermination_id; Type: DEFAULT; Schema: public; Owner: -
2986
--
2987

    
2988

    
2989

    
2990

    
2991
--
2992
-- Name: taxonlineage_id; Type: DEFAULT; Schema: public; Owner: -
2993
--
2994

    
2995

    
2996

    
2997

    
2998
--
2999
-- Name: taxonoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
3000
--
3001

    
3002

    
3003

    
3004

    
3005
--
3006
-- Name: taxonstatus_id; Type: DEFAULT; Schema: public; Owner: -
3007
--
3008

    
3009

    
3010

    
3011

    
3012
--
3013
-- Name: taxonusage_id; Type: DEFAULT; Schema: public; Owner: -
3014
--
3015

    
3016

    
3017

    
3018

    
3019
--
3020
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: -
3021
--
3022

    
3023

    
3024

    
3025

    
3026
--
3027
-- Name: trait_id; Type: DEFAULT; Schema: public; Owner: -
3028
--
3029

    
3030

    
3031

    
3032

    
3033
--
3034
-- Name: userdefined_id; Type: DEFAULT; Schema: public; Owner: -
3035
--
3036

    
3037

    
3038

    
3039

    
3040
--
3041
-- Name: voucher_id; Type: DEFAULT; Schema: public; Owner: -
3042
--
3043

    
3044

    
3045

    
3046

    
3047
--
3048
-- Name: address_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3049
--
3050

    
3051
ALTER TABLE address
3052
    ADD CONSTRAINT address_pkey PRIMARY KEY (address_id);
3053

    
3054

    
3055
--
3056
-- Name: aggregateoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3057
--
3058

    
3059
ALTER TABLE aggregateoccurrence
3060
    ADD CONSTRAINT aggregateoccurrence_pkey PRIMARY KEY (aggregateoccurrence_id);
3061

    
3062

    
3063
--
3064
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3065
--
3066

    
3067
ALTER TABLE classcontributor
3068
    ADD CONSTRAINT classcontributor_pkey PRIMARY KEY (classcontributor_id);
3069

    
3070

    
3071
--
3072
-- Name: commclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3073
--
3074

    
3075
ALTER TABLE commclass
3076
    ADD CONSTRAINT commclass_pkey PRIMARY KEY (commclass_id);
3077

    
3078

    
3079
--
3080
-- Name: commconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3081
--
3082

    
3083
ALTER TABLE commconcept
3084
    ADD CONSTRAINT commconcept_pkey PRIMARY KEY (commconcept_id);
3085

    
3086

    
3087
--
3088
-- Name: commconcept_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3089
--
3090

    
3091
ALTER TABLE commconcept
3092
    ADD CONSTRAINT commconcept_unique UNIQUE (commname_id);
3093

    
3094

    
3095
--
3096
-- Name: commcorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3097
--
3098

    
3099
ALTER TABLE commcorrelation
3100
    ADD CONSTRAINT commcorrelation_pkey PRIMARY KEY (commcorrelation_id);
3101

    
3102

    
3103
--
3104
-- Name: commdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3105
--
3106

    
3107
ALTER TABLE commdetermination
3108
    ADD CONSTRAINT commdetermination_pkey PRIMARY KEY (commdetermination_id);
3109

    
3110

    
3111
--
3112
-- Name: commdetermination_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3113
--
3114

    
3115
ALTER TABLE commdetermination
3116
    ADD CONSTRAINT commdetermination_unique UNIQUE (commclass_id, commconcept_id);
3117

    
3118

    
3119
--
3120
-- Name: commlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3121
--
3122

    
3123
ALTER TABLE commlineage
3124
    ADD CONSTRAINT commlineage_pkey PRIMARY KEY (commlineage_id);
3125

    
3126

    
3127
--
3128
-- Name: commname_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3129
--
3130

    
3131
ALTER TABLE commname
3132
    ADD CONSTRAINT commname_pkey PRIMARY KEY (commname_id);
3133

    
3134

    
3135
--
3136
-- Name: commname_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3137
--
3138

    
3139
ALTER TABLE commname
3140
    ADD CONSTRAINT commname_unique UNIQUE (commname);
3141

    
3142

    
3143
--
3144
-- Name: commstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3145
--
3146

    
3147
ALTER TABLE commstatus
3148
    ADD CONSTRAINT commstatus_pkey PRIMARY KEY (commstatus_id);
3149

    
3150

    
3151
--
3152
-- Name: commusage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3153
--
3154

    
3155
ALTER TABLE commusage
3156
    ADD CONSTRAINT commusage_pkey PRIMARY KEY (commusage_id);
3157

    
3158

    
3159
--
3160
-- Name: coverindex_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3161
--
3162

    
3163
ALTER TABLE coverindex
3164
    ADD CONSTRAINT coverindex_pkey PRIMARY KEY (coverindex_id);
3165

    
3166

    
3167
--
3168
-- Name: covermethod_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3169
--
3170

    
3171
ALTER TABLE covermethod
3172
    ADD CONSTRAINT covermethod_pkey PRIMARY KEY (covermethod_id);
3173

    
3174

    
3175
--
3176
-- Name: definedvalue_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3177
--
3178

    
3179
ALTER TABLE definedvalue
3180
    ADD CONSTRAINT definedvalue_pkey PRIMARY KEY (definedvalue_id);
3181

    
3182

    
3183
--
3184
-- Name: definedvalue_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3185
--
3186

    
3187
ALTER TABLE definedvalue
3188
    ADD CONSTRAINT definedvalue_unique UNIQUE (userdefined_id, tablerecord_id);
3189

    
3190

    
3191
--
3192
-- Name: disturbanceobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3193
--
3194

    
3195
ALTER TABLE disturbanceobs
3196
    ADD CONSTRAINT disturbanceobs_pkey PRIMARY KEY (disturbanceobs_id);
3197

    
3198

    
3199
--
3200
-- Name: graphic_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3201
--
3202

    
3203
ALTER TABLE graphic
3204
    ADD CONSTRAINT graphic_pkey PRIMARY KEY (graphic_id);
3205

    
3206

    
3207
--
3208
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3209
--
3210

    
3211
ALTER TABLE location
3212
    ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);
3213

    
3214

    
3215
--
3216
-- Name: locationcoords_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3217
--
3218

    
3219
ALTER TABLE locationcoords
3220
    ADD CONSTRAINT locationcoords_pkey PRIMARY KEY (locationcoords_id);
3221

    
3222

    
3223
--
3224
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3225
--
3226

    
3227
ALTER TABLE locationevent
3228
    ADD CONSTRAINT locationevent_pkey PRIMARY KEY (locationevent_id);
3229

    
3230

    
3231
--
3232
-- Name: locationeventcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3233
--
3234

    
3235
ALTER TABLE locationeventcontributor
3236
    ADD CONSTRAINT locationeventcontributor_pkey PRIMARY KEY (locationeventcontributor_id);
3237

    
3238

    
3239
--
3240
-- Name: locationeventsynonym_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3241
--
3242

    
3243
ALTER TABLE locationeventsynonym
3244
    ADD CONSTRAINT locationeventsynonym_pkey PRIMARY KEY (locationeventsynonym_id);
3245

    
3246

    
3247
--
3248
-- Name: locationplace_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3249
--
3250

    
3251
ALTER TABLE locationplace
3252
    ADD CONSTRAINT locationplace_pkey PRIMARY KEY (locationplace_id);
3253

    
3254

    
3255
--
3256
-- Name: method_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3257
--
3258

    
3259
ALTER TABLE method
3260
    ADD CONSTRAINT method_pkey PRIMARY KEY (method_id);
3261

    
3262

    
3263
--
3264
-- Name: methodtaxonclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3265
--
3266

    
3267
ALTER TABLE methodtaxonclass
3268
    ADD CONSTRAINT methodtaxonclass_pkey PRIMARY KEY (methodtaxonclass_id);
3269

    
3270

    
3271
--
3272
-- Name: methodtaxonclass_unique_description; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3273
--
3274

    
3275
ALTER TABLE methodtaxonclass
3276
    ADD CONSTRAINT methodtaxonclass_unique_description UNIQUE (method_id, taxonclass);
3277

    
3278

    
3279
--
3280
-- Name: methodtaxonclass_unique_taxonconcept_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3281
--
3282

    
3283
ALTER TABLE methodtaxonclass
3284
    ADD CONSTRAINT methodtaxonclass_unique_taxonconcept_id UNIQUE (method_id, taxonconcept_id);
3285

    
3286

    
3287
--
3288
-- Name: note_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3289
--
3290

    
3291
ALTER TABLE note
3292
    ADD CONSTRAINT note_pkey PRIMARY KEY (note_id);
3293

    
3294

    
3295
--
3296
-- Name: notelink_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3297
--
3298

    
3299
ALTER TABLE notelink
3300
    ADD CONSTRAINT notelink_pkey PRIMARY KEY (notelink_id);
3301

    
3302

    
3303
--
3304
-- Name: party_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3305
--
3306

    
3307
ALTER TABLE party
3308
    ADD CONSTRAINT party_pkey PRIMARY KEY (party_id);
3309

    
3310

    
3311
--
3312
-- Name: partymember_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3313
--
3314

    
3315
ALTER TABLE partymember
3316
    ADD CONSTRAINT partymember_pkey PRIMARY KEY (partymember_id);
3317

    
3318

    
3319
--
3320
-- Name: place_ancestor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3321
--
3322

    
3323
ALTER TABLE place_ancestor
3324
    ADD CONSTRAINT place_ancestor_pkey PRIMARY KEY (place_id, ancestor_id);
3325

    
3326

    
3327
--
3328
-- Name: place_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3329
--
3330

    
3331
ALTER TABLE place
3332
    ADD CONSTRAINT place_pkey PRIMARY KEY (place_id);
3333

    
3334

    
3335
--
3336
-- Name: placecorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3337
--
3338

    
3339
ALTER TABLE placecorrelation
3340
    ADD CONSTRAINT placecorrelation_pkey PRIMARY KEY (placecorrelation_id);
3341

    
3342

    
3343
--
3344
-- Name: placepath_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3345
--
3346

    
3347
ALTER TABLE placepath
3348
    ADD CONSTRAINT placepath_pkey PRIMARY KEY (placepath_id);
3349

    
3350

    
3351
--
3352
-- Name: plant_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3353
--
3354

    
3355
ALTER TABLE plant
3356
    ADD CONSTRAINT plant_pkey PRIMARY KEY (plant_id);
3357

    
3358

    
3359
--
3360
-- Name: plantobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3361
--
3362

    
3363
ALTER TABLE plantobservation
3364
    ADD CONSTRAINT plantobservation_pkey PRIMARY KEY (plantobservation_id);
3365

    
3366

    
3367
--
3368
-- Name: project_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3369
--
3370

    
3371
ALTER TABLE project
3372
    ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);
3373

    
3374

    
3375
--
3376
-- Name: project_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3377
--
3378

    
3379
ALTER TABLE project
3380
    ADD CONSTRAINT project_unique UNIQUE (creator_id, projectname);
3381

    
3382

    
3383
--
3384
-- Name: projectcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3385
--
3386

    
3387
ALTER TABLE projectcontributor
3388
    ADD CONSTRAINT projectcontributor_pkey PRIMARY KEY (projectcontributor_id);
3389

    
3390

    
3391
--
3392
-- Name: reference_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3393
--
3394

    
3395
ALTER TABLE reference
3396
    ADD CONSTRAINT reference_pkey PRIMARY KEY (reference_id);
3397

    
3398

    
3399
--
3400
-- Name: referencealtident_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3401
--
3402

    
3403
ALTER TABLE referencealtident
3404
    ADD CONSTRAINT referencealtident_pkey PRIMARY KEY (referencealtident_id);
3405

    
3406

    
3407
--
3408
-- Name: referencecontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3409
--
3410

    
3411
ALTER TABLE referencecontributor
3412
    ADD CONSTRAINT referencecontributor_pkey PRIMARY KEY (referencecontributor_id);
3413

    
3414

    
3415
--
3416
-- Name: referencejournal_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3417
--
3418

    
3419
ALTER TABLE referencejournal
3420
    ADD CONSTRAINT referencejournal_pkey PRIMARY KEY (referencejournal_id);
3421

    
3422

    
3423
--
3424
-- Name: referenceparty_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3425
--
3426

    
3427
ALTER TABLE referenceparty
3428
    ADD CONSTRAINT referenceparty_pkey PRIMARY KEY (referenceparty_id);
3429

    
3430

    
3431
--
3432
-- Name: revision_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3433
--
3434

    
3435
ALTER TABLE revision
3436
    ADD CONSTRAINT revision_pkey PRIMARY KEY (revision_id);
3437

    
3438

    
3439
--
3440
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3441
--
3442

    
3443
ALTER TABLE soilobs
3444
    ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);
3445

    
3446

    
3447
--
3448
-- Name: soilobs_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3449
--
3450

    
3451
ALTER TABLE soilobs
3452
    ADD CONSTRAINT soilobs_unique UNIQUE (locationevent_id);
3453

    
3454

    
3455
--
3456
-- Name: soiltaxon_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3457
--
3458

    
3459
ALTER TABLE soiltaxon
3460
    ADD CONSTRAINT soiltaxon_pkey PRIMARY KEY (soiltaxon_id);
3461

    
3462

    
3463
--
3464
-- Name: specimen_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3465
--
3466

    
3467
ALTER TABLE specimen
3468
    ADD CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id);
3469

    
3470

    
3471
--
3472
-- Name: specimenreplicate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3473
--
3474

    
3475
ALTER TABLE specimenreplicate
3476
    ADD CONSTRAINT specimenreplicate_pkey PRIMARY KEY (specimenreplicate_id);
3477

    
3478

    
3479
--
3480
-- Name: stemobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3481
--
3482

    
3483
ALTER TABLE stemobservation
3484
    ADD CONSTRAINT stemobservation_pkey PRIMARY KEY (stemobservation_id);
3485

    
3486

    
3487
--
3488
-- Name: stratum_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3489
--
3490

    
3491
ALTER TABLE stratum
3492
    ADD CONSTRAINT stratum_pkey PRIMARY KEY (stratum_id);
3493

    
3494

    
3495
--
3496
-- Name: taxonalt_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3497
--
3498

    
3499
ALTER TABLE taxonalt
3500
    ADD CONSTRAINT taxonalt_pkey PRIMARY KEY (taxonalt_id);
3501

    
3502

    
3503
--
3504
-- Name: taxonconcept_ancestor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3505
--
3506

    
3507
ALTER TABLE taxonconcept_ancestor
3508
    ADD CONSTRAINT taxonconcept_ancestor_pkey PRIMARY KEY (taxonconcept_id, ancestor_id);
3509

    
3510

    
3511
--
3512
-- Name: taxonconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3513
--
3514

    
3515
ALTER TABLE taxonconcept
3516
    ADD CONSTRAINT taxonconcept_pkey PRIMARY KEY (taxonconcept_id);
3517

    
3518

    
3519
--
3520
-- Name: taxoncorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3521
--
3522

    
3523
ALTER TABLE taxoncorrelation
3524
    ADD CONSTRAINT taxoncorrelation_pkey PRIMARY KEY (taxoncorrelation_id);
3525

    
3526

    
3527
--
3528
-- Name: taxondetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3529
--
3530

    
3531
ALTER TABLE taxondetermination
3532
    ADD CONSTRAINT taxondetermination_pkey PRIMARY KEY (taxondetermination_id);
3533

    
3534

    
3535
--
3536
-- Name: taxonlineage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3537
--
3538

    
3539
ALTER TABLE taxonlineage
3540
    ADD CONSTRAINT taxonlineage_pkey PRIMARY KEY (taxonlineage_id);
3541

    
3542

    
3543
--
3544
-- Name: taxonoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3545
--
3546

    
3547
ALTER TABLE taxonoccurrence
3548
    ADD CONSTRAINT taxonoccurrence_pkey PRIMARY KEY (taxonoccurrence_id);
3549

    
3550

    
3551
--
3552
-- Name: taxonstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3553
--
3554

    
3555
ALTER TABLE taxonstatus
3556
    ADD CONSTRAINT taxonstatus_pkey PRIMARY KEY (taxonstatus_id);
3557

    
3558

    
3559
--
3560
-- Name: taxonstatus_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3561
--
3562

    
3563
ALTER TABLE taxonstatus
3564
    ADD CONSTRAINT taxonstatus_unique UNIQUE (taxonconcept_id, party_id);
3565

    
3566

    
3567
--
3568
-- Name: taxonusage_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3569
--
3570

    
3571
ALTER TABLE taxonusage
3572
    ADD CONSTRAINT taxonusage_pkey PRIMARY KEY (taxonusage_id);
3573

    
3574

    
3575
--
3576
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3577
--
3578

    
3579
ALTER TABLE telephone
3580
    ADD CONSTRAINT telephone_pkey PRIMARY KEY (telephone_id);
3581

    
3582

    
3583
--
3584
-- Name: trait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3585
--
3586

    
3587
ALTER TABLE trait
3588
    ADD CONSTRAINT trait_pkey PRIMARY KEY (trait_id);
3589

    
3590

    
3591
--
3592
-- Name: userdefined_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3593
--
3594

    
3595
ALTER TABLE userdefined
3596
    ADD CONSTRAINT userdefined_pkey PRIMARY KEY (userdefined_id);
3597

    
3598

    
3599
--
3600
-- Name: userdefined_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3601
--
3602

    
3603
ALTER TABLE userdefined
3604
    ADD CONSTRAINT userdefined_unique UNIQUE (tablename, userdefinedname);
3605

    
3606

    
3607
--
3608
-- Name: voucher_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3609
--
3610

    
3611
ALTER TABLE voucher
3612
    ADD CONSTRAINT voucher_pkey PRIMARY KEY (voucher_id);
3613

    
3614

    
3615
--
3616
-- Name: voucher_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3617
--
3618

    
3619
ALTER TABLE voucher
3620
    ADD CONSTRAINT voucher_unique UNIQUE (taxonoccurrence_id, specimenreplicate_id);
3621

    
3622

    
3623
--
3624
-- Name: aggregateoccurrence_taxonoccurrence; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3625
--
3626

    
3627
CREATE INDEX aggregateoccurrence_taxonoccurrence ON aggregateoccurrence  (taxonoccurrence_id);
3628

    
3629

    
3630
--
3631
-- Name: aggregateoccurrence_taxonoccurrence_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3632
--
3633

    
3634

    
3635

    
3636

    
3637
--
3638
-- Name: aggregateoccurrence_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3639
--
3640

    
3641

    
3642

    
3643

    
3644
--
3645
-- Name: commclass_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3646
--
3647

    
3648
CREATE UNIQUE INDEX commclass_accessioncode_index ON commclass  (accessioncode);
3649

    
3650

    
3651
--
3652
-- Name: commclass_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3653
--
3654

    
3655

    
3656

    
3657

    
3658
--
3659
-- Name: commconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3660
--
3661

    
3662
CREATE UNIQUE INDEX commconcept_accessioncode_index ON commconcept  (accessioncode);
3663

    
3664

    
3665
--
3666
-- Name: commstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3667
--
3668

    
3669
CREATE UNIQUE INDEX commstatus_accessioncode_index ON commstatus  (accessioncode);
3670

    
3671

    
3672
--
3673
-- Name: covermethod_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3674
--
3675

    
3676
CREATE UNIQUE INDEX covermethod_accessioncode_index ON covermethod  (accessioncode);
3677

    
3678

    
3679
--
3680
-- Name: graphic_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3681
--
3682

    
3683
CREATE UNIQUE INDEX graphic_accessioncode_index ON graphic  (accessioncode);
3684

    
3685

    
3686
--
3687
-- Name: location_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3688
--
3689

    
3690
CREATE UNIQUE INDEX location_accessioncode_index ON location  (accessioncode);
3691

    
3692

    
3693
--
3694
-- Name: location_unique_within_creator_by_authorlocationcode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3695
--
3696

    
3697

    
3698

    
3699

    
3700
--
3701
-- Name: location_unique_within_creator_by_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3702
--
3703

    
3704

    
3705

    
3706

    
3707
--
3708
-- Name: location_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3709
--
3710

    
3711

    
3712

    
3713

    
3714
--
3715
-- Name: locationcoords_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3716
--
3717

    
3718

    
3719

    
3720

    
3721
--
3722
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3723
--
3724

    
3725
CREATE UNIQUE INDEX locationevent_accessioncode_index ON locationevent  (accessioncode);
3726

    
3727

    
3728
--
3729
-- Name: locationevent_location; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3730
--
3731

    
3732
CREATE INDEX locationevent_location ON locationevent  (location_id);
3733

    
3734

    
3735
--
3736
-- Name: locationevent_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3737
--
3738

    
3739

    
3740

    
3741

    
3742
--
3743
-- Name: locationevent_unique_within_location; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3744
--
3745

    
3746

    
3747

    
3748

    
3749
--
3750
-- Name: locationevent_unique_within_parent_by_authoreventcode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3751
--
3752

    
3753

    
3754

    
3755

    
3756
--
3757
-- Name: locationevent_unique_within_parent_by_location; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3758
--
3759

    
3760

    
3761

    
3762

    
3763
--
3764
-- Name: locationevent_unique_within_project; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3765
--
3766

    
3767

    
3768

    
3769

    
3770
--
3771
-- Name: locationeventsynonym_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3772
--
3773

    
3774
CREATE UNIQUE INDEX locationeventsynonym_accessioncode_index ON locationeventsynonym  (accessioncode);
3775

    
3776

    
3777
--
3778
-- Name: locationplace_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3779
--
3780

    
3781

    
3782

    
3783

    
3784
--
3785
-- Name: method_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3786
--
3787

    
3788
CREATE UNIQUE INDEX method_accessioncode ON method  (accessioncode);
3789

    
3790

    
3791
--
3792
-- Name: method_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3793
--
3794

    
3795

    
3796

    
3797

    
3798
--
3799
-- Name: note_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3800
--
3801

    
3802
CREATE UNIQUE INDEX note_accessioncode_index ON note  (accessioncode);
3803

    
3804

    
3805
--
3806
-- Name: party_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3807
--
3808

    
3809
CREATE UNIQUE INDEX party_accessioncode_index ON party  (accessioncode);
3810

    
3811

    
3812
--
3813
-- Name: party_unique_root; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3814
--
3815

    
3816

    
3817

    
3818

    
3819
--
3820
-- Name: party_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3821
--
3822

    
3823

    
3824

    
3825

    
3826
--
3827
-- Name: place_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3828
--
3829

    
3830
CREATE UNIQUE INDEX place_accessioncode_index ON place  (accessioncode);
3831

    
3832

    
3833
--
3834
-- Name: place_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3835
--
3836

    
3837

    
3838

    
3839

    
3840
--
3841
-- Name: placepath_unique_within_creator_by_code; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3842
--
3843

    
3844

    
3845

    
3846

    
3847
--
3848
-- Name: placepath_unique_within_creator_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3849
--
3850

    
3851

    
3852

    
3853

    
3854
--
3855
-- Name: plantobservation_aggregateoccurrence_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3856
--
3857

    
3858
CREATE UNIQUE INDEX plantobservation_aggregateoccurrence_1_to_1 ON plantobservation  (aggregateoccurrence_id);
3859

    
3860

    
3861
--
3862
-- Name: plantobservation_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3863
--
3864

    
3865

    
3866

    
3867

    
3868
--
3869
-- Name: project_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3870
--
3871

    
3872
CREATE UNIQUE INDEX project_accessioncode_index ON project  (accessioncode);
3873

    
3874

    
3875
--
3876
-- Name: project_unique_name_date; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3877
--
3878

    
3879

    
3880

    
3881

    
3882
--
3883
-- Name: project_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3884
--
3885

    
3886

    
3887

    
3888

    
3889
--
3890
-- Name: reference_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3891
--
3892

    
3893
CREATE UNIQUE INDEX reference_accessioncode_index ON reference  (accessioncode);
3894

    
3895

    
3896
--
3897
-- Name: referencejournal_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3898
--
3899

    
3900
CREATE UNIQUE INDEX referencejournal_accessioncode_index ON referencejournal  (accessioncode);
3901

    
3902

    
3903
--
3904
-- Name: referenceparty_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3905
--
3906

    
3907
CREATE UNIQUE INDEX referenceparty_accessioncode_index ON referenceparty  (accessioncode);
3908

    
3909

    
3910
--
3911
-- Name: soiltaxon_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3912
--
3913

    
3914
CREATE UNIQUE INDEX soiltaxon_accessioncode_index ON soiltaxon  (accessioncode);
3915

    
3916

    
3917
--
3918
-- Name: specimenreplicate_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3919
--
3920

    
3921
CREATE INDEX specimenreplicate_plantobservation ON specimenreplicate  (plantobservation_id);
3922

    
3923

    
3924
--
3925
-- Name: specimenreplicate_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3926
--
3927

    
3928

    
3929

    
3930

    
3931
--
3932
-- Name: specimenreplicate_unique_catalognumber; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3933
--
3934

    
3935

    
3936

    
3937

    
3938
--
3939
-- Name: specimenreplicate_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3940
--
3941

    
3942

    
3943

    
3944

    
3945
--
3946
-- Name: stemobservation_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3947
--
3948

    
3949

    
3950

    
3951

    
3952
--
3953
-- Name: stemobservation_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3954
--
3955

    
3956

    
3957

    
3958

    
3959
--
3960
-- Name: stemobservation_unique_within_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3961
--
3962

    
3963

    
3964

    
3965

    
3966
--
3967
-- Name: taxonconcept_0_unique_identifying_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3968
--
3969

    
3970

    
3971

    
3972

    
3973
--
3974
-- Name: taxonconcept_1_unique_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3975
--
3976

    
3977

    
3978

    
3979

    
3980
--
3981
-- Name: taxonconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3982
--
3983

    
3984
CREATE UNIQUE INDEX taxonconcept_accessioncode_index ON taxonconcept  (accessioncode);
3985

    
3986

    
3987
--
3988
-- Name: taxonconcept_matched_concept_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3989
--
3990

    
3991
CREATE INDEX taxonconcept_matched_concept_id_idx ON taxonconcept  (matched_concept_id);
3992

    
3993

    
3994
--
3995
-- Name: taxonconcept_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3996
--
3997

    
3998

    
3999

    
4000

    
4001
--
4002
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4003
--
4004

    
4005
CREATE UNIQUE INDEX taxondetermination_accessioncode_index ON taxondetermination  (accessioncode);
4006

    
4007

    
4008
--
4009
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4010
--
4011

    
4012

    
4013

    
4014

    
4015
--
4016
-- Name: taxonoccurrence_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4017
--
4018

    
4019
CREATE UNIQUE INDEX taxonoccurrence_accessioncode_index ON taxonoccurrence  (accessioncode);
4020

    
4021

    
4022
--
4023
-- Name: taxonoccurrence_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4024
--
4025

    
4026
CREATE INDEX taxonoccurrence_locationevent ON taxonoccurrence  (locationevent_id);
4027

    
4028

    
4029
--
4030
-- Name: taxonoccurrence_unique_within_creator; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4031
--
4032

    
4033

    
4034

    
4035

    
4036
--
4037
-- Name: taxonoccurrence_unique_within_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4038
--
4039

    
4040

    
4041

    
4042

    
4043
--
4044
-- Name: taxonstatus_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4045
--
4046

    
4047
CREATE UNIQUE INDEX taxonstatus_accessioncode_index ON taxonstatus  (accessioncode);
4048

    
4049

    
4050
--
4051
-- Name: userdefined_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4052
--
4053

    
4054
CREATE UNIQUE INDEX userdefined_accessioncode_index ON userdefined  (accessioncode);
4055

    
4056

    
4057
--
4058
-- Name: party_creator_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4059
--
4060

    
4061

    
4062

    
4063

    
4064
--
4065
-- Name: place_update_ancestors; Type: TRIGGER; Schema: public; Owner: -
4066
--
4067

    
4068

    
4069

    
4070

    
4071
--
4072
-- Name: placepath_matched_placepath_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4073
--
4074

    
4075

    
4076

    
4077

    
4078
--
4079
-- Name: plantobservation_aggregateoccurrence_count_1; Type: TRIGGER; Schema: public; Owner: -
4080
--
4081

    
4082

    
4083

    
4084

    
4085
--
4086
-- Name: taxonconcept_0_matched_concept_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
4087
--
4088

    
4089

    
4090

    
4091

    
4092
--
4093
-- Name: taxonconcept_1_matched_concept_min_fit; Type: TRIGGER; Schema: public; Owner: -
4094
--
4095

    
4096

    
4097

    
4098

    
4099
--
4100
-- Name: taxonconcept_2_propagate_accepted_concept_id; Type: TRIGGER; Schema: public; Owner: -
4101
--
4102

    
4103

    
4104

    
4105

    
4106
--
4107
-- Name: taxonconcept_update_ancestors; Type: TRIGGER; Schema: public; Owner: -
4108
--
4109

    
4110

    
4111

    
4112

    
4113
--
4114
-- Name: address_organization_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4115
--
4116

    
4117
ALTER TABLE address
4118
    ADD CONSTRAINT address_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4119

    
4120

    
4121
--
4122
-- Name: address_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4123
--
4124

    
4125
ALTER TABLE address
4126
    ADD CONSTRAINT address_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4127

    
4128

    
4129
--
4130
-- Name: aggregateoccurrence_coverindex_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4131
--
4132

    
4133

    
4134

    
4135

    
4136
--
4137
-- Name: aggregateoccurrence_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4138
--
4139

    
4140

    
4141

    
4142

    
4143
--
4144
-- Name: aggregateoccurrence_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4145
--
4146

    
4147

    
4148

    
4149

    
4150
--
4151
-- Name: aggregateoccurrence_stratum_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4152
--
4153

    
4154
ALTER TABLE aggregateoccurrence
4155
    ADD CONSTRAINT aggregateoccurrence_stratum_id_fkey FOREIGN KEY (stratum_id) REFERENCES stratum(stratum_id) ON UPDATE CASCADE ON DELETE CASCADE;
4156

    
4157

    
4158
--
4159
-- Name: aggregateoccurrence_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4160
--
4161

    
4162
ALTER TABLE aggregateoccurrence
4163
    ADD CONSTRAINT aggregateoccurrence_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4164

    
4165

    
4166
--
4167
-- Name: classcontributor_commclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4168
--
4169

    
4170
ALTER TABLE classcontributor
4171
    ADD CONSTRAINT classcontributor_commclass_id_fkey FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id) ON UPDATE CASCADE ON DELETE CASCADE;
4172

    
4173

    
4174
--
4175
-- Name: classcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4176
--
4177

    
4178

    
4179

    
4180

    
4181
--
4182
-- Name: commclass_classpublication_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4183
--
4184

    
4185

    
4186

    
4187

    
4188
--
4189
-- Name: commclass_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4190
--
4191

    
4192

    
4193

    
4194

    
4195
--
4196
-- Name: commconcept_commname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4197
--
4198

    
4199
ALTER TABLE commconcept
4200
    ADD CONSTRAINT commconcept_commname_id_fkey FOREIGN KEY (commname_id) REFERENCES commname(commname_id) ON UPDATE CASCADE ON DELETE CASCADE;
4201

    
4202

    
4203
--
4204
-- Name: commconcept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4205
--
4206

    
4207

    
4208

    
4209

    
4210
--
4211
-- Name: commcorrelation_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4212
--
4213

    
4214
ALTER TABLE commcorrelation
4215
    ADD CONSTRAINT commcorrelation_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4216

    
4217

    
4218
--
4219
-- Name: commcorrelation_commstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4220
--
4221

    
4222
ALTER TABLE commcorrelation
4223
    ADD CONSTRAINT commcorrelation_commstatus_id_fkey FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4224

    
4225

    
4226
--
4227
-- Name: commdetermination_commauthority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4228
--
4229

    
4230

    
4231

    
4232

    
4233
--
4234
-- Name: commdetermination_commclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4235
--
4236

    
4237
ALTER TABLE commdetermination
4238
    ADD CONSTRAINT commdetermination_commclass_id_fkey FOREIGN KEY (commclass_id) REFERENCES commclass(commclass_id) ON UPDATE CASCADE ON DELETE CASCADE;
4239

    
4240

    
4241
--
4242
-- Name: commdetermination_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4243
--
4244

    
4245
ALTER TABLE commdetermination
4246
    ADD CONSTRAINT commdetermination_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4247

    
4248

    
4249
--
4250
-- Name: commlineage_childcommstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4251
--
4252

    
4253
ALTER TABLE commlineage
4254
    ADD CONSTRAINT commlineage_childcommstatus_id_fkey FOREIGN KEY (childcommstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4255

    
4256

    
4257
--
4258
-- Name: commlineage_parentcommstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4259
--
4260

    
4261
ALTER TABLE commlineage
4262
    ADD CONSTRAINT commlineage_parentcommstatus_id_fkey FOREIGN KEY (parentcommstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4263

    
4264

    
4265
--
4266
-- Name: commname_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4267
--
4268

    
4269

    
4270

    
4271

    
4272
--
4273
-- Name: commstatus_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4274
--
4275

    
4276
ALTER TABLE commstatus
4277
    ADD CONSTRAINT commstatus_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4278

    
4279

    
4280
--
4281
-- Name: commstatus_commparent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4282
--
4283

    
4284
ALTER TABLE commstatus
4285
    ADD CONSTRAINT commstatus_commparent_id_fkey FOREIGN KEY (commparent_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4286

    
4287

    
4288
--
4289
-- Name: commstatus_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4290
--
4291

    
4292

    
4293

    
4294

    
4295
--
4296
-- Name: commstatus_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4297
--
4298

    
4299

    
4300

    
4301

    
4302
--
4303
-- Name: commusage_commconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4304
--
4305

    
4306
ALTER TABLE commusage
4307
    ADD CONSTRAINT commusage_commconcept_id_fkey FOREIGN KEY (commconcept_id) REFERENCES commconcept(commconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4308

    
4309

    
4310
--
4311
-- Name: commusage_commname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4312
--
4313

    
4314
ALTER TABLE commusage
4315
    ADD CONSTRAINT commusage_commname_id_fkey FOREIGN KEY (commname_id) REFERENCES commname(commname_id) ON UPDATE CASCADE ON DELETE CASCADE;
4316

    
4317

    
4318
--
4319
-- Name: commusage_commstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4320
--
4321

    
4322
ALTER TABLE commusage
4323
    ADD CONSTRAINT commusage_commstatus_id_fkey FOREIGN KEY (commstatus_id) REFERENCES commstatus(commstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4324

    
4325

    
4326
--
4327
-- Name: commusage_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4328
--
4329

    
4330

    
4331

    
4332

    
4333
--
4334
-- Name: coverindex_covermethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4335
--
4336

    
4337
ALTER TABLE coverindex
4338
    ADD CONSTRAINT coverindex_covermethod_id_fkey FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
4339

    
4340

    
4341
--
4342
-- Name: covermethod_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4343
--
4344

    
4345

    
4346

    
4347

    
4348
--
4349
-- Name: definedvalue_userdefined_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4350
--
4351

    
4352
ALTER TABLE definedvalue
4353
    ADD CONSTRAINT definedvalue_userdefined_id_fkey FOREIGN KEY (userdefined_id) REFERENCES userdefined(userdefined_id) ON UPDATE CASCADE ON DELETE CASCADE;
4354

    
4355

    
4356
--
4357
-- Name: disturbanceobs_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4358
--
4359

    
4360
ALTER TABLE disturbanceobs
4361
    ADD CONSTRAINT disturbanceobs_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4362

    
4363

    
4364
--
4365
-- Name: graphic_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4366
--
4367

    
4368
ALTER TABLE graphic
4369
    ADD CONSTRAINT graphic_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4370

    
4371

    
4372
--
4373
-- Name: location_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4374
--
4375

    
4376

    
4377

    
4378

    
4379
--
4380
-- Name: location_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4381
--
4382

    
4383
ALTER TABLE location
4384
    ADD CONSTRAINT location_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4385

    
4386

    
4387
--
4388
-- Name: locationcoords_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4389
--
4390

    
4391

    
4392

    
4393

    
4394
--
4395
-- Name: locationcoords_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4396
--
4397

    
4398
ALTER TABLE locationcoords
4399
    ADD CONSTRAINT locationcoords_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4400

    
4401

    
4402
--
4403
-- Name: locationevent_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4404
--
4405

    
4406

    
4407

    
4408

    
4409
--
4410
-- Name: locationevent_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4411
--
4412

    
4413
ALTER TABLE locationevent
4414
    ADD CONSTRAINT locationevent_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4415

    
4416

    
4417
--
4418
-- Name: locationevent_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4419
--
4420

    
4421

    
4422

    
4423

    
4424
--
4425
-- Name: locationevent_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4426
--
4427

    
4428
ALTER TABLE locationevent
4429
    ADD CONSTRAINT locationevent_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4430

    
4431

    
4432
--
4433
-- Name: locationevent_previous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4434
--
4435

    
4436
ALTER TABLE locationevent
4437
    ADD CONSTRAINT locationevent_previous_id_fkey FOREIGN KEY (previous_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4438

    
4439

    
4440
--
4441
-- Name: locationevent_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4442
--
4443

    
4444
ALTER TABLE locationevent
4445
    ADD CONSTRAINT locationevent_project_id_fkey FOREIGN KEY (project_id) REFERENCES project(project_id) ON UPDATE CASCADE ON DELETE CASCADE;
4446

    
4447

    
4448
--
4449
-- Name: locationevent_soiltaxon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4450
--
4451

    
4452
ALTER TABLE locationevent
4453
    ADD CONSTRAINT locationevent_soiltaxon_id_fkey FOREIGN KEY (soiltaxon_id) REFERENCES soiltaxon(soiltaxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
4454

    
4455

    
4456
--
4457
-- Name: locationeventcontributor_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4458
--
4459

    
4460
ALTER TABLE locationeventcontributor
4461
    ADD CONSTRAINT locationeventcontributor_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4462

    
4463

    
4464
--
4465
-- Name: locationeventcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4466
--
4467

    
4468

    
4469

    
4470

    
4471
--
4472
-- Name: locationeventsynonym_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4473
--
4474

    
4475

    
4476

    
4477

    
4478
--
4479
-- Name: locationeventsynonym_primarylocationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4480
--
4481

    
4482
ALTER TABLE locationeventsynonym
4483
    ADD CONSTRAINT locationeventsynonym_primarylocationevent_id_fkey FOREIGN KEY (primarylocationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4484

    
4485

    
4486
--
4487
-- Name: locationeventsynonym_synonymlocationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4488
--
4489

    
4490
ALTER TABLE locationeventsynonym
4491
    ADD CONSTRAINT locationeventsynonym_synonymlocationevent_id_fkey FOREIGN KEY (synonymlocationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4492

    
4493

    
4494
--
4495
-- Name: locationplace_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4496
--
4497

    
4498

    
4499

    
4500

    
4501
--
4502
-- Name: locationplace_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4503
--
4504

    
4505
ALTER TABLE locationplace
4506
    ADD CONSTRAINT locationplace_location_id_fkey FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
4507

    
4508

    
4509
--
4510
-- Name: locationplace_placepath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4511
--
4512

    
4513
ALTER TABLE locationplace
4514
    ADD CONSTRAINT locationplace_placepath_id_fkey FOREIGN KEY (placepath_id) REFERENCES placepath(placepath_id) ON UPDATE CASCADE ON DELETE CASCADE;
4515

    
4516

    
4517
--
4518
-- Name: method_covermethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4519
--
4520

    
4521
ALTER TABLE method
4522
    ADD CONSTRAINT method_covermethod_id_fkey FOREIGN KEY (covermethod_id) REFERENCES covermethod(covermethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
4523

    
4524

    
4525
--
4526
-- Name: method_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4527
--
4528

    
4529

    
4530

    
4531

    
4532
--
4533
-- Name: method_subplotmethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4534
--
4535

    
4536
ALTER TABLE method
4537
    ADD CONSTRAINT method_subplotmethod_id_fkey FOREIGN KEY (subplotmethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
4538

    
4539

    
4540
--
4541
-- Name: methodtaxonclass_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4542
--
4543

    
4544
ALTER TABLE methodtaxonclass
4545
    ADD CONSTRAINT methodtaxonclass_method_id_fkey FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
4546

    
4547

    
4548
--
4549
-- Name: methodtaxonclass_submethod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4550
--
4551

    
4552
ALTER TABLE methodtaxonclass
4553
    ADD CONSTRAINT methodtaxonclass_submethod_id_fkey FOREIGN KEY (submethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
4554

    
4555

    
4556
--
4557
-- Name: methodtaxonclass_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4558
--
4559

    
4560
ALTER TABLE methodtaxonclass
4561
    ADD CONSTRAINT methodtaxonclass_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4562

    
4563

    
4564
--
4565
-- Name: note_notelink_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4566
--
4567

    
4568
ALTER TABLE note
4569
    ADD CONSTRAINT note_notelink_id_fkey FOREIGN KEY (notelink_id) REFERENCES notelink(notelink_id) ON UPDATE CASCADE ON DELETE CASCADE;
4570

    
4571

    
4572
--
4573
-- Name: note_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4574
--
4575

    
4576

    
4577

    
4578

    
4579
--
4580
-- Name: party_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4581
--
4582

    
4583
ALTER TABLE party
4584
    ADD CONSTRAINT party_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4585

    
4586

    
4587
--
4588
-- Name: party_currentname_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4589
--
4590

    
4591
ALTER TABLE party
4592
    ADD CONSTRAINT party_currentname_id_fkey FOREIGN KEY (currentname_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4593

    
4594

    
4595
--
4596
-- Name: partymember_childparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4597
--
4598

    
4599
ALTER TABLE partymember
4600
    ADD CONSTRAINT partymember_childparty_id_fkey FOREIGN KEY (childparty_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4601

    
4602

    
4603
--
4604
-- Name: partymember_parentparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4605
--
4606

    
4607
ALTER TABLE partymember
4608
    ADD CONSTRAINT partymember_parentparty_id_fkey FOREIGN KEY (parentparty_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
4609

    
4610

    
4611
--
4612
-- Name: place_ancestor_ancestor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4613
--
4614

    
4615
ALTER TABLE place_ancestor
4616
    ADD CONSTRAINT place_ancestor_ancestor_id_fkey FOREIGN KEY (ancestor_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4617

    
4618

    
4619
--
4620
-- Name: place_ancestor_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4621
--
4622

    
4623
ALTER TABLE place_ancestor
4624
    ADD CONSTRAINT place_ancestor_place_id_fkey FOREIGN KEY (place_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4625

    
4626

    
4627
--
4628
-- Name: place_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4629
--
4630

    
4631
ALTER TABLE place
4632
    ADD CONSTRAINT place_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4633

    
4634

    
4635
--
4636
-- Name: placecorrelation_childplace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4637
--
4638

    
4639
ALTER TABLE placecorrelation
4640
    ADD CONSTRAINT placecorrelation_childplace_id_fkey FOREIGN KEY (childplace_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4641

    
4642

    
4643
--
4644
-- Name: placecorrelation_parentplace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4645
--
4646

    
4647
ALTER TABLE placecorrelation
4648
    ADD CONSTRAINT placecorrelation_parentplace_id_fkey FOREIGN KEY (parentplace_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4649

    
4650

    
4651
--
4652
-- Name: placepath_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4653
--
4654

    
4655

    
4656

    
4657

    
4658
--
4659
-- Name: placepath_matched_placepath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4660
--
4661

    
4662
ALTER TABLE placepath
4663
    ADD CONSTRAINT placepath_matched_placepath_id_fkey FOREIGN KEY (matched_placepath_id) REFERENCES placepath(placepath_id) ON UPDATE CASCADE ON DELETE CASCADE;
4664

    
4665

    
4666
--
4667
-- Name: placepath_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4668
--
4669

    
4670
ALTER TABLE placepath
4671
    ADD CONSTRAINT placepath_place_id_fkey FOREIGN KEY (place_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE;
4672

    
4673

    
4674
--
4675
-- Name: plantobservation_aggregateoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4676
--
4677

    
4678
ALTER TABLE plantobservation
4679
    ADD CONSTRAINT plantobservation_aggregateoccurrence_id_fkey FOREIGN KEY (aggregateoccurrence_id) REFERENCES aggregateoccurrence(aggregateoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4680

    
4681

    
4682
--
4683
-- Name: plantobservation_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4684
--
4685

    
4686

    
4687

    
4688

    
4689
--
4690
-- Name: plantobservation_plant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4691
--
4692

    
4693
ALTER TABLE plantobservation
4694
    ADD CONSTRAINT plantobservation_plant_id_fkey FOREIGN KEY (plant_id) REFERENCES plant(plant_id) ON UPDATE CASCADE ON DELETE CASCADE;
4695

    
4696

    
4697
--
4698
-- Name: project_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4699
--
4700

    
4701

    
4702

    
4703

    
4704
--
4705
-- Name: projectcontributor_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4706
--
4707

    
4708

    
4709

    
4710

    
4711
--
4712
-- Name: projectcontributor_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4713
--
4714

    
4715
ALTER TABLE projectcontributor
4716
    ADD CONSTRAINT projectcontributor_project_id_fkey FOREIGN KEY (project_id) REFERENCES project(project_id) ON UPDATE CASCADE ON DELETE CASCADE;
4717

    
4718

    
4719
--
4720
-- Name: reference_referencejournal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4721
--
4722

    
4723
ALTER TABLE reference
4724
    ADD CONSTRAINT reference_referencejournal_id_fkey FOREIGN KEY (referencejournal_id) REFERENCES referencejournal(referencejournal_id) ON UPDATE CASCADE ON DELETE CASCADE;
4725

    
4726

    
4727
--
4728
-- Name: referencealtident_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4729
--
4730

    
4731
ALTER TABLE referencealtident
4732
    ADD CONSTRAINT referencealtident_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
4733

    
4734

    
4735
--
4736
-- Name: referencecontributor_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4737
--
4738

    
4739
ALTER TABLE referencecontributor
4740
    ADD CONSTRAINT referencecontributor_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
4741

    
4742

    
4743
--
4744
-- Name: referencecontributor_referenceparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4745
--
4746

    
4747
ALTER TABLE referencecontributor
4748
    ADD CONSTRAINT referencecontributor_referenceparty_id_fkey FOREIGN KEY (referenceparty_id) REFERENCES referenceparty(referenceparty_id) ON UPDATE CASCADE ON DELETE CASCADE;
4749

    
4750

    
4751
--
4752
-- Name: referenceparty_currentparty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4753
--
4754

    
4755
ALTER TABLE referenceparty
4756
    ADD CONSTRAINT referenceparty_currentparty_id_fkey FOREIGN KEY (currentparty_id) REFERENCES referenceparty(referenceparty_id) ON UPDATE CASCADE ON DELETE CASCADE;
4757

    
4758

    
4759
--
4760
-- Name: revision_previousrevision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4761
--
4762

    
4763
ALTER TABLE revision
4764
    ADD CONSTRAINT revision_previousrevision_id_fkey FOREIGN KEY (previousrevision_id) REFERENCES revision(revision_id) ON UPDATE CASCADE ON DELETE CASCADE;
4765

    
4766

    
4767
--
4768
-- Name: soilobs_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4769
--
4770

    
4771
ALTER TABLE soilobs
4772
    ADD CONSTRAINT soilobs_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4773

    
4774

    
4775
--
4776
-- Name: soiltaxon_soilparent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4777
--
4778

    
4779
ALTER TABLE soiltaxon
4780
    ADD CONSTRAINT soiltaxon_soilparent_id_fkey FOREIGN KEY (soilparent_id) REFERENCES soiltaxon(soiltaxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
4781

    
4782

    
4783
--
4784
-- Name: specimenreplicate_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4785
--
4786

    
4787

    
4788

    
4789

    
4790
--
4791
-- Name: specimenreplicate_institution_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4792
--
4793

    
4794

    
4795

    
4796

    
4797
--
4798
-- Name: specimenreplicate_plantobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4799
--
4800

    
4801
ALTER TABLE specimenreplicate
4802
    ADD CONSTRAINT specimenreplicate_plantobservation_id_fkey FOREIGN KEY (plantobservation_id) REFERENCES plantobservation(plantobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
4803

    
4804

    
4805
--
4806
-- Name: specimenreplicate_specimen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4807
--
4808

    
4809
ALTER TABLE specimenreplicate
4810
    ADD CONSTRAINT specimenreplicate_specimen_id_fkey FOREIGN KEY (specimen_id) REFERENCES specimen(specimen_id) ON UPDATE CASCADE ON DELETE CASCADE;
4811

    
4812

    
4813
--
4814
-- Name: stemobservation_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4815
--
4816

    
4817

    
4818

    
4819

    
4820
--
4821
-- Name: stemobservation_plantobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4822
--
4823

    
4824
ALTER TABLE stemobservation
4825
    ADD CONSTRAINT stemobservation_plantobservation_id_fkey FOREIGN KEY (plantobservation_id) REFERENCES plantobservation(plantobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
4826

    
4827

    
4828
--
4829
-- Name: stratum_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4830
--
4831

    
4832
ALTER TABLE stratum
4833
    ADD CONSTRAINT stratum_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4834

    
4835

    
4836
--
4837
-- Name: stratum_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4838
--
4839

    
4840

    
4841

    
4842

    
4843
--
4844
-- Name: taxonalt_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4845
--
4846

    
4847
ALTER TABLE taxonalt
4848
    ADD CONSTRAINT taxonalt_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4849

    
4850

    
4851
--
4852
-- Name: taxonalt_taxondetermination_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4853
--
4854

    
4855
ALTER TABLE taxonalt
4856
    ADD CONSTRAINT taxonalt_taxondetermination_id_fkey FOREIGN KEY (taxondetermination_id) REFERENCES taxondetermination(taxondetermination_id) ON UPDATE CASCADE ON DELETE CASCADE;
4857

    
4858

    
4859
--
4860
-- Name: taxonconcept_accepted_concept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4861
--
4862

    
4863
ALTER TABLE taxonconcept
4864
    ADD CONSTRAINT taxonconcept_accepted_concept_id_fkey FOREIGN KEY (accepted_concept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4865

    
4866

    
4867
--
4868
-- Name: taxonconcept_ancestor_ancestor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4869
--
4870

    
4871
ALTER TABLE taxonconcept_ancestor
4872
    ADD CONSTRAINT taxonconcept_ancestor_ancestor_id_fkey FOREIGN KEY (ancestor_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4873

    
4874

    
4875
--
4876
-- Name: taxonconcept_ancestor_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4877
--
4878

    
4879
ALTER TABLE taxonconcept_ancestor
4880
    ADD CONSTRAINT taxonconcept_ancestor_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4881

    
4882

    
4883
--
4884
-- Name: taxonconcept_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4885
--
4886

    
4887

    
4888

    
4889

    
4890
--
4891
-- Name: taxonconcept_matched_concept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4892
--
4893

    
4894
ALTER TABLE taxonconcept
4895
    ADD CONSTRAINT taxonconcept_matched_concept_id_fkey FOREIGN KEY (matched_concept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4896

    
4897

    
4898
--
4899
-- Name: taxonconcept_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4900
--
4901

    
4902
ALTER TABLE taxonconcept
4903
    ADD CONSTRAINT taxonconcept_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4904

    
4905

    
4906
--
4907
-- Name: taxoncorrelation_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4908
--
4909

    
4910

    
4911

    
4912

    
4913
--
4914
-- Name: taxoncorrelation_taxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4915
--
4916

    
4917
ALTER TABLE taxoncorrelation
4918
    ADD CONSTRAINT taxoncorrelation_taxonstatus_id_fkey FOREIGN KEY (taxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4919

    
4920

    
4921
--
4922
-- Name: taxondetermination_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4923
--
4924

    
4925

    
4926

    
4927

    
4928
--
4929
-- Name: taxondetermination_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4930
--
4931

    
4932

    
4933

    
4934

    
4935
--
4936
-- Name: taxondetermination_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4937
--
4938

    
4939
ALTER TABLE taxondetermination
4940
    ADD CONSTRAINT taxondetermination_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
4941

    
4942

    
4943
--
4944
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4945
--
4946

    
4947
ALTER TABLE taxondetermination
4948
    ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
4949

    
4950

    
4951
--
4952
-- Name: taxonlineage_childtaxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4953
--
4954

    
4955
ALTER TABLE taxonlineage
4956
    ADD CONSTRAINT taxonlineage_childtaxonstatus_id_fkey FOREIGN KEY (childtaxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4957

    
4958

    
4959
--
4960
-- Name: taxonlineage_parenttaxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4961
--
4962

    
4963
ALTER TABLE taxonlineage
4964
    ADD CONSTRAINT taxonlineage_parenttaxonstatus_id_fkey FOREIGN KEY (parenttaxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
4965

    
4966

    
4967
--
4968
-- Name: taxonoccurrence_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4969
--
4970

    
4971

    
4972

    
4973

    
4974
--
4975
-- Name: taxonoccurrence_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4976
--
4977

    
4978
ALTER TABLE taxonoccurrence
4979
    ADD CONSTRAINT taxonoccurrence_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
4980

    
4981

    
4982
--
4983
-- Name: taxonstatus_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4984
--
4985

    
4986

    
4987

    
4988

    
4989
--
4990
-- Name: taxonstatus_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4991
--
4992

    
4993

    
4994

    
4995

    
4996
--
4997
-- Name: taxonstatus_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4998
--
4999

    
5000
ALTER TABLE taxonstatus
5001
    ADD CONSTRAINT taxonstatus_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
5002

    
5003

    
5004
--
5005
-- Name: taxonusage_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5006
--
5007

    
5008

    
5009

    
5010

    
5011
--
5012
-- Name: taxonusage_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5013
--
5014

    
5015

    
5016

    
5017

    
5018
--
5019
-- Name: taxonusage_taxonstatus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5020
--
5021

    
5022
ALTER TABLE taxonusage
5023
    ADD CONSTRAINT taxonusage_taxonstatus_id_fkey FOREIGN KEY (taxonstatus_id) REFERENCES taxonstatus(taxonstatus_id) ON UPDATE CASCADE ON DELETE CASCADE;
5024

    
5025

    
5026
--
5027
-- Name: telephone_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5028
--
5029

    
5030
ALTER TABLE telephone
5031
    ADD CONSTRAINT telephone_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5032

    
5033

    
5034
--
5035
-- Name: trait_stemobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5036
--
5037

    
5038
ALTER TABLE trait
5039
    ADD CONSTRAINT trait_stemobservation_id_fkey FOREIGN KEY (stemobservation_id) REFERENCES stemobservation(stemobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
5040

    
5041

    
5042
--
5043
-- Name: voucher_specimenreplicate_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5044
--
5045

    
5046
ALTER TABLE voucher
5047
    ADD CONSTRAINT voucher_specimenreplicate_id_fkey FOREIGN KEY (specimenreplicate_id) REFERENCES specimenreplicate(specimenreplicate_id) ON UPDATE CASCADE ON DELETE CASCADE;
5048

    
5049

    
5050
--
5051
-- Name: voucher_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5052
--
5053

    
5054
ALTER TABLE voucher
5055
    ADD CONSTRAINT voucher_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
5056

    
5057

    
5058
--
5059
-- PostgreSQL database dump complete
5060
--
5061

    
(19-19/20)