Project

General

Profile

BIEN2 » bien2_foreign_keys.sql

Aaron Marcuse-Kubitza, 02/15/2013 10:44 PM

 
1
-- phpMyAdmin SQL Dump
2
-- version 3.4.6
3
-- http://www.phpmyadmin.net
4
--
5
-- Host: 127.0.0.1
6
-- Generation Time: Oct 19, 2011 at 06:00 PM
7
-- Server version: 5.5.16
8
-- PHP Version: 5.3.6
9

    
10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
SET time_zone = "+00:00";
12

    
13

    
14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17
/*!40101 SET NAMES utf8 */;
18

    
19
--
20
-- Database: `bien2_foreign_keys`
21
--
22

    
23
-- --------------------------------------------------------
24

    
25
--
26
-- Table structure for table `bien_genus_family`
27
--
28

    
29
CREATE TABLE IF NOT EXISTS `bien_genus_family` (
30
  `family` varchar(250) CHARACTER SET utf8 NOT NULL,
31
  `genus` varchar(150) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
32
  `tot_families` int(1) DEFAULT NULL,
33
  KEY `genus` (`genus`),
34
  KEY `family` (`family`),
35
  KEY `tot_families` (`tot_families`)
36
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
37

    
38
-- --------------------------------------------------------
39

    
40
--
41
-- Table structure for table `clade`
42
--
43

    
44
CREATE TABLE IF NOT EXISTS `clade` (
45
  `cladeID` int(11) unsigned NOT NULL,
46
  `parentCladeID` int(11) unsigned DEFAULT NULL,
47
  `cladeNameStd` varchar(250) NOT NULL,
48
  `rank` varchar(50) DEFAULT NULL,
49
  `isHybrid` int(1) unsigned NOT NULL,
50
  `family` varchar(100) DEFAULT NULL,
51
  `leftIndex` int(11) unsigned DEFAULT NULL,
52
  `rightIndex` int(11) unsigned DEFAULT NULL,
53
  `source` varchar(25) DEFAULT NULL,
54
  `majorPlantGroup` varchar(45) DEFAULT NULL,
55
  `embryophytes` varchar(45) DEFAULT NULL,
56
  `vascularPlants` varchar(45) DEFAULT NULL,
57
  `seedPlants` varchar(45) DEFAULT NULL,
58
  `floweringPlants` varchar(45) DEFAULT NULL,
59
  PRIMARY KEY (`cladeID`) USING BTREE,
60
  KEY `nameStaging_isHybrid` (`isHybrid`),
61
  KEY `nameStaging_family` (`family`),
62
  KEY `nameStaging_leftIndex` (`leftIndex`),
63
  KEY `nameStaging_rightIndex` (`rightIndex`),
64
  KEY `idx_source` (`source`),
65
  KEY `nameStaging_rank` (`rank`) USING BTREE,
66
  KEY `Index_majorPlantGroup` (`majorPlantGroup`) USING BTREE,
67
  KEY `Index_embryophytes` (`embryophytes`) USING BTREE,
68
  KEY `Index_seedPlants` (`seedPlants`) USING BTREE,
69
  KEY `Index_vascularPlants` (`vascularPlants`) USING BTREE,
70
  KEY `Index_floweringPlants` (`floweringPlants`) USING BTREE,
71
  KEY `nameStaging_parentCladeID` (`parentCladeID`) USING BTREE,
72
  KEY `nameStaging_cladeNameStd` (`cladeNameStd`) USING BTREE
73
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
74

    
75
-- --------------------------------------------------------
76

    
77
--
78
-- Table structure for table `cladeName`
79
--
80

    
81
CREATE TABLE IF NOT EXISTS `cladeName` (
82
  `cladeNameID` int(11) NOT NULL AUTO_INCREMENT,
83
  `cladeID` int(10) unsigned NOT NULL,
84
  `cladeName` varchar(250) NOT NULL,
85
  `cladeNameUnique` varchar(300) DEFAULT NULL,
86
  `nameStatus` varchar(50) DEFAULT NULL,
87
  `source` varchar(45) DEFAULT NULL,
88
  PRIMARY KEY (`cladeNameID`) USING BTREE,
89
  KEY `idx_cladeID` (`cladeID`) USING BTREE,
90
  KEY `Index_source` (`source`),
91
  KEY `idx_name` (`cladeName`) USING BTREE,
92
  KEY `idx_nameStatus` (`nameStatus`) USING BTREE
93
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
94

    
95
-- --------------------------------------------------------
96

    
97
--
98
-- Table structure for table `DataSource`
99
--
100

    
101
CREATE TABLE IF NOT EXISTS `DataSource` (
102
  `DataSourceID` int(10) unsigned NOT NULL AUTO_INCREMENT,
103
  `DataSourceName` varchar(255) NOT NULL,
104
  `DataSourceType` varchar(255) NOT NULL,
105
  PRIMARY KEY (`DataSourceID`),
106
  KEY `DataSourceName` (`DataSourceName`),
107
  KEY `DataSourceType` (`DataSourceType`)
108
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data sources for plots or specimens';
109

    
110
-- --------------------------------------------------------
111

    
112
--
113
-- Table structure for table `geoIndividualObservation`
114
--
115

    
116
CREATE TABLE IF NOT EXISTS `geoIndividualObservation` (
117
  `ID` int(11) NOT NULL COMMENT 'Links 1:1 with DBPlotID',
118
  `countryISO` varchar(25) DEFAULT NULL,
119
  `countryStd` varchar(150) DEFAULT NULL,
120
  `isInCountry` int(1) DEFAULT NULL,
121
  `countryDistError` double DEFAULT NULL,
122
  `stateProvinceStd` varchar(150) DEFAULT NULL,
123
  `isInStateProvince` int(1) DEFAULT NULL,
124
  `stateProvinceDistError` double DEFAULT NULL,
125
  `countyParishStd` varchar(150) DEFAULT NULL,
126
  `isInCountyParish` int(1) DEFAULT NULL,
127
  `countyParishDistError` double DEFAULT NULL,
128
  `isValidLatLong` int(1) DEFAULT NULL,
129
  `isCultivated` int(1) DEFAULT '0',
130
  `isCultivatedReason` varchar(255) DEFAULT NULL,
131
  PRIMARY KEY (`ID`),
132
  KEY `geoI_countryISO_NDX` (`countryISO`),
133
  KEY `geoI_countryStd_NDX` (`countryStd`),
134
  KEY `geoI_isInCountry_NDX` (`isInCountry`),
135
  KEY `geoI_countryDistError_NDX` (`countryDistError`),
136
  KEY `geoI_stateProvinceStd_NDX` (`stateProvinceStd`),
137
  KEY `geoI_isInStateProvince_NDX` (`isInStateProvince`),
138
  KEY `geoI_stateProvinceDistError_NDX` (`stateProvinceDistError`),
139
  KEY `geoI_countyParishStd_NDX` (`countyParishStd`),
140
  KEY `geoI_isInCountyParish_NDX` (`isInCountyParish`),
141
  KEY `geoI_countyParishDistError_NDX` (`countyParishDistError`),
142
  KEY `geoI_isValidLatLong_NDX` (`isValidLatLong`),
143
  KEY `geoI_isCultivated` (`isCultivated`),
144
  KEY `geoI_isCultivatedReason` (`isCultivatedReason`)
145
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
146

    
147
-- --------------------------------------------------------
148

    
149
--
150
-- Table structure for table `geoPlotMetaDataDimension`
151
--
152

    
153
CREATE TABLE IF NOT EXISTS `geoPlotMetaDataDimension` (
154
  `ID` int(11) NOT NULL COMMENT 'Links 1:1 with DBPlotID',
155
  `countryISO` varchar(25) DEFAULT NULL,
156
  `countryStd` varchar(150) DEFAULT NULL,
157
  `isInCountry` int(1) DEFAULT NULL,
158
  `countryDistError` double DEFAULT NULL,
159
  `stateProvinceStd` varchar(150) DEFAULT NULL,
160
  `isInStateProvince` int(1) DEFAULT NULL,
161
  `stateProvinceDistError` double DEFAULT NULL,
162
  `countyParishStd` varchar(150) DEFAULT NULL,
163
  `isInCountyParish` int(1) DEFAULT NULL,
164
  `countyParishDistError` double DEFAULT NULL,
165
  `isValidLatLong` int(1) DEFAULT NULL,
166
  `isCultivated` int(1) DEFAULT '0',
167
  `isCultivatedReason` varchar(255) DEFAULT NULL,
168
  PRIMARY KEY (`ID`),
169
  KEY `geoP_countryISO_NDX` (`countryISO`),
170
  KEY `geoP_countryStd_NDX` (`countryStd`),
171
  KEY `geoP_isInCountry_NDX` (`isInCountry`),
172
  KEY `geoP_countryDistError_NDX` (`countryDistError`),
173
  KEY `geoP_stateProvinceStd_NDX` (`stateProvinceStd`),
174
  KEY `geoP_isInStateProvince_NDX` (`isInStateProvince`),
175
  KEY `geoP_stateProvinceDistError_NDX` (`stateProvinceDistError`),
176
  KEY `geoP_countyParishStd_NDX` (`countyParishStd`),
177
  KEY `geoP_isInCountyParish_NDX` (`isInCountyParish`),
178
  KEY `geoP_countyParishDistError_NDX` (`countyParishDistError`),
179
  KEY `geoP_isValidLatLong_NDX` (`isValidLatLong`),
180
  KEY `geoP_isCultivated` (`isCultivated`),
181
  KEY `geo_isCultivatedReason` (`isCultivatedReason`)
182
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
183

    
184
-- --------------------------------------------------------
185

    
186
--
187
-- Table structure for table `IndividualObservation`
188
--
189

    
190
CREATE TABLE IF NOT EXISTS `IndividualObservation` (
191
  `ObservationID` int(11) NOT NULL AUTO_INCREMENT,
192
  `ObservationType` int(11) DEFAULT NULL,
193
  `PlotTreeTag` varchar(32) COLLATE utf8_bin DEFAULT NULL,
194
  `DBPlotID` int(11) DEFAULT NULL,
195
  `SpecimenCatalogNO` varchar(64) COLLATE utf8_bin DEFAULT NULL,
196
  `ObservationSpecimenID` int(11) DEFAULT NULL,
197
  `LatestDateCollected` date DEFAULT NULL,
198
  `DecimalLatitude` decimal(10,5) DEFAULT NULL,
199
  `DecimalLongitude` decimal(10,5) DEFAULT NULL,
200
  `NumberOfStems` int(11) DEFAULT NULL,
201
  `BasalDiameter` decimal(10,5) DEFAULT NULL,
202
  `Height` decimal(10,5) DEFAULT NULL,
203
  `TaxonomyID` int(11) NOT NULL,
204
  `RawTreeID` int(10) DEFAULT NULL,
205
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
206
  PRIMARY KEY (`ObservationID`),
207
  KEY `RefPlotMetaDataDimension411` (`DBPlotID`),
208
  KEY `RefTaxonDimension381` (`TaxonomyID`),
209
  KEY `ObservationSpecimenID` (`ObservationSpecimenID`)
210
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
211

    
212
-- --------------------------------------------------------
213

    
214
--
215
-- Table structure for table `IndividualObservationMeasurement`
216
--
217

    
218
CREATE TABLE IF NOT EXISTS `IndividualObservationMeasurement` (
219
  `ObservationID` int(11) NOT NULL,
220
  `StemNO` int(11) NOT NULL AUTO_INCREMENT,
221
  `ObservationNO` int(11) NOT NULL,
222
  `PrimaryStem` int(11) DEFAULT NULL,
223
  `DBH` decimal(10,5) DEFAULT NULL,
224
  `HOM` decimal(10,5) DEFAULT NULL,
225
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
226
  PRIMARY KEY (`StemNO`),
227
  UNIQUE KEY `ObservationID` (`ObservationID`,`StemNO`,`ObservationNO`),
228
  KEY `RefIndividualObservation11` (`ObservationID`)
229
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
230

    
231
-- --------------------------------------------------------
232

    
233
--
234
-- Table structure for table `ObservationSpecimen`
235
--
236

    
237
CREATE TABLE IF NOT EXISTS `ObservationSpecimen` (
238
  `ObservationSpecimenID` int(11) NOT NULL AUTO_INCREMENT,
239
  `DBSourceID` int(11) NOT NULL,
240
  `Continent` varchar(64) COLLATE utf8_bin DEFAULT NULL,
241
  `Country` varchar(100) COLLATE utf8_bin DEFAULT NULL,
242
  `StateProvince` varchar(64) COLLATE utf8_bin DEFAULT NULL,
243
  `verbatimCountry` varchar(100) COLLATE utf8_bin DEFAULT NULL,
244
  `County` varchar(100) COLLATE utf8_bin DEFAULT NULL,
245
  `Locality` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
246
  `Collector` varchar(256) COLLATE utf8_bin DEFAULT NULL,
247
  `IdentifiedBy` varchar(128) COLLATE utf8_bin DEFAULT NULL,
248
  `IdentifiedDate` date DEFAULT NULL,
249
  `CoordinateUncertainty` decimal(10,5) DEFAULT NULL,
250
  `CoordinateUncertaintyUnits` varchar(10) COLLATE utf8_bin DEFAULT NULL,
251
  `VegetationCategory` varchar(32) COLLATE utf8_bin DEFAULT NULL,
252
  `test` tinyint(3) unsigned NOT NULL,
253
  `Cultivated` int(1) NOT NULL,
254
  `CollectionNumber` varchar(24) COLLATE utf8_bin DEFAULT NULL,
255
  PRIMARY KEY (`ObservationSpecimenID`),
256
  KEY `RefSpecimenSourceData421` (`DBSourceID`),
257
  KEY `DBSourceID` (`DBSourceID`,`Continent`,`Country`,`StateProvince`,`County`,`Locality`(255),`Collector`(255),`IdentifiedBy`,`IdentifiedDate`,`CoordinateUncertainty`,`CoordinateUncertaintyUnits`,`VegetationCategory`)
258
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
259

    
260
-- --------------------------------------------------------
261

    
262
--
263
-- Table structure for table `PlotAggregateFact`
264
--
265

    
266
CREATE TABLE IF NOT EXISTS `PlotAggregateFact` (
267
  `DBPlotID` int(11) NOT NULL,
268
  `PlotTimeID` int(11) NOT NULL,
269
  `TotalIndividuals` int(11) DEFAULT NULL,
270
  `TotalIndividualsAbove1cm` int(11) DEFAULT NULL,
271
  `TotalIndividualsAbove2.5cm` int(11) DEFAULT NULL,
272
  `TotalIndividualsAbove10cm` int(11) DEFAULT NULL,
273
  `PercentCover` decimal(10,5) DEFAULT NULL,
274
  `TaxonomyID` int(11) NOT NULL,
275
  `del` int(1) unsigned DEFAULT NULL,
276
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
277
  PRIMARY KEY (`DBPlotID`,`PlotTimeID`,`TaxonomyID`),
278
  KEY `RefPlotMetaDataDimension61` (`DBPlotID`),
279
  KEY `RefPlotTimeDimension371` (`PlotTimeID`),
280
  KEY `RefTaxonDimension181` (`TaxonomyID`)
281
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
282

    
283
-- --------------------------------------------------------
284

    
285
--
286
-- Table structure for table `PlotMetaDataDimension`
287
--
288

    
289
CREATE TABLE IF NOT EXISTS `PlotMetaDataDimension` (
290
  `DBPlotID` int(11) NOT NULL AUTO_INCREMENT,
291
  `DBSourceName` varchar(64) COLLATE utf8_bin DEFAULT NULL,
292
  `ContactName` varchar(32) COLLATE utf8_bin DEFAULT NULL,
293
  `ContactEmail` varchar(32) COLLATE utf8_bin DEFAULT NULL,
294
  `ContactTelephone` varchar(32) COLLATE utf8_bin DEFAULT NULL,
295
  `Continent` varchar(64) COLLATE utf8_bin DEFAULT NULL,
296
  `Country` varchar(32) COLLATE utf8_bin DEFAULT NULL,
297
  `StateProvince` varchar(64) COLLATE utf8_bin DEFAULT NULL,
298
  `verbatimCountry` varchar(64) COLLATE utf8_bin DEFAULT NULL,
299
  `County` varchar(64) COLLATE utf8_bin DEFAULT NULL,
300
  `Locality` varchar(256) COLLATE utf8_bin DEFAULT NULL,
301
  `VegetationCategory` varchar(32) COLLATE utf8_bin DEFAULT NULL,
302
  `PlotCD` bigint(32) DEFAULT NULL,
303
  `PlotName` varchar(32) COLLATE utf8_bin DEFAULT NULL,
304
  `PlotCensusMethod` varchar(32) COLLATE utf8_bin DEFAULT NULL,
305
  `PlotArea` varchar(10) COLLATE utf8_bin DEFAULT NULL,
306
  `PlotAreaUnits` varchar(10) COLLATE utf8_bin DEFAULT NULL,
307
  `PlotShape` varchar(32) COLLATE utf8_bin DEFAULT NULL,
308
  `PlotDecimalLatitude` decimal(10,5) DEFAULT NULL,
309
  `PlotDecimalLongitude` decimal(10,5) DEFAULT NULL,
310
  `CoordinateUncertainty` decimal(10,5) DEFAULT NULL,
311
  `CoordinateUncertaintyUnits` varchar(10) COLLATE utf8_bin DEFAULT NULL,
312
  `PlotReferenceX` decimal(10,5) DEFAULT NULL,
313
  `PlotReferenceY` decimal(10,5) DEFAULT NULL,
314
  `PlotMaxDBH` decimal(10,5) DEFAULT NULL,
315
  `PlotMinDBH` decimal(10,5) DEFAULT NULL,
316
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
317
  PRIMARY KEY (`DBPlotID`),
318
  KEY `DBSourceName` (`DBSourceName`),
319
  KEY `PlotName_2` (`PlotName`,`DBSourceName`)
320
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
321

    
322
-- --------------------------------------------------------
323

    
324
--
325
-- Table structure for table `PlotTimeDimension`
326
--
327

    
328
CREATE TABLE IF NOT EXISTS `PlotTimeDimension` (
329
  `PlotTimeID` int(11) NOT NULL AUTO_INCREMENT,
330
  `CensusID` int(11) DEFAULT NULL,
331
  `CensusName` varchar(32) COLLATE utf8_bin DEFAULT NULL,
332
  `CensusStartDate` date DEFAULT NULL,
333
  `CensusEndDate` date DEFAULT NULL,
334
  `DBPlotID` int(11) NOT NULL,
335
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
336
  PRIMARY KEY (`PlotTimeID`),
337
  KEY `Ref613` (`DBPlotID`),
338
  KEY `CensusName_2` (`CensusName`,`DBPlotID`,`CensusID`),
339
  KEY `CensusName_5` (`CensusName`,`CensusID`)
340
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
341

    
342
-- --------------------------------------------------------
343

    
344
--
345
-- Table structure for table `SpecimenSourceData`
346
--
347

    
348
CREATE TABLE IF NOT EXISTS `SpecimenSourceData` (
349
  `DBSourceID` int(11) NOT NULL AUTO_INCREMENT,
350
  `DBSourceName` varchar(64) COLLATE utf8_bin DEFAULT NULL,
351
  `ContactName` varchar(32) COLLATE utf8_bin DEFAULT NULL,
352
  `ContactEmail` varchar(32) COLLATE utf8_bin DEFAULT NULL,
353
  `ContactTelephone` varchar(32) COLLATE utf8_bin DEFAULT NULL,
354
  `SpecimenInstitutionCD` varchar(128) COLLATE utf8_bin DEFAULT NULL,
355
  `SpecimenCollectionCD` varchar(128) COLLATE utf8_bin DEFAULT NULL,
356
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
357
  PRIMARY KEY (`DBSourceID`),
358
  KEY `DBSourceName` (`DBSourceName`),
359
  KEY `SpecimenInstitutionCD` (`SpecimenInstitutionCD`,`SpecimenCollectionCD`,`DBSourceName`)
360
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
361

    
362
-- --------------------------------------------------------
363

    
364
--
365
-- Table structure for table `TaxonDataSource`
366
--
367

    
368
CREATE TABLE IF NOT EXISTS `TaxonDataSource` (
369
  `TaxonDataSourceID` int(10) unsigned NOT NULL AUTO_INCREMENT,
370
  `DataSourceID` int(10) unsigned NOT NULL,
371
  `TaxonomyID` int(11) NOT NULL,
372
  `TotalObservations` int(10) unsigned DEFAULT NULL,
373
  `GeoreferencedObservations` int(10) unsigned DEFAULT NULL,
374
  PRIMARY KEY (`TaxonDataSourceID`),
375
  KEY `DataSourceID` (`DataSourceID`),
376
  KEY `TaxonomyID` (`TaxonomyID`)
377
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Links taxa to data sources in which they are used';
378

    
379
-- --------------------------------------------------------
380

    
381
--
382
-- Table structure for table `TaxonDimension`
383
--
384

    
385
CREATE TABLE IF NOT EXISTS `TaxonDimension` (
386
  `TaxonomyID` int(11) NOT NULL AUTO_INCREMENT,
387
  `FamilyName` varchar(64) COLLATE utf8_bin DEFAULT NULL,
388
  `GenusName` varchar(64) COLLATE utf8_bin DEFAULT NULL,
389
  `SpecificEpithet` varchar(64) COLLATE utf8_bin DEFAULT NULL,
390
  `InfraspecificEpithet` varchar(64) COLLATE utf8_bin DEFAULT NULL,
391
  `InfraspecificRank` varchar(64) COLLATE utf8_bin DEFAULT NULL,
392
  `Authority` varchar(128) COLLATE utf8_bin DEFAULT NULL,
393
  `is_plotName` int(1) unsigned DEFAULT '0',
394
  `taxonAuthorityVerbatim` varchar(250) COLLATE utf8_bin DEFAULT NULL,
395
  `taxonMatched` varchar(250) COLLATE utf8_bin DEFAULT NULL,
396
  `taxonMatchedAuthority` varchar(250) COLLATE utf8_bin DEFAULT NULL,
397
  `unmatchedTerms` varchar(250) COLLATE utf8_bin DEFAULT NULL,
398
  `matchScore` decimal(3,2) DEFAULT NULL,
399
  `taxonMatchedAcceptance` varchar(1) COLLATE utf8_bin DEFAULT NULL,
400
  `familyCorrected` varchar(50) COLLATE utf8_bin DEFAULT NULL,
401
  `genusCorrected` varchar(150) COLLATE utf8_bin DEFAULT NULL,
402
  `speciesCorrected` varchar(255) COLLATE utf8_bin DEFAULT NULL,
403
  `taxonCorrected` varchar(250) COLLATE utf8_bin DEFAULT NULL,
404
  `authorityCorrected` varchar(250) COLLATE utf8_bin DEFAULT NULL,
405
  `taxonCorrectedTnrsID` int(10) unsigned DEFAULT NULL,
406
  `taxonCorrectedRank` varchar(25) COLLATE utf8_bin DEFAULT NULL,
407
  `taxonCorrectedAcceptance` varchar(1) COLLATE utf8_bin DEFAULT NULL,
408
  `morphospecies` varchar(250) COLLATE utf8_bin DEFAULT NULL,
409
  `taxonMorphospecies` varchar(250) COLLATE utf8_bin DEFAULT NULL,
410
  `is_scrubbed` int(1) unsigned NOT NULL DEFAULT '0',
411
  PRIMARY KEY (`TaxonomyID`),
412
  KEY `FamilyName` (`FamilyName`),
413
  KEY `GenusName` (`GenusName`),
414
  KEY `SpecificEpithet` (`SpecificEpithet`),
415
  KEY `InfraspecificRank` (`InfraspecificRank`),
416
  KEY `FamilyName_2` (`FamilyName`,`GenusName`,`SpecificEpithet`,`InfraspecificEpithet`,`InfraspecificRank`,`Authority`),
417
  KEY `InfraspecificEpithet` (`InfraspecificEpithet`),
418
  KEY `taxonAuthorityVerbatim` (`taxonAuthorityVerbatim`),
419
  KEY `taxonCorrected` (`taxonCorrected`),
420
  KEY `taxonMorphospecies` (`taxonMorphospecies`),
421
  KEY `is_scrubbed` (`is_scrubbed`),
422
  KEY `TD_familyCorrected` (`familyCorrected`),
423
  KEY `TD_taxonMatchedAcceptance` (`taxonMatchedAcceptance`),
424
  KEY `TD_taxonCorrectedAcceptance` (`taxonCorrectedAcceptance`),
425
  KEY `TD_taxonCorrectedRank` (`taxonCorrectedRank`),
426
  KEY `taxonCorrectedTnrsID` (`taxonCorrectedTnrsID`),
427
  KEY `TD_is_plotName` (`is_plotName`),
428
  KEY `genusCorrected_idx` (`genusCorrected`),
429
  KEY `speciesCorrected` (`speciesCorrected`)
430
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=FIXED;
431

    
432
-- --------------------------------------------------------
433

    
434
--
435
-- Table structure for table `TaxonObservation`
436
--
437

    
438
CREATE TABLE IF NOT EXISTS `TaxonObservation` (
439
  `TaxonomyObservationID` int(11) NOT NULL AUTO_INCREMENT,
440
  `TaxonomyID` int(11) DEFAULT NULL,
441
  `PlotOrSpecimenFlag` int(11) DEFAULT NULL,
442
  `DBPlotID` int(11) NOT NULL,
443
  `DBSourceID` int(11) NOT NULL,
444
  `GBIFScientificNameOriginal` varchar(64) COLLATE utf8_bin DEFAULT NULL,
445
  `GBIFFamilyOriginal` varchar(64) COLLATE utf8_bin DEFAULT NULL,
446
  `GBIFGenusOriginal` varchar(64) COLLATE utf8_bin DEFAULT NULL,
447
  `test` tinyint(3) unsigned NOT NULL DEFAULT '0',
448
  PRIMARY KEY (`TaxonomyObservationID`),
449
  KEY `RefTaxonDimension301` (`TaxonomyID`),
450
  KEY `Ref614` (`DBPlotID`),
451
  KEY `TaxonomyID_2` (`TaxonomyID`,`DBPlotID`),
452
  KEY `DBSourceID` (`DBSourceID`)
453
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
454

    
455
-- --------------------------------------------------------
456

    
457
--
458
-- Table structure for table `TraitObservation`
459
--
460

    
461
CREATE TABLE IF NOT EXISTS `TraitObservation` (
462
  `TraitObservationID` int(11) unsigned NOT NULL AUTO_INCREMENT,
463
  `TaxonomyID` int(11) NOT NULL,
464
  `Family` varchar(100) DEFAULT NULL,
465
  `Genus` varchar(100) DEFAULT NULL,
466
  `SpecificEpithet` varchar(100) DEFAULT NULL,
467
  `InfraspecificRank` varchar(25) DEFAULT NULL,
468
  `InfraspecificEpithet` varchar(100) DEFAULT NULL,
469
  `Taxon` varchar(255) DEFAULT NULL,
470
  `AuthorOfScientificName` varchar(255) DEFAULT NULL,
471
  `TaxonAuthor` varchar(255) DEFAULT NULL,
472
  `Habit` varchar(50) DEFAULT NULL,
473
  `TraitName` varchar(200) DEFAULT NULL,
474
  `TraitValue` varchar(100) DEFAULT NULL,
475
  `Unit` varchar(100) DEFAULT NULL,
476
  `Method` varchar(255) DEFAULT NULL,
477
  `Region` varchar(100) DEFAULT NULL,
478
  `Country` varchar(100) DEFAULT NULL,
479
  `StateProvince` varchar(100) DEFAULT NULL,
480
  `LowerPolitical` varchar(100) DEFAULT NULL,
481
  `LocalityDescription` varchar(100) DEFAULT NULL,
482
  `VerbatimLatitude` varchar(150) DEFAULT NULL,
483
  `VerbatimLongitude` varchar(150) DEFAULT NULL,
484
  `VerbatimElevation` varchar(150) DEFAULT NULL,
485
  `Source` varchar(100) DEFAULT NULL,
486
  `URLSource` varchar(100) DEFAULT NULL,
487
  `SourceCitation` varchar(1000) DEFAULT NULL,
488
  `SourceID` varchar(255) DEFAULT NULL,
489
  `VisitingDate` varchar(100) DEFAULT NULL,
490
  `ReferenceID` int(11) unsigned DEFAULT NULL,
491
  `Access` varchar(100) DEFAULT NULL,
492
  `Project_PI` varchar(255) DEFAULT NULL,
493
  `Project_PI_contact` varchar(100) DEFAULT NULL,
494
  `Observation` varchar(255) DEFAULT NULL,
495
  `Authorship` varchar(255) DEFAULT NULL,
496
  `AuthorshipContact` varchar(100) DEFAULT NULL,
497
  PRIMARY KEY (`TraitObservationID`),
498
  KEY `TaxonomyID` (`TaxonomyID`),
499
  KEY `Family` (`Family`),
500
  KEY `Taxon` (`Taxon`),
501
  KEY `TraitName` (`TraitName`),
502
  KEY `ReferenceID` (`ReferenceID`),
503
  KEY `TaxonAuthor` (`TaxonAuthor`)
504
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Species trait observations';
505

    
506
-- --------------------------------------------------------
507

    
508
--
509
-- Table structure for table `viewFullOccurrence`
510
--
511

    
512
CREATE TABLE IF NOT EXISTS `viewFullOccurrence` (
513
  `OccurID` int(11) NOT NULL AUTO_INCREMENT,
514
  `DBPlotID` int(11) NOT NULL,
515
  `ObservationID` int(11) DEFAULT NULL,
516
  `Family` varchar(64) DEFAULT NULL,
517
  `TaxonomyID` int(11) NOT NULL,
518
  `OrigGenus` varchar(64) DEFAULT NULL,
519
  `OrigSpecies` varchar(64) DEFAULT NULL,
520
  `TaxonCorrected` varchar(250) DEFAULT NULL,
521
  `Genus` varchar(64) DEFAULT NULL,
522
  `Species` varchar(64) DEFAULT NULL,
523
  `Latin` varchar(64) DEFAULT NULL,
524
  `Rank` varchar(16) DEFAULT NULL,
525
  `Accepted` varchar(2) DEFAULT NULL,
526
  `TaxonMorphoSpecies` varchar(255) DEFAULT NULL,
527
  `isCultivated` int(1) DEFAULT '0',
528
  `isCultivatedReason` varchar(255) DEFAULT NULL,
529
  `CountryOrig` varchar(100) DEFAULT NULL,
530
  `CountryStd` varchar(150) DEFAULT NULL,
531
  `CountryError` double DEFAULT NULL,
532
  `ProvinceStd` varchar(64) DEFAULT NULL,
533
  `ProvinceError` double DEFAULT NULL,
534
  `County` varchar(64) DEFAULT NULL,
535
  `Plot` varchar(32) DEFAULT NULL,
536
  `PlotArea` varchar(10) DEFAULT NULL,
537
  `Latitude` decimal(10,5) DEFAULT NULL,
538
  `Longitude` decimal(10,5) DEFAULT NULL,
539
  `isValidLatLong` int(1) DEFAULT NULL,
540
  `Date` date DEFAULT NULL,
541
  `SurveyType` varchar(10) DEFAULT NULL,
542
  `Abund` int(11) DEFAULT NULL,
543
  `Abund1` int(11) DEFAULT NULL,
544
  `Abund2.5` int(11) DEFAULT NULL,
545
  `Abund10` int(11) DEFAULT NULL,
546
  `PctCover` decimal(10,5) DEFAULT NULL,
547
  `DataSource` varchar(128) DEFAULT NULL,
548
  PRIMARY KEY (`OccurID`),
549
  KEY `DBPlotID` (`DBPlotID`),
550
  KEY `ObservationID` (`ObservationID`),
551
  KEY `Family` (`Family`(16)),
552
  KEY `TaxonCorrected` (`TaxonCorrected`(25)),
553
  KEY `Latin` (`Latin`(25)),
554
  KEY `TaxonomyID` (`TaxonomyID`),
555
  KEY `Genus` (`Genus`(16)),
556
  KEY `Species` (`Species`(20)),
557
  KEY `ORIGLATIN` (`OrigGenus`(16),`OrigSpecies`(20)),
558
  KEY `CountryStd` (`CountryStd`),
559
  KEY `SurveyType` (`SurveyType`),
560
  KEY `DataSource` (`DataSource`),
561
  KEY `Rank` (`Rank`),
562
  KEY `Accepted` (`Accepted`),
563
  KEY `isCultivated` (`isCultivated`),
564
  KEY `isCultivatedReason` (`isCultivatedReason`),
565
  KEY `isValidLatLong` (`isValidLatLong`),
566
  KEY `CountryError` (`CountryError`),
567
  KEY `ProvinceError` (`ProvinceError`)
568
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
569

    
570
--
571
-- Constraints for dumped tables
572
--
573

    
574
--
575
-- Constraints for table `cladeName`
576
--
577
ALTER TABLE `cladeName`
578
  ADD CONSTRAINT `cladeName_ibfk_1` FOREIGN KEY (`cladeID`) REFERENCES `clade` (`cladeID`) ON DELETE CASCADE ON UPDATE CASCADE;
579

    
580
--
581
-- Constraints for table `geoIndividualObservation`
582
--
583
ALTER TABLE `geoIndividualObservation`
584
  ADD CONSTRAINT `geoindividualobservation_ibfk_1` FOREIGN KEY (`ID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE;
585

    
586
--
587
-- Constraints for table `geoPlotMetaDataDimension`
588
--
589
ALTER TABLE `geoPlotMetaDataDimension`
590
  ADD CONSTRAINT `geoplotmetadatadimension_ibfk_1` FOREIGN KEY (`ID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE;
591

    
592
--
593
-- Constraints for table `IndividualObservation`
594
--
595
ALTER TABLE `IndividualObservation`
596
  ADD CONSTRAINT `individualobservation_ibfk_3` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE,
597
  ADD CONSTRAINT `individualobservation_ibfk_1` FOREIGN KEY (`ObservationSpecimenID`) REFERENCES `ObservationSpecimen` (`ObservationSpecimenID`) ON DELETE CASCADE ON UPDATE CASCADE,
598
  ADD CONSTRAINT `individualobservation_ibfk_2` FOREIGN KEY (`DBPlotID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE;
599

    
600
--
601
-- Constraints for table `IndividualObservationMeasurement`
602
--
603
ALTER TABLE `IndividualObservationMeasurement`
604
  ADD CONSTRAINT `IndividualObservationMeasurement_ibfk_1` FOREIGN KEY (`ObservationID`) REFERENCES `IndividualObservation` (`ObservationID`) ON DELETE CASCADE ON UPDATE CASCADE;
605

    
606
--
607
-- Constraints for table `ObservationSpecimen`
608
--
609
ALTER TABLE `ObservationSpecimen`
610
  ADD CONSTRAINT `observationspecimen_ibfk_1` FOREIGN KEY (`DBSourceID`) REFERENCES `SpecimenSourceData` (`DBSourceID`) ON DELETE CASCADE ON UPDATE CASCADE;
611

    
612
--
613
-- Constraints for table `PlotAggregateFact`
614
--
615
ALTER TABLE `PlotAggregateFact`
616
  ADD CONSTRAINT `plotaggregatefact_ibfk_3` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE,
617
  ADD CONSTRAINT `plotaggregatefact_ibfk_1` FOREIGN KEY (`DBPlotID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE,
618
  ADD CONSTRAINT `plotaggregatefact_ibfk_2` FOREIGN KEY (`PlotTimeID`) REFERENCES `PlotTimeDimension` (`PlotTimeID`) ON DELETE CASCADE ON UPDATE CASCADE;
619

    
620
--
621
-- Constraints for table `PlotTimeDimension`
622
--
623
ALTER TABLE `PlotTimeDimension`
624
  ADD CONSTRAINT `plottimedimension_ibfk_1` FOREIGN KEY (`DBPlotID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE;
625

    
626
--
627
-- Constraints for table `TaxonDataSource`
628
--
629
ALTER TABLE `TaxonDataSource`
630
  ADD CONSTRAINT `TaxonDataSource_ibfk_2` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE,
631
  ADD CONSTRAINT `TaxonDataSource_ibfk_1` FOREIGN KEY (`DataSourceID`) REFERENCES `DataSource` (`DataSourceID`) ON DELETE CASCADE ON UPDATE CASCADE;
632

    
633
--
634
-- Constraints for table `TaxonObservation`
635
--
636
ALTER TABLE `TaxonObservation`
637
  ADD CONSTRAINT `taxonobservation_ibfk_3` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE,
638
  ADD CONSTRAINT `taxonobservation_ibfk_1` FOREIGN KEY (`DBPlotID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE,
639
  ADD CONSTRAINT `taxonobservation_ibfk_2` FOREIGN KEY (`DBSourceID`) REFERENCES `SpecimenSourceData` (`DBSourceID`) ON DELETE CASCADE ON UPDATE CASCADE;
640

    
641
--
642
-- Constraints for table `TraitObservation`
643
--
644
ALTER TABLE `TraitObservation`
645
  ADD CONSTRAINT `traitobservation_ibfk_1` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE;
646

    
647
--
648
-- Constraints for table `viewFullOccurrence`
649
--
650
ALTER TABLE `viewFullOccurrence`
651
  ADD CONSTRAINT `viewFullOccurrence_ibfk_1` FOREIGN KEY (`ObservationID`) REFERENCES `IndividualObservation` (`ObservationID`) ON DELETE CASCADE ON UPDATE CASCADE,
652
  ADD CONSTRAINT `viewFullOccurrence_ibfk_3` FOREIGN KEY (`DBPlotID`) REFERENCES `PlotMetaDataDimension` (`DBPlotID`) ON DELETE CASCADE ON UPDATE CASCADE,
653
  ADD CONSTRAINT `viewFullOccurrence_ibfk_2` FOREIGN KEY (`TaxonomyID`) REFERENCES `TaxonDimension` (`TaxonomyID`) ON DELETE CASCADE ON UPDATE CASCADE;
654

    
655
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
656
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
657
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
(3-3/5)