1
|
-- -------------------CREATE TABLES ----------------------------
|
2
|
|
3
|
CREATE TABLE commConcept
|
4
|
(
|
5
|
COMMCONCEPT_ID int(11) NOT NULL AUTO_INCREMENT ,
|
6
|
COMMNAME_ID int(11) NOT NULL ,
|
7
|
reference_ID int(11) ,
|
8
|
commDescription text ,
|
9
|
accessionCode varchar (100) ,
|
10
|
|
11
|
PRIMARY KEY ( COMMCONCEPT_ID )
|
12
|
);
|
13
|
|
14
|
CREATE TABLE commCorrelation
|
15
|
(
|
16
|
COMMCORRELATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
17
|
COMMSTATUS_ID int(11) NOT NULL ,
|
18
|
COMMCONCEPT_ID int(11) NOT NULL ,
|
19
|
commConvergence varchar (20) NOT NULL ,
|
20
|
correlationStart Date NOT NULL ,
|
21
|
correlationStop Date ,
|
22
|
|
23
|
PRIMARY KEY ( COMMCORRELATION_ID )
|
24
|
);
|
25
|
|
26
|
CREATE TABLE commLineage
|
27
|
(
|
28
|
COMMLINEAGE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
29
|
parentCommStatus_ID int(11) NOT NULL ,
|
30
|
childCommStatus_ID int(11) NOT NULL ,
|
31
|
|
32
|
PRIMARY KEY ( COMMLINEAGE_ID )
|
33
|
);
|
34
|
|
35
|
CREATE TABLE commName
|
36
|
(
|
37
|
COMMNAME_ID int(11) NOT NULL AUTO_INCREMENT ,
|
38
|
commName text NOT NULL ,
|
39
|
reference_ID int(11) ,
|
40
|
dateEntered Date ,
|
41
|
|
42
|
PRIMARY KEY ( COMMNAME_ID )
|
43
|
);
|
44
|
|
45
|
CREATE TABLE commStatus
|
46
|
(
|
47
|
COMMSTATUS_ID int(11) NOT NULL AUTO_INCREMENT ,
|
48
|
COMMCONCEPT_ID int(11) NOT NULL ,
|
49
|
reference_ID int(11) ,
|
50
|
commConceptStatus varchar (20) NOT NULL ,
|
51
|
commParent_ID int(11) ,
|
52
|
commLevel varchar (80) ,
|
53
|
startDate Date NOT NULL ,
|
54
|
stopDate Date ,
|
55
|
commPartyComments text ,
|
56
|
PARTY_ID int(11) NOT NULL ,
|
57
|
|
58
|
PRIMARY KEY ( COMMSTATUS_ID )
|
59
|
);
|
60
|
|
61
|
CREATE TABLE commUsage
|
62
|
(
|
63
|
COMMUSAGE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
64
|
COMMNAME_ID int(11) NOT NULL ,
|
65
|
commName text ,
|
66
|
COMMCONCEPT_ID int(11) NOT NULL ,
|
67
|
usageStart Date ,
|
68
|
usageStop Date ,
|
69
|
commNameStatus varchar (20) ,
|
70
|
classSystem varchar (50) ,
|
71
|
PARTY_ID int(11) NOT NULL ,
|
72
|
COMMSTATUS_ID int(11) ,
|
73
|
|
74
|
PRIMARY KEY ( COMMUSAGE_ID )
|
75
|
);
|
76
|
|
77
|
CREATE TABLE plantConcept
|
78
|
(
|
79
|
PLANTCONCEPT_ID int(11) NOT NULL AUTO_INCREMENT ,
|
80
|
PLANTNAME_ID int(11) NOT NULL ,
|
81
|
reference_ID int(11) NOT NULL ,
|
82
|
plantname varchar (200) ,
|
83
|
plantCode varchar (23) ,
|
84
|
plantDescription text ,
|
85
|
accessionCode varchar (100) ,
|
86
|
|
87
|
PRIMARY KEY ( PLANTCONCEPT_ID )
|
88
|
);
|
89
|
|
90
|
CREATE TABLE plantCorrelation
|
91
|
(
|
92
|
PLANTCORRELATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
93
|
PLANTSTATUS_ID int(11) NOT NULL ,
|
94
|
PLANTCONCEPT_ID int(11) NOT NULL ,
|
95
|
plantConvergence varchar (20) NOT NULL ,
|
96
|
correlationStart Date NOT NULL ,
|
97
|
correlationStop Date ,
|
98
|
|
99
|
PRIMARY KEY ( PLANTCORRELATION_ID )
|
100
|
);
|
101
|
|
102
|
CREATE TABLE plantLineage
|
103
|
(
|
104
|
PLANTLINEAGE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
105
|
childPlantStatus_ID int(11) NOT NULL ,
|
106
|
parentPlantStatus_ID int(11) NOT NULL ,
|
107
|
|
108
|
PRIMARY KEY ( PLANTLINEAGE_ID )
|
109
|
);
|
110
|
|
111
|
CREATE TABLE plantName
|
112
|
(
|
113
|
PLANTNAME_ID int(11) NOT NULL AUTO_INCREMENT ,
|
114
|
plantName varchar (255) NOT NULL ,
|
115
|
reference_ID int(11) ,
|
116
|
dateEntered Date ,
|
117
|
|
118
|
PRIMARY KEY ( PLANTNAME_ID )
|
119
|
);
|
120
|
|
121
|
CREATE TABLE plantStatus
|
122
|
(
|
123
|
PLANTSTATUS_ID int(11) NOT NULL AUTO_INCREMENT ,
|
124
|
PLANTCONCEPT_ID int(11) NOT NULL ,
|
125
|
reference_ID int(11) ,
|
126
|
plantConceptStatus varchar (20) NOT NULL ,
|
127
|
startDate Date NOT NULL ,
|
128
|
stopDate Date ,
|
129
|
plantPartyComments text ,
|
130
|
plantParentName varchar (200) ,
|
131
|
plantParentConcept_id int(11) ,
|
132
|
plantParent_ID int(11) ,
|
133
|
plantLevel varchar (80) ,
|
134
|
PARTY_ID int(11) NOT NULL ,
|
135
|
|
136
|
PRIMARY KEY ( PLANTSTATUS_ID )
|
137
|
);
|
138
|
|
139
|
CREATE TABLE plantUsage
|
140
|
(
|
141
|
PLANTUSAGE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
142
|
PLANTNAME_ID int(11) NOT NULL ,
|
143
|
PLANTCONCEPT_ID int(11) NOT NULL ,
|
144
|
usageStart Date ,
|
145
|
usageStop Date ,
|
146
|
plantNameStatus varchar (20) ,
|
147
|
plantName varchar (220) ,
|
148
|
classSystem varchar (50) ,
|
149
|
acceptedSynonym varchar (220) ,
|
150
|
PARTY_ID int(11) NOT NULL ,
|
151
|
PLANTSTATUS_ID int(11) ,
|
152
|
|
153
|
PRIMARY KEY ( PLANTUSAGE_ID )
|
154
|
);
|
155
|
|
156
|
CREATE TABLE address
|
157
|
(
|
158
|
ADDRESS_ID int(11) NOT NULL AUTO_INCREMENT ,
|
159
|
party_ID int(11) NOT NULL ,
|
160
|
organization_ID int(11) ,
|
161
|
orgPosition varchar (50) ,
|
162
|
email varchar (100) ,
|
163
|
deliveryPoint varchar (200) ,
|
164
|
city varchar (50) ,
|
165
|
administrativeArea varchar (50) ,
|
166
|
postalCode varchar (10) ,
|
167
|
country varchar (50) ,
|
168
|
currentFlag int(1) ,
|
169
|
addressStartDate Date ,
|
170
|
|
171
|
PRIMARY KEY ( ADDRESS_ID )
|
172
|
);
|
173
|
|
174
|
CREATE TABLE aux_Role
|
175
|
(
|
176
|
ROLE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
177
|
roleCode varchar (30) NOT NULL ,
|
178
|
roleDescription varchar (200) ,
|
179
|
roleProject int(11) ,
|
180
|
roleObservation int(11) ,
|
181
|
roleTaxonInt int(11) ,
|
182
|
roleClassInt int(11) ,
|
183
|
|
184
|
PRIMARY KEY ( ROLE_ID )
|
185
|
);
|
186
|
|
187
|
CREATE TABLE reference
|
188
|
(
|
189
|
reference_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
190
|
shortName varchar (250) ,
|
191
|
fulltext text ,
|
192
|
referenceType varchar (250) ,
|
193
|
title varchar (250) ,
|
194
|
titleSuperior varchar (250) ,
|
195
|
pubDate Date ,
|
196
|
accessDate Date ,
|
197
|
conferenceDate Date ,
|
198
|
referenceJournal_ID int(11) ,
|
199
|
volume varchar (250) ,
|
200
|
issue varchar (250) ,
|
201
|
pageRange varchar (250) ,
|
202
|
totalPages int(11) ,
|
203
|
publisher varchar (250) ,
|
204
|
publicationPlace varchar (250) ,
|
205
|
isbn varchar (250) ,
|
206
|
edition varchar (250) ,
|
207
|
numberOfVolumes int(11) ,
|
208
|
chapterNumber int(11) ,
|
209
|
reportNumber int(11) ,
|
210
|
communicationType varchar (250) ,
|
211
|
degree varchar (250) ,
|
212
|
url text ,
|
213
|
doi text ,
|
214
|
additionalInfo text ,
|
215
|
accessionCode varchar (100) ,
|
216
|
|
217
|
PRIMARY KEY ( reference_ID )
|
218
|
);
|
219
|
|
220
|
CREATE TABLE referenceAltIdent
|
221
|
(
|
222
|
referenceAltIdent_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
223
|
reference_ID int(11) NOT NULL ,
|
224
|
system varchar (250) ,
|
225
|
identifier varchar (250) NOT NULL ,
|
226
|
|
227
|
PRIMARY KEY ( referenceAltIdent_ID )
|
228
|
);
|
229
|
|
230
|
CREATE TABLE referenceContributor
|
231
|
(
|
232
|
referenceContributor_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
233
|
reference_ID int(11) NOT NULL ,
|
234
|
referenceParty_ID int(11) NOT NULL ,
|
235
|
roleType varchar (250) ,
|
236
|
position int(11) ,
|
237
|
|
238
|
PRIMARY KEY ( referenceContributor_ID )
|
239
|
);
|
240
|
|
241
|
CREATE TABLE referenceParty
|
242
|
(
|
243
|
referenceParty_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
244
|
type varchar (250) ,
|
245
|
positionName varchar (250) ,
|
246
|
salutation varchar (250) ,
|
247
|
givenName varchar (250) ,
|
248
|
surname varchar (250) ,
|
249
|
suffix varchar (250) ,
|
250
|
organizationName varchar (250) ,
|
251
|
currentParty_ID int(11) ,
|
252
|
accessionCode varchar (100) ,
|
253
|
|
254
|
PRIMARY KEY ( referenceParty_ID )
|
255
|
);
|
256
|
|
257
|
CREATE TABLE referenceJournal
|
258
|
(
|
259
|
referenceJournal_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
260
|
journal varchar (250) NOT NULL ,
|
261
|
issn varchar (250) ,
|
262
|
abbreviation varchar (250) ,
|
263
|
accessionCode varchar (100) ,
|
264
|
|
265
|
PRIMARY KEY ( referenceJournal_ID )
|
266
|
);
|
267
|
|
268
|
CREATE TABLE classContributor
|
269
|
(
|
270
|
CLASSCONTRIBUTOR_ID int(11) NOT NULL AUTO_INCREMENT ,
|
271
|
COMMCLASS_ID int(11) NOT NULL ,
|
272
|
PARTY_ID int(11) NOT NULL ,
|
273
|
ROLE_ID int(11) ,
|
274
|
|
275
|
PRIMARY KEY ( CLASSCONTRIBUTOR_ID )
|
276
|
);
|
277
|
|
278
|
CREATE TABLE commClass
|
279
|
(
|
280
|
COMMCLASS_ID int(11) NOT NULL AUTO_INCREMENT ,
|
281
|
OBSERVATION_ID int(11) NOT NULL ,
|
282
|
classStartDate Date ,
|
283
|
classStopDate Date ,
|
284
|
inspection int(1) ,
|
285
|
tableAnalysis int(1) ,
|
286
|
multivariateAnalysis int(1) ,
|
287
|
expertSystem int(1) ,
|
288
|
classPublication_ID int(11) ,
|
289
|
classNotes text ,
|
290
|
commName varchar (200) ,
|
291
|
commCode varchar (200) ,
|
292
|
commFramework varchar (200) ,
|
293
|
commLevel varchar (200) ,
|
294
|
accessionCode varchar (100) ,
|
295
|
|
296
|
PRIMARY KEY ( COMMCLASS_ID )
|
297
|
);
|
298
|
|
299
|
CREATE TABLE commInterpretation
|
300
|
(
|
301
|
COMMINTERPRETATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
302
|
COMMCLASS_ID int(11) NOT NULL ,
|
303
|
COMMCONCEPT_ID int(11) ,
|
304
|
commcode varchar (34) ,
|
305
|
commname varchar (200) ,
|
306
|
classFit varchar (50) ,
|
307
|
classConfidence varchar (15) ,
|
308
|
commAuthority_ID int(11) ,
|
309
|
notes text ,
|
310
|
type int(1) ,
|
311
|
nomenclaturalType int(1) ,
|
312
|
|
313
|
PRIMARY KEY ( COMMINTERPRETATION_ID )
|
314
|
);
|
315
|
|
316
|
CREATE TABLE coverIndex
|
317
|
(
|
318
|
COVERINDEX_ID int(11) NOT NULL AUTO_INCREMENT ,
|
319
|
COVERMETHOD_ID int(11) NOT NULL ,
|
320
|
coverCode varchar (10) NOT NULL ,
|
321
|
upperLimit Float ,
|
322
|
lowerLimit Float ,
|
323
|
coverPercent Float NOT NULL ,
|
324
|
indexDescription text ,
|
325
|
|
326
|
PRIMARY KEY ( COVERINDEX_ID )
|
327
|
);
|
328
|
|
329
|
CREATE TABLE coverMethod
|
330
|
(
|
331
|
COVERMETHOD_ID int(11) NOT NULL AUTO_INCREMENT ,
|
332
|
reference_ID int(11) ,
|
333
|
coverType varchar (30) NOT NULL ,
|
334
|
accessionCode varchar (100) ,
|
335
|
|
336
|
PRIMARY KEY ( COVERMETHOD_ID )
|
337
|
);
|
338
|
|
339
|
CREATE TABLE definedValue
|
340
|
(
|
341
|
DEFINEDVALUE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
342
|
USERDEFINED_ID int(11) NOT NULL ,
|
343
|
tableRecord_ID int(11) NOT NULL ,
|
344
|
definedValue text NOT NULL ,
|
345
|
|
346
|
PRIMARY KEY ( DEFINEDVALUE_ID )
|
347
|
);
|
348
|
|
349
|
CREATE TABLE disturbanceObs
|
350
|
(
|
351
|
disturbanceObs_ID int(11) NOT NULL AUTO_INCREMENT ,
|
352
|
OBSERVATION_ID int(11) NOT NULL ,
|
353
|
disturbanceType varchar (30) NOT NULL ,
|
354
|
disturbanceIntensity varchar (30) ,
|
355
|
disturbanceAge Float ,
|
356
|
disturbanceExtent Float ,
|
357
|
disturbanceComment text ,
|
358
|
|
359
|
PRIMARY KEY ( disturbanceObs_ID )
|
360
|
);
|
361
|
|
362
|
CREATE TABLE graphic
|
363
|
(
|
364
|
GRAPHIC_ID int(11) NOT NULL AUTO_INCREMENT ,
|
365
|
OBSERVATION_ID int(11) NOT NULL ,
|
366
|
graphicName varchar (30) ,
|
367
|
graphicLocation text ,
|
368
|
graphicDescription text ,
|
369
|
graphicType varchar (20) ,
|
370
|
graphicDate Date ,
|
371
|
graphicData oid ,
|
372
|
|
373
|
PRIMARY KEY ( GRAPHIC_ID )
|
374
|
);
|
375
|
|
376
|
CREATE TABLE namedPlace
|
377
|
(
|
378
|
NAMEDPLACE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
379
|
placeSystem varchar (50) ,
|
380
|
placeName varchar (100) NOT NULL ,
|
381
|
placeDescription text ,
|
382
|
placeCode varchar (15) ,
|
383
|
owner varchar (100) ,
|
384
|
reference_ID int(11) ,
|
385
|
accessionCode varchar (100) ,
|
386
|
|
387
|
PRIMARY KEY ( NAMEDPLACE_ID )
|
388
|
);
|
389
|
|
390
|
CREATE TABLE note
|
391
|
(
|
392
|
NOTE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
393
|
NOTELINK_ID int(11) NOT NULL ,
|
394
|
PARTY_ID int(11) NOT NULL ,
|
395
|
ROLE_ID int(11) NOT NULL ,
|
396
|
noteDate Date ,
|
397
|
noteType varchar (20) NOT NULL ,
|
398
|
noteText text NOT NULL ,
|
399
|
|
400
|
PRIMARY KEY ( NOTE_ID )
|
401
|
);
|
402
|
|
403
|
CREATE TABLE noteLink
|
404
|
(
|
405
|
NOTELINK_ID int(11) NOT NULL AUTO_INCREMENT ,
|
406
|
tableName varchar (50) NOT NULL ,
|
407
|
attributeName varchar (50) ,
|
408
|
tableRecord int(11) NOT NULL ,
|
409
|
|
410
|
PRIMARY KEY ( NOTELINK_ID )
|
411
|
);
|
412
|
|
413
|
CREATE TABLE observation
|
414
|
(
|
415
|
OBSERVATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
416
|
PREVIOUSOBS_ID int(11) ,
|
417
|
PLOT_ID int(11) NOT NULL ,
|
418
|
PROJECT_ID int(11) ,
|
419
|
dateEntered Date ,
|
420
|
authorObsCode varchar (30) ,
|
421
|
obsStartDate Date ,
|
422
|
obsEndDate Date ,
|
423
|
dateAccuracy varchar (30) ,
|
424
|
COVERMETHOD_ID int(11) ,
|
425
|
STRATUMMETHOD_ID int(11) ,
|
426
|
stemSizeLimit Float ,
|
427
|
methodNarrative text ,
|
428
|
taxonObservationArea Float ,
|
429
|
coverDispersion varchar (30) ,
|
430
|
autoTaxonCover int(1) ,
|
431
|
stemObservationArea Float ,
|
432
|
stemSampleMethod varchar (30) ,
|
433
|
originalData text ,
|
434
|
effortLevel varchar (30) ,
|
435
|
plotValidationLevel int(11) ,
|
436
|
floristicQuality varchar (30) ,
|
437
|
bryophyteQuality varchar (30) ,
|
438
|
lichenQuality varchar (30) ,
|
439
|
observationNarrative text ,
|
440
|
landscapeNarrative text ,
|
441
|
homogeneity varchar (50) ,
|
442
|
phenologicAspect varchar (30) ,
|
443
|
representativeness varchar (255) ,
|
444
|
basalArea Float ,
|
445
|
hydrologicRegime varchar (30) ,
|
446
|
soilMoistureRegime varchar (30) ,
|
447
|
soilDrainage varchar (30) ,
|
448
|
waterSalinity varchar (30) ,
|
449
|
waterDepth Float ,
|
450
|
shoreDistance Float ,
|
451
|
soilDepth Float ,
|
452
|
organicDepth Float ,
|
453
|
percentBedRock Float ,
|
454
|
percentRockGravel Float ,
|
455
|
percentWood Float ,
|
456
|
percentLitter Float ,
|
457
|
percentBareSoil Float ,
|
458
|
percentWater Float ,
|
459
|
percentOther Float ,
|
460
|
nameOther varchar (30) ,
|
461
|
standMaturity varchar (50) ,
|
462
|
successionalStatus text ,
|
463
|
treeHt Float ,
|
464
|
shrubHt Float ,
|
465
|
fieldHt Float ,
|
466
|
nonvascularHt Float ,
|
467
|
submergedHt Float ,
|
468
|
treeCover Float ,
|
469
|
shrubCover Float ,
|
470
|
fieldCover Float ,
|
471
|
nonvascularCover Float ,
|
472
|
floatingCover Float ,
|
473
|
submergedCover Float ,
|
474
|
dominantStratum varchar (40) ,
|
475
|
growthform1Type varchar (40) ,
|
476
|
growthform2Type varchar (40) ,
|
477
|
growthform3Type varchar (40) ,
|
478
|
growthform1Cover Float ,
|
479
|
growthform2Cover Float ,
|
480
|
growthform3Cover Float ,
|
481
|
SOILTAXON_ID int(11) ,
|
482
|
soilTaxonSrc varchar (200) ,
|
483
|
coverEstimationMethod varchar (80) ,
|
484
|
stratumIndividualDivision varchar (50) ,
|
485
|
totalCover Float ,
|
486
|
accessionCode varchar (100) ,
|
487
|
notesPublic int(1) ,
|
488
|
notesMgt int(1) ,
|
489
|
revisions int(1) ,
|
490
|
|
491
|
PRIMARY KEY ( OBSERVATION_ID )
|
492
|
);
|
493
|
|
494
|
CREATE TABLE observationContributor
|
495
|
(
|
496
|
OBSERVATIONCONTRIBUTOR_ID int(11) NOT NULL AUTO_INCREMENT ,
|
497
|
OBSERVATION_ID int(11) NOT NULL ,
|
498
|
PARTY_ID int(11) NOT NULL ,
|
499
|
ROLE_ID int(11) NOT NULL ,
|
500
|
contributionDate Date ,
|
501
|
|
502
|
PRIMARY KEY ( OBSERVATIONCONTRIBUTOR_ID )
|
503
|
);
|
504
|
|
505
|
CREATE TABLE observationSynonym
|
506
|
(
|
507
|
OBSERVATIONSYNONYM_ID int(11) NOT NULL AUTO_INCREMENT ,
|
508
|
synonymObservation_ID int(11) NOT NULL ,
|
509
|
primaryObservation_ID int(11) NOT NULL ,
|
510
|
PARTY_ID int(11) NOT NULL ,
|
511
|
ROLE_ID int(11) NOT NULL ,
|
512
|
classStartDate Date NOT NULL ,
|
513
|
classStopDate Date ,
|
514
|
synonymComment text ,
|
515
|
|
516
|
PRIMARY KEY ( OBSERVATIONSYNONYM_ID )
|
517
|
);
|
518
|
|
519
|
CREATE TABLE party
|
520
|
(
|
521
|
PARTY_ID int(11) NOT NULL AUTO_INCREMENT ,
|
522
|
salutation varchar (20) ,
|
523
|
givenName varchar (50) ,
|
524
|
middleName varchar (50) ,
|
525
|
surName varchar (50) ,
|
526
|
organizationName varchar (100) ,
|
527
|
currentName_ID int(11) ,
|
528
|
contactInstructions text ,
|
529
|
email varchar (120) ,
|
530
|
accessionCode varchar (100) ,
|
531
|
partyType varchar (40) ,
|
532
|
|
533
|
PRIMARY KEY ( PARTY_ID )
|
534
|
);
|
535
|
|
536
|
CREATE TABLE partyMember
|
537
|
(
|
538
|
partyMember_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
539
|
parentParty_ID int(11) NOT NULL ,
|
540
|
childParty_ID int(11) NOT NULL ,
|
541
|
role_ID int(11) ,
|
542
|
memberStart Date NOT NULL ,
|
543
|
memberStop Date ,
|
544
|
|
545
|
PRIMARY KEY ( partyMember_ID )
|
546
|
);
|
547
|
|
548
|
CREATE TABLE place
|
549
|
(
|
550
|
PLOTPLACE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
551
|
PLOT_ID int(11) NOT NULL ,
|
552
|
calculated int(1) ,
|
553
|
NAMEDPLACE_ID int(11) NOT NULL ,
|
554
|
|
555
|
PRIMARY KEY ( PLOTPLACE_ID )
|
556
|
);
|
557
|
|
558
|
CREATE TABLE plot
|
559
|
(
|
560
|
PLOT_ID int(11) NOT NULL AUTO_INCREMENT ,
|
561
|
authorPlotCode varchar (30) NOT NULL ,
|
562
|
reference_ID int(11) ,
|
563
|
PARENT_ID int(11) ,
|
564
|
realLatitude Float ,
|
565
|
realLongitude Float ,
|
566
|
locationAccuracy Float ,
|
567
|
confidentialityStatus int(11) NOT NULL ,
|
568
|
confidentialityReason varchar (200) ,
|
569
|
latitude Float ,
|
570
|
longitude Float ,
|
571
|
authorE varchar (20) ,
|
572
|
authorN varchar (20) ,
|
573
|
authorZone varchar (20) ,
|
574
|
authorDatum varchar (20) ,
|
575
|
authorLocation varchar (200) ,
|
576
|
locationNarrative text ,
|
577
|
azimuth Float ,
|
578
|
dsgpoly text ,
|
579
|
shape varchar (50) ,
|
580
|
area Float ,
|
581
|
standSize varchar (50) ,
|
582
|
placementMethod varchar (50) ,
|
583
|
permanence int(1) ,
|
584
|
layoutNarrative text ,
|
585
|
elevation Float ,
|
586
|
elevationAccuracy Float ,
|
587
|
elevationRange Float ,
|
588
|
slopeAspect Float ,
|
589
|
minSlopeAspect Float ,
|
590
|
maxSlopeAspect Float ,
|
591
|
slopeGradient Float ,
|
592
|
minSlopeGradient Float ,
|
593
|
maxSlopeGradient Float ,
|
594
|
topoPosition varchar (90) ,
|
595
|
landform varchar (50) ,
|
596
|
surficialDeposits varchar (90) ,
|
597
|
rockType varchar (90) ,
|
598
|
stateProvince varchar (55) ,
|
599
|
country varchar (100) ,
|
600
|
dateentered Date ,
|
601
|
submitter_surname varchar (100) ,
|
602
|
submitter_givenname varchar (100) ,
|
603
|
submitter_email varchar (100) ,
|
604
|
accessionCode varchar (100) ,
|
605
|
notesPublic int(1) ,
|
606
|
notesMgt int(1) ,
|
607
|
revisions int(1) ,
|
608
|
|
609
|
PRIMARY KEY ( PLOT_ID )
|
610
|
);
|
611
|
|
612
|
CREATE TABLE project
|
613
|
(
|
614
|
PROJECT_ID int(11) NOT NULL AUTO_INCREMENT ,
|
615
|
projectName varchar (150) NOT NULL ,
|
616
|
projectDescription text ,
|
617
|
startDate Date ,
|
618
|
stopDate Date ,
|
619
|
accessionCode varchar (100) ,
|
620
|
|
621
|
PRIMARY KEY ( PROJECT_ID )
|
622
|
);
|
623
|
|
624
|
CREATE TABLE projectContributor
|
625
|
(
|
626
|
PROJECTCONTRIBUTOR_ID int(11) NOT NULL AUTO_INCREMENT ,
|
627
|
PROJECT_ID int(11) NOT NULL ,
|
628
|
PARTY_ID int(11) NOT NULL ,
|
629
|
ROLE_ID int(11) ,
|
630
|
surname varchar (50) ,
|
631
|
cheatRole varchar (50) ,
|
632
|
|
633
|
PRIMARY KEY ( PROJECTCONTRIBUTOR_ID )
|
634
|
);
|
635
|
|
636
|
CREATE TABLE revision
|
637
|
(
|
638
|
REVISION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
639
|
tableName varchar (50) NOT NULL ,
|
640
|
tableAttribute varchar (50) NOT NULL ,
|
641
|
tableRecord int(11) NOT NULL ,
|
642
|
revisionDate Date NOT NULL ,
|
643
|
previousValueText text NOT NULL ,
|
644
|
previousValueType varchar (20) NOT NULL ,
|
645
|
previousRevision_ID int(11) ,
|
646
|
|
647
|
PRIMARY KEY ( REVISION_ID )
|
648
|
);
|
649
|
|
650
|
CREATE TABLE soilObs
|
651
|
(
|
652
|
SOILOBS_ID int(11) NOT NULL AUTO_INCREMENT ,
|
653
|
OBSERVATION_ID int(11) NOT NULL ,
|
654
|
soilHorizon varchar (15) NOT NULL ,
|
655
|
soilDepthTop Float ,
|
656
|
soilDepthBottom Float ,
|
657
|
soilColor varchar (30) ,
|
658
|
soilOrganic Float ,
|
659
|
soilTexture varchar (50) ,
|
660
|
soilSand Float ,
|
661
|
soilSilt Float ,
|
662
|
soilClay Float ,
|
663
|
soilCoarse Float ,
|
664
|
soilPH Float ,
|
665
|
exchangeCapacity Float ,
|
666
|
baseSaturation Float ,
|
667
|
soilDescription text ,
|
668
|
|
669
|
PRIMARY KEY ( SOILOBS_ID )
|
670
|
);
|
671
|
|
672
|
CREATE TABLE soilTaxon
|
673
|
(
|
674
|
SOILTAXON_ID int(11) NOT NULL AUTO_INCREMENT ,
|
675
|
soilCode varchar (15) ,
|
676
|
soilName varchar (100) ,
|
677
|
soilLevel int(11) ,
|
678
|
SOILPARENT_ID int(11) ,
|
679
|
soilFramework varchar (33) ,
|
680
|
accessionCode varchar (100) ,
|
681
|
|
682
|
PRIMARY KEY ( SOILTAXON_ID )
|
683
|
);
|
684
|
|
685
|
CREATE TABLE stemCount
|
686
|
(
|
687
|
STEMCOUNT_ID int(11) NOT NULL AUTO_INCREMENT ,
|
688
|
TAXONIMPORTANCE_ID int(11) NOT NULL ,
|
689
|
stemDiameter Float ,
|
690
|
stemDiameterAccuracy Float ,
|
691
|
stemHeight Float ,
|
692
|
stemHeightAccuracy Float ,
|
693
|
stemCount int(11) NOT NULL ,
|
694
|
stemTaxonArea Float ,
|
695
|
|
696
|
PRIMARY KEY ( STEMCOUNT_ID )
|
697
|
);
|
698
|
|
699
|
CREATE TABLE stemLocation
|
700
|
(
|
701
|
STEMLOCATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
702
|
STEMCOUNT_ID int(11) NOT NULL ,
|
703
|
stemCode varchar (20) ,
|
704
|
stemXPosition Float ,
|
705
|
stemYPosition Float ,
|
706
|
stemHealth varchar (50) ,
|
707
|
|
708
|
PRIMARY KEY ( STEMLOCATION_ID )
|
709
|
);
|
710
|
|
711
|
CREATE TABLE stratum
|
712
|
(
|
713
|
STRATUM_ID int(11) NOT NULL AUTO_INCREMENT ,
|
714
|
OBSERVATION_ID int(11) NOT NULL ,
|
715
|
STRATUMTYPE_ID int(11) NOT NULL ,
|
716
|
STRATUMMETHOD_ID int(11) ,
|
717
|
stratumName varchar (30) ,
|
718
|
stratumHeight Float ,
|
719
|
stratumBase Float ,
|
720
|
stratumCover Float ,
|
721
|
stratumDescription varchar (200) ,
|
722
|
|
723
|
PRIMARY KEY ( STRATUM_ID )
|
724
|
);
|
725
|
|
726
|
CREATE TABLE stratumMethod
|
727
|
(
|
728
|
STRATUMMETHOD_ID int(11) NOT NULL AUTO_INCREMENT ,
|
729
|
reference_ID int(11) ,
|
730
|
stratumMethodName varchar (30) NOT NULL ,
|
731
|
stratumMethodDescription text ,
|
732
|
accessionCode varchar (100) ,
|
733
|
|
734
|
PRIMARY KEY ( STRATUMMETHOD_ID )
|
735
|
);
|
736
|
|
737
|
CREATE TABLE stratumType
|
738
|
(
|
739
|
STRATUMTYPE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
740
|
STRATUMMETHOD_ID int(11) NOT NULL ,
|
741
|
stratumIndex varchar (10) ,
|
742
|
stratumName varchar (30) ,
|
743
|
stratumDescription text ,
|
744
|
|
745
|
PRIMARY KEY ( STRATUMTYPE_ID )
|
746
|
);
|
747
|
|
748
|
CREATE TABLE taxonImportance
|
749
|
(
|
750
|
taxonImportance_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
751
|
taxonObservation_ID int(11) NOT NULL ,
|
752
|
stratum_ID int(11) ,
|
753
|
cover Float ,
|
754
|
basalArea Float ,
|
755
|
biomass Float ,
|
756
|
inferenceArea Float ,
|
757
|
|
758
|
PRIMARY KEY ( taxonImportance_ID )
|
759
|
);
|
760
|
|
761
|
CREATE TABLE taxonInterpretation
|
762
|
(
|
763
|
TAXONINTERPRETATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
764
|
TAXONOBSERVATION_ID int(11) NOT NULL ,
|
765
|
stemLocation_ID int(11) ,
|
766
|
PLANTCONCEPT_ID int(11) NOT NULL ,
|
767
|
interpretationDate Date NOT NULL ,
|
768
|
PLANTNAME_ID int(11) ,
|
769
|
PARTY_ID int(11) NOT NULL ,
|
770
|
ROLE_ID int(11) NOT NULL ,
|
771
|
interpretationType varchar (30) ,
|
772
|
reference_ID int(11) ,
|
773
|
originalInterpretation int(1) NOT NULL ,
|
774
|
currentInterpretation int(1) NOT NULL ,
|
775
|
taxonFit varchar (50) ,
|
776
|
taxonConfidence varchar (50) ,
|
777
|
collector_ID int(11) ,
|
778
|
collectionNumber varchar (100) ,
|
779
|
collectionDate Date ,
|
780
|
museum_ID int(11) ,
|
781
|
museumAccessionNumber varchar (100) ,
|
782
|
groupType varchar (20) ,
|
783
|
notes text ,
|
784
|
notesPublic int(1) ,
|
785
|
notesMgt int(1) ,
|
786
|
revisions int(1) ,
|
787
|
|
788
|
PRIMARY KEY ( TAXONINTERPRETATION_ID )
|
789
|
);
|
790
|
|
791
|
CREATE TABLE taxonObservation
|
792
|
(
|
793
|
TAXONOBSERVATION_ID int(11) NOT NULL AUTO_INCREMENT ,
|
794
|
OBSERVATION_ID int(11) NOT NULL ,
|
795
|
authorPlantName varchar (255) ,
|
796
|
reference_ID int(11) ,
|
797
|
taxonInferenceArea Float ,
|
798
|
accessionCode varchar (100) ,
|
799
|
|
800
|
PRIMARY KEY ( TAXONOBSERVATION_ID )
|
801
|
);
|
802
|
|
803
|
CREATE TABLE taxonAlt
|
804
|
(
|
805
|
taxonAlt_ID int(11) NOT NULL AUTO_INCREMENT ,
|
806
|
taxonInterpretation_ID int(11) NOT NULL ,
|
807
|
plantConcept_ID int(11) NOT NULL ,
|
808
|
taxonAltFit varchar (50) ,
|
809
|
taxonAltConfidence varchar (50) ,
|
810
|
taxonAltNotes text ,
|
811
|
|
812
|
PRIMARY KEY ( taxonAlt_ID )
|
813
|
);
|
814
|
|
815
|
CREATE TABLE telephone
|
816
|
(
|
817
|
TELEPHONE_ID int(11) NOT NULL AUTO_INCREMENT ,
|
818
|
PARTY_ID int(11) NOT NULL ,
|
819
|
phoneNumber varchar (30) NOT NULL ,
|
820
|
phoneType varchar (20) NOT NULL ,
|
821
|
|
822
|
PRIMARY KEY ( TELEPHONE_ID )
|
823
|
);
|
824
|
|
825
|
CREATE TABLE userDefined
|
826
|
(
|
827
|
USERDEFINED_ID int(11) NOT NULL AUTO_INCREMENT ,
|
828
|
userDefinedName varchar (50) ,
|
829
|
userDefinedMetadata text ,
|
830
|
userDefinedCategory varchar (30) ,
|
831
|
userDefinedType varchar (20) NOT NULL ,
|
832
|
tableName varchar (50) NOT NULL ,
|
833
|
accessionCode varchar (100) ,
|
834
|
|
835
|
PRIMARY KEY ( USERDEFINED_ID )
|
836
|
);
|
837
|
|
838
|
CREATE TABLE embargo
|
839
|
(
|
840
|
embargo_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
841
|
plot_ID int(11) NOT NULL ,
|
842
|
embargoReason text NOT NULL ,
|
843
|
embargoStart Date NOT NULL ,
|
844
|
embargoStop Date NOT NULL ,
|
845
|
defaultStatus int(11) NOT NULL ,
|
846
|
|
847
|
PRIMARY KEY ( embargo_ID )
|
848
|
);
|
849
|
|
850
|
CREATE TABLE usr
|
851
|
(
|
852
|
usr_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
853
|
party_ID int(11) NOT NULL ,
|
854
|
password varchar (50) NOT NULL ,
|
855
|
permission_type int(11) NOT NULL ,
|
856
|
begin_time Date ,
|
857
|
last_connect Date ,
|
858
|
ticket_count int(11) ,
|
859
|
email_address varchar (100) NOT NULL ,
|
860
|
preferred_name varchar (100) ,
|
861
|
remote_address varchar (100) ,
|
862
|
|
863
|
PRIMARY KEY ( usr_ID )
|
864
|
);
|
865
|
|
866
|
CREATE TABLE userCertification
|
867
|
(
|
868
|
userCertification_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
869
|
usr_ID int(11) NOT NULL ,
|
870
|
current_cert_level int(11) NOT NULL ,
|
871
|
requested_cert_level int(11) NOT NULL ,
|
872
|
highest_degree varchar (50) ,
|
873
|
degree_year varchar (50) ,
|
874
|
degree_institution varchar (50) ,
|
875
|
current_institution varchar (50) ,
|
876
|
current_position varchar (200) ,
|
877
|
esa_certified int(1) ,
|
878
|
prof_experience_doc text ,
|
879
|
relevant_pubs text ,
|
880
|
veg_sampling_doc text ,
|
881
|
veg_analysis_doc text ,
|
882
|
usnvc_experience_doc text ,
|
883
|
vegbank_experience_doc text ,
|
884
|
vegbank_expected_uses text ,
|
885
|
plotdb_experience_doc text ,
|
886
|
esa_sponsor_name_a varchar (120) ,
|
887
|
esa_sponsor_email_a varchar (120) ,
|
888
|
esa_sponsor_name_b varchar (120) ,
|
889
|
esa_sponsor_email_b varchar (120) ,
|
890
|
peer_review int(1) ,
|
891
|
additional_statements text ,
|
892
|
certificationStatus varchar (30) ,
|
893
|
certificationStatusComments text ,
|
894
|
|
895
|
PRIMARY KEY ( userCertification_ID )
|
896
|
);
|
897
|
|
898
|
CREATE TABLE userRegionalExp
|
899
|
(
|
900
|
userRegionalExp_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
901
|
userCertification_ID int(11) NOT NULL ,
|
902
|
region varchar (50) NOT NULL ,
|
903
|
vegetation varchar (50) ,
|
904
|
floristics varchar (50) ,
|
905
|
nvc_ivc varchar (50) ,
|
906
|
|
907
|
PRIMARY KEY ( userRegionalExp_ID )
|
908
|
);
|
909
|
|
910
|
CREATE TABLE userDataset
|
911
|
(
|
912
|
userDataset_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
913
|
usr_ID int(11) NOT NULL ,
|
914
|
datasetStart Date ,
|
915
|
datasetStop Date ,
|
916
|
accessionCode varchar (100) ,
|
917
|
datasetName varchar (100) NOT NULL ,
|
918
|
datasetDescription text ,
|
919
|
datasetType varchar (50) ,
|
920
|
datasetSharing varchar (30) ,
|
921
|
datasetPassword varchar (50) ,
|
922
|
|
923
|
PRIMARY KEY ( userDataset_ID )
|
924
|
);
|
925
|
|
926
|
CREATE TABLE userDatasetItem
|
927
|
(
|
928
|
userDatasetItem_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
929
|
userDataset_ID int(11) NOT NULL ,
|
930
|
itemAccessionCode varchar (100) NOT NULL ,
|
931
|
itemType varchar (50) ,
|
932
|
itemStart Date NOT NULL ,
|
933
|
itemStop Date ,
|
934
|
notes text ,
|
935
|
|
936
|
PRIMARY KEY ( userDatasetItem_ID )
|
937
|
);
|
938
|
|
939
|
CREATE TABLE userNotify
|
940
|
(
|
941
|
userNotify_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
942
|
usr_ID int(11) NOT NULL ,
|
943
|
notifyName varchar (100) ,
|
944
|
notifyDescription text ,
|
945
|
notifyStart Date ,
|
946
|
notifyStop Date ,
|
947
|
lastCheckDate Date ,
|
948
|
notifySQL text ,
|
949
|
|
950
|
PRIMARY KEY ( userNotify_ID )
|
951
|
);
|
952
|
|
953
|
CREATE TABLE userPermission
|
954
|
(
|
955
|
userPermission_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
956
|
embargo_ID int(11) NOT NULL ,
|
957
|
usr_ID int(11) NOT NULL ,
|
958
|
permissionStart Date NOT NULL ,
|
959
|
permissionStop Date ,
|
960
|
permissionStatus int(11) NOT NULL ,
|
961
|
permissionNotes text ,
|
962
|
|
963
|
PRIMARY KEY ( userPermission_ID )
|
964
|
);
|
965
|
|
966
|
CREATE TABLE userQuery
|
967
|
(
|
968
|
userQuery_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
969
|
usr_ID int(11) NOT NULL ,
|
970
|
queryStart Date ,
|
971
|
queryStop Date ,
|
972
|
accessionCode varchar (100) ,
|
973
|
queryName varchar (100) ,
|
974
|
queryDescription text ,
|
975
|
querySQL text ,
|
976
|
queryType varchar (50) ,
|
977
|
querySharing varchar (30) ,
|
978
|
queryPassword varchar (50) ,
|
979
|
|
980
|
PRIMARY KEY ( userQuery_ID )
|
981
|
);
|
982
|
|
983
|
CREATE TABLE userPreference
|
984
|
(
|
985
|
userPreference_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
986
|
usr_ID int(11) NOT NULL ,
|
987
|
preferenceName varchar (100) ,
|
988
|
preferenceValue text ,
|
989
|
preferencePriority Float ,
|
990
|
preferenceStart Date ,
|
991
|
preferenceStop Date ,
|
992
|
|
993
|
PRIMARY KEY ( userPreference_ID )
|
994
|
);
|
995
|
|
996
|
CREATE TABLE userRecordOwner
|
997
|
(
|
998
|
userRecordOwner_ID int(11) NOT NULL AUTO_INCREMENT NOT NULL ,
|
999
|
usr_ID int(11) NOT NULL ,
|
1000
|
tableName varchar (50) NOT NULL ,
|
1001
|
tableRecord int(11) NOT NULL ,
|
1002
|
recordCreationDate Date NOT NULL ,
|
1003
|
ownerStart Date NOT NULL ,
|
1004
|
ownerStop Date ,
|
1005
|
ownerType varchar (30) NOT NULL ,
|
1006
|
|
1007
|
PRIMARY KEY ( userRecordOwner_ID )
|
1008
|
);
|
1009
|
|
1010
|
-- ------------RELATIONSHIPS ----------------------------------------
|
1011
|
|
1012
|
ALTER TABLE commConcept ADD CONSTRAINT R1commConcept_COMMNAME_ID FOREIGN KEY (COMMNAME_ID) REFERENCES commName (COMMNAME_ID );
|
1013
|
|
1014
|
ALTER TABLE commConcept ADD CONSTRAINT R2commConcept_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1015
|
|
1016
|
ALTER TABLE commCorrelation ADD CONSTRAINT R1commCorrelation_COMMSTATUS_ID FOREIGN KEY (COMMSTATUS_ID) REFERENCES commStatus (COMMSTATUS_ID );
|
1017
|
|
1018
|
ALTER TABLE commCorrelation ADD CONSTRAINT R2commCorrelation_COMMCONCEPT_ID FOREIGN KEY (COMMCONCEPT_ID) REFERENCES commConcept (COMMCONCEPT_ID );
|
1019
|
|
1020
|
ALTER TABLE commLineage ADD CONSTRAINT R1commLineage_parentCommStatus_ID FOREIGN KEY (parentCommStatus_ID) REFERENCES commStatus (COMMSTATUS_ID );
|
1021
|
|
1022
|
ALTER TABLE commLineage ADD CONSTRAINT R2commLineage_childCommStatus_ID FOREIGN KEY (childCommStatus_ID) REFERENCES commStatus (COMMSTATUS_ID );
|
1023
|
|
1024
|
ALTER TABLE commName ADD CONSTRAINT R1commName_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1025
|
|
1026
|
ALTER TABLE commStatus ADD CONSTRAINT R1commStatus_COMMCONCEPT_ID FOREIGN KEY (COMMCONCEPT_ID) REFERENCES commConcept (COMMCONCEPT_ID );
|
1027
|
|
1028
|
ALTER TABLE commStatus ADD CONSTRAINT R2commStatus_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1029
|
|
1030
|
ALTER TABLE commStatus ADD CONSTRAINT R3commStatus_commParent_ID FOREIGN KEY (commParent_ID) REFERENCES commConcept (COMMCONCEPT_ID );
|
1031
|
|
1032
|
ALTER TABLE commStatus ADD CONSTRAINT R4commStatus_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1033
|
|
1034
|
ALTER TABLE commUsage ADD CONSTRAINT R1commUsage_COMMNAME_ID FOREIGN KEY (COMMNAME_ID) REFERENCES commName (COMMNAME_ID );
|
1035
|
|
1036
|
ALTER TABLE commUsage ADD CONSTRAINT R2commUsage_COMMCONCEPT_ID FOREIGN KEY (COMMCONCEPT_ID) REFERENCES commConcept (COMMCONCEPT_ID );
|
1037
|
|
1038
|
ALTER TABLE commUsage ADD CONSTRAINT R3commUsage_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1039
|
|
1040
|
ALTER TABLE commUsage ADD CONSTRAINT R4commUsage_COMMSTATUS_ID FOREIGN KEY (COMMSTATUS_ID) REFERENCES commStatus (COMMSTATUS_ID );
|
1041
|
|
1042
|
ALTER TABLE plantConcept ADD CONSTRAINT R1plantConcept_PLANTNAME_ID FOREIGN KEY (PLANTNAME_ID) REFERENCES plantName (PLANTNAME_ID );
|
1043
|
|
1044
|
ALTER TABLE plantConcept ADD CONSTRAINT R2plantConcept_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1045
|
|
1046
|
ALTER TABLE plantCorrelation ADD CONSTRAINT R1plantCorrelation_PLANTSTATUS_ID FOREIGN KEY (PLANTSTATUS_ID) REFERENCES plantStatus (PLANTSTATUS_ID );
|
1047
|
|
1048
|
ALTER TABLE plantCorrelation ADD CONSTRAINT R2plantCorrelation_PLANTCONCEPT_ID FOREIGN KEY (PLANTCONCEPT_ID) REFERENCES plantConcept (PLANTCONCEPT_ID );
|
1049
|
|
1050
|
ALTER TABLE plantLineage ADD CONSTRAINT R1plantLineage_childPlantStatus_ID FOREIGN KEY (childPlantStatus_ID) REFERENCES plantStatus (PLANTSTATUS_ID );
|
1051
|
|
1052
|
ALTER TABLE plantLineage ADD CONSTRAINT R2plantLineage_parentPlantStatus_ID FOREIGN KEY (parentPlantStatus_ID) REFERENCES plantStatus (PLANTSTATUS_ID );
|
1053
|
|
1054
|
ALTER TABLE plantName ADD CONSTRAINT R1plantName_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1055
|
|
1056
|
ALTER TABLE plantStatus ADD CONSTRAINT R1plantStatus_PLANTCONCEPT_ID FOREIGN KEY (PLANTCONCEPT_ID) REFERENCES plantConcept (PLANTCONCEPT_ID );
|
1057
|
|
1058
|
ALTER TABLE plantStatus ADD CONSTRAINT R2plantStatus_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1059
|
|
1060
|
ALTER TABLE plantStatus ADD CONSTRAINT R3plantStatus_plantParent_ID FOREIGN KEY (plantParent_ID) REFERENCES plantConcept (PLANTCONCEPT_ID );
|
1061
|
|
1062
|
ALTER TABLE plantStatus ADD CONSTRAINT R4plantStatus_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1063
|
|
1064
|
ALTER TABLE plantUsage ADD CONSTRAINT R1plantUsage_PLANTNAME_ID FOREIGN KEY (PLANTNAME_ID) REFERENCES plantName (PLANTNAME_ID );
|
1065
|
|
1066
|
ALTER TABLE plantUsage ADD CONSTRAINT R2plantUsage_PLANTCONCEPT_ID FOREIGN KEY (PLANTCONCEPT_ID) REFERENCES plantConcept (PLANTCONCEPT_ID );
|
1067
|
|
1068
|
ALTER TABLE plantUsage ADD CONSTRAINT R3plantUsage_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1069
|
|
1070
|
ALTER TABLE plantUsage ADD CONSTRAINT R4plantUsage_PLANTSTATUS_ID FOREIGN KEY (PLANTSTATUS_ID) REFERENCES plantStatus (PLANTSTATUS_ID );
|
1071
|
|
1072
|
ALTER TABLE address ADD CONSTRAINT R1address_party_ID FOREIGN KEY (party_ID) REFERENCES party (PARTY_ID );
|
1073
|
|
1074
|
ALTER TABLE address ADD CONSTRAINT R2address_organization_ID FOREIGN KEY (organization_ID) REFERENCES party (PARTY_ID );
|
1075
|
|
1076
|
ALTER TABLE reference ADD CONSTRAINT R1reference_referenceJournal_ID FOREIGN KEY (referenceJournal_ID) REFERENCES referenceJournal (referenceJournal_ID );
|
1077
|
|
1078
|
ALTER TABLE referenceAltIdent ADD CONSTRAINT R1referenceAltIdent_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1079
|
|
1080
|
ALTER TABLE referenceContributor ADD CONSTRAINT R1referenceContributor_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1081
|
|
1082
|
ALTER TABLE referenceContributor ADD CONSTRAINT R2referenceContributor_referenceParty_ID FOREIGN KEY (referenceParty_ID) REFERENCES referenceParty (referenceParty_ID );
|
1083
|
|
1084
|
ALTER TABLE referenceParty ADD CONSTRAINT R1referenceParty_currentParty_ID FOREIGN KEY (currentParty_ID) REFERENCES referenceParty (referenceParty_ID );
|
1085
|
|
1086
|
ALTER TABLE classContributor ADD CONSTRAINT R1classContributor_COMMCLASS_ID FOREIGN KEY (COMMCLASS_ID) REFERENCES commClass (COMMCLASS_ID );
|
1087
|
|
1088
|
ALTER TABLE classContributor ADD CONSTRAINT R2classContributor_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1089
|
|
1090
|
ALTER TABLE classContributor ADD CONSTRAINT R3classContributor_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1091
|
|
1092
|
ALTER TABLE commClass ADD CONSTRAINT R1commClass_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (OBSERVATION_ID );
|
1093
|
|
1094
|
ALTER TABLE commClass ADD CONSTRAINT R2commClass_classPublication_ID FOREIGN KEY (classPublication_ID) REFERENCES reference (reference_ID );
|
1095
|
|
1096
|
ALTER TABLE commInterpretation ADD CONSTRAINT R1commInterpretation_COMMCLASS_ID FOREIGN KEY (COMMCLASS_ID) REFERENCES commClass (COMMCLASS_ID );
|
1097
|
|
1098
|
ALTER TABLE commInterpretation ADD CONSTRAINT R2commInterpretation_COMMCONCEPT_ID FOREIGN KEY (COMMCONCEPT_ID) REFERENCES commConcept (COMMCONCEPT_ID );
|
1099
|
|
1100
|
ALTER TABLE commInterpretation ADD CONSTRAINT R3commInterpretation_commAuthority_ID FOREIGN KEY (commAuthority_ID) REFERENCES reference (reference_ID );
|
1101
|
|
1102
|
ALTER TABLE coverIndex ADD CONSTRAINT R1coverIndex_COVERMETHOD_ID FOREIGN KEY (COVERMETHOD_ID) REFERENCES coverMethod (COVERMETHOD_ID );
|
1103
|
|
1104
|
ALTER TABLE coverMethod ADD CONSTRAINT R1coverMethod_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1105
|
|
1106
|
ALTER TABLE definedValue ADD CONSTRAINT R1definedValue_USERDEFINED_ID FOREIGN KEY (USERDEFINED_ID) REFERENCES userDefined (USERDEFINED_ID );
|
1107
|
|
1108
|
ALTER TABLE disturbanceObs ADD CONSTRAINT R1disturbanceObs_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (OBSERVATION_ID );
|
1109
|
|
1110
|
ALTER TABLE graphic ADD CONSTRAINT R1graphic_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (OBSERVATION_ID );
|
1111
|
|
1112
|
ALTER TABLE namedPlace ADD CONSTRAINT R1namedPlace_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1113
|
|
1114
|
ALTER TABLE note ADD CONSTRAINT R1note_NOTELINK_ID FOREIGN KEY (NOTELINK_ID) REFERENCES noteLink (NOTELINK_ID );
|
1115
|
|
1116
|
ALTER TABLE note ADD CONSTRAINT R2note_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1117
|
|
1118
|
ALTER TABLE note ADD CONSTRAINT R3note_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1119
|
|
1120
|
ALTER TABLE observation ADD CONSTRAINT R1observation_PREVIOUSOBS_ID FOREIGN KEY (PREVIOUSOBS_ID) REFERENCES observation (OBSERVATION_ID );
|
1121
|
|
1122
|
ALTER TABLE observation ADD CONSTRAINT R2observation_PLOT_ID FOREIGN KEY (PLOT_ID) REFERENCES plot (PLOT_ID );
|
1123
|
|
1124
|
ALTER TABLE observation ADD CONSTRAINT R3observation_PROJECT_ID FOREIGN KEY (PROJECT_ID) REFERENCES project (PROJECT_ID );
|
1125
|
|
1126
|
ALTER TABLE observation ADD CONSTRAINT R4observation_COVERMETHOD_ID FOREIGN KEY (COVERMETHOD_ID) REFERENCES coverMethod (coverMethod_ID );
|
1127
|
|
1128
|
ALTER TABLE observation ADD CONSTRAINT R5observation_STRATUMMETHOD_ID FOREIGN KEY (STRATUMMETHOD_ID) REFERENCES stratumMethod (stratumMethod_ID );
|
1129
|
|
1130
|
ALTER TABLE observation ADD CONSTRAINT R6observation_SOILTAXON_ID FOREIGN KEY (SOILTAXON_ID) REFERENCES soilTaxon (soilTaxon_ID );
|
1131
|
|
1132
|
ALTER TABLE observationContributor ADD CONSTRAINT R1observationContributor_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (OBSERVATION_ID );
|
1133
|
|
1134
|
ALTER TABLE observationContributor ADD CONSTRAINT R2observationContributor_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1135
|
|
1136
|
ALTER TABLE observationContributor ADD CONSTRAINT R3observationContributor_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1137
|
|
1138
|
ALTER TABLE observationSynonym ADD CONSTRAINT R1observationSynonym_synonymObservation_ID FOREIGN KEY (synonymObservation_ID) REFERENCES observation (OBSERVATION_ID );
|
1139
|
|
1140
|
ALTER TABLE observationSynonym ADD CONSTRAINT R2observationSynonym_primaryObservation_ID FOREIGN KEY (primaryObservation_ID) REFERENCES observation (OBSERVATION_ID );
|
1141
|
|
1142
|
ALTER TABLE observationSynonym ADD CONSTRAINT R3observationSynonym_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1143
|
|
1144
|
ALTER TABLE observationSynonym ADD CONSTRAINT R4observationSynonym_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1145
|
|
1146
|
ALTER TABLE party ADD CONSTRAINT R1party_currentName_ID FOREIGN KEY (currentName_ID) REFERENCES party (PARTY_ID );
|
1147
|
|
1148
|
ALTER TABLE partyMember ADD CONSTRAINT R1partyMember_parentParty_ID FOREIGN KEY (parentParty_ID) REFERENCES party (PARTY_ID );
|
1149
|
|
1150
|
ALTER TABLE partyMember ADD CONSTRAINT R2partyMember_childParty_ID FOREIGN KEY (childParty_ID) REFERENCES party (PARTY_ID );
|
1151
|
|
1152
|
ALTER TABLE partyMember ADD CONSTRAINT R3partyMember_role_ID FOREIGN KEY (role_ID) REFERENCES aux_role (role_ID );
|
1153
|
|
1154
|
ALTER TABLE place ADD CONSTRAINT R1place_PLOT_ID FOREIGN KEY (PLOT_ID) REFERENCES plot (PLOT_ID );
|
1155
|
|
1156
|
ALTER TABLE place ADD CONSTRAINT R2place_NAMEDPLACE_ID FOREIGN KEY (NAMEDPLACE_ID) REFERENCES namedPlace (NAMEDPLACE_ID );
|
1157
|
|
1158
|
ALTER TABLE plot ADD CONSTRAINT R1plot_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1159
|
|
1160
|
ALTER TABLE plot ADD CONSTRAINT R2plot_PARENT_ID FOREIGN KEY (PARENT_ID) REFERENCES plot (PLOT_ID );
|
1161
|
|
1162
|
ALTER TABLE projectContributor ADD CONSTRAINT R1projectContributor_PROJECT_ID FOREIGN KEY (PROJECT_ID) REFERENCES project (PROJECT_ID );
|
1163
|
|
1164
|
ALTER TABLE projectContributor ADD CONSTRAINT R2projectContributor_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1165
|
|
1166
|
ALTER TABLE projectContributor ADD CONSTRAINT R3projectContributor_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1167
|
|
1168
|
ALTER TABLE revision ADD CONSTRAINT R1revision_previousRevision_ID FOREIGN KEY (previousRevision_ID) REFERENCES revision (REVISION_ID );
|
1169
|
|
1170
|
ALTER TABLE soilObs ADD CONSTRAINT R1soilObs_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (observation_ID );
|
1171
|
|
1172
|
ALTER TABLE soilTaxon ADD CONSTRAINT R1soilTaxon_SOILPARENT_ID FOREIGN KEY (SOILPARENT_ID) REFERENCES soilTaxon (SOILTAXON_ID );
|
1173
|
|
1174
|
ALTER TABLE stemCount ADD CONSTRAINT R1stemCount_TAXONIMPORTANCE_ID FOREIGN KEY (TAXONIMPORTANCE_ID) REFERENCES taxonImportance (TAXONIMPORTANCE_ID );
|
1175
|
|
1176
|
ALTER TABLE stemLocation ADD CONSTRAINT R1stemLocation_STEMCOUNT_ID FOREIGN KEY (STEMCOUNT_ID) REFERENCES stemCount (STEMCOUNT_ID );
|
1177
|
|
1178
|
ALTER TABLE stratum ADD CONSTRAINT R1stratum_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (observation_ID );
|
1179
|
|
1180
|
ALTER TABLE stratum ADD CONSTRAINT R2stratum_STRATUMTYPE_ID FOREIGN KEY (STRATUMTYPE_ID) REFERENCES stratumType (STRATUMTYPE_ID );
|
1181
|
|
1182
|
ALTER TABLE stratum ADD CONSTRAINT R3stratum_STRATUMMETHOD_ID FOREIGN KEY (STRATUMMETHOD_ID) REFERENCES stratumMethod (STRATUMMETHOD_ID );
|
1183
|
|
1184
|
ALTER TABLE stratumMethod ADD CONSTRAINT R1stratumMethod_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1185
|
|
1186
|
ALTER TABLE stratumType ADD CONSTRAINT R1stratumType_STRATUMMETHOD_ID FOREIGN KEY (STRATUMMETHOD_ID) REFERENCES stratumMethod (STRATUMMETHOD_ID );
|
1187
|
|
1188
|
ALTER TABLE taxonImportance ADD CONSTRAINT R1taxonImportance_taxonObservation_ID FOREIGN KEY (taxonObservation_ID) REFERENCES taxonObservation (taxonObservation_ID );
|
1189
|
|
1190
|
ALTER TABLE taxonImportance ADD CONSTRAINT R2taxonImportance_stratum_ID FOREIGN KEY (stratum_ID) REFERENCES stratum (STRATUM_ID );
|
1191
|
|
1192
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R1taxonInterpretation_TAXONOBSERVATION_ID FOREIGN KEY (TAXONOBSERVATION_ID) REFERENCES taxonObservation (TAXONOBSERVATION_ID );
|
1193
|
|
1194
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R2taxonInterpretation_stemLocation_ID FOREIGN KEY (stemLocation_ID) REFERENCES stemLocation (stemLocation_ID );
|
1195
|
|
1196
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R3taxonInterpretation_PLANTCONCEPT_ID FOREIGN KEY (PLANTCONCEPT_ID) REFERENCES plantConcept (PLANTCONCEPT_ID );
|
1197
|
|
1198
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R4taxonInterpretation_PLANTNAME_ID FOREIGN KEY (PLANTNAME_ID) REFERENCES plantName (PLANTNAME_ID );
|
1199
|
|
1200
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R5taxonInterpretation_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1201
|
|
1202
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R6taxonInterpretation_ROLE_ID FOREIGN KEY (ROLE_ID) REFERENCES aux_Role (ROLE_ID );
|
1203
|
|
1204
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R7taxonInterpretation_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1205
|
|
1206
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R8taxonInterpretation_collector_ID FOREIGN KEY (collector_ID) REFERENCES party (party_ID );
|
1207
|
|
1208
|
ALTER TABLE taxonInterpretation ADD CONSTRAINT R9taxonInterpretation_museum_ID FOREIGN KEY (museum_ID) REFERENCES party (party_ID );
|
1209
|
|
1210
|
ALTER TABLE taxonObservation ADD CONSTRAINT R1taxonObservation_OBSERVATION_ID FOREIGN KEY (OBSERVATION_ID) REFERENCES observation (observation_ID );
|
1211
|
|
1212
|
ALTER TABLE taxonObservation ADD CONSTRAINT R2taxonObservation_reference_ID FOREIGN KEY (reference_ID) REFERENCES reference (reference_ID );
|
1213
|
|
1214
|
ALTER TABLE taxonAlt ADD CONSTRAINT R1taxonAlt_taxonInterpretation_ID FOREIGN KEY (taxonInterpretation_ID) REFERENCES taxonInterpretation (taxonInterpretation_ID );
|
1215
|
|
1216
|
ALTER TABLE taxonAlt ADD CONSTRAINT R2taxonAlt_plantConcept_ID FOREIGN KEY (plantConcept_ID) REFERENCES plantConcept (plantConcept_ID );
|
1217
|
|
1218
|
ALTER TABLE telephone ADD CONSTRAINT R1telephone_PARTY_ID FOREIGN KEY (PARTY_ID) REFERENCES party (PARTY_ID );
|
1219
|
|
1220
|
ALTER TABLE embargo ADD CONSTRAINT R1embargo_plot_ID FOREIGN KEY (plot_ID) REFERENCES plot (PLOT_ID );
|
1221
|
|
1222
|
ALTER TABLE usr ADD CONSTRAINT R1usr_party_ID FOREIGN KEY (party_ID) REFERENCES party (PARTY_ID );
|
1223
|
|
1224
|
ALTER TABLE userCertification ADD CONSTRAINT R1userCertification_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1225
|
|
1226
|
ALTER TABLE userRegionalExp ADD CONSTRAINT R1userRegionalExp_userCertification_ID FOREIGN KEY (userCertification_ID) REFERENCES userCertification (userCertification_ID );
|
1227
|
|
1228
|
-- ALTER TABLE userDataset ADD CONSTRAINT R1userDataset_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1229
|
|
1230
|
ALTER TABLE userDatasetItem ADD CONSTRAINT R1userDatasetItem_userDataset_ID FOREIGN KEY (userDataset_ID) REFERENCES userDataset (userDataset_ID );
|
1231
|
|
1232
|
ALTER TABLE userNotify ADD CONSTRAINT R1userNotify_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1233
|
|
1234
|
ALTER TABLE userPermission ADD CONSTRAINT R1userPermission_embargo_ID FOREIGN KEY (embargo_ID) REFERENCES embargo (embargo_ID );
|
1235
|
|
1236
|
ALTER TABLE userPermission ADD CONSTRAINT R2userPermission_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1237
|
|
1238
|
ALTER TABLE userQuery ADD CONSTRAINT R1userQuery_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1239
|
|
1240
|
ALTER TABLE userPreference ADD CONSTRAINT R1userPreference_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|
1241
|
|
1242
|
ALTER TABLE userRecordOwner ADD CONSTRAINT R1userRecordOwner_usr_ID FOREIGN KEY (usr_ID) REFERENCES usr (usr_ID );
|