Project

General

Profile

1
-- MySQL dump 10.13  Distrib 5.5.32, for debian-linux-gnu (x86_64)
2
--
3
-- Host: localhost    Database: VegCore
4
-- ------------------------------------------------------
5
-- Server version	5.5.32-0ubuntu0.12.04.1
6

    
7
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10
/*!40101 SET NAMES utf8 */;
11
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12
/*!40103 SET TIME_ZONE='+00:00' */;
13
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17

    
18
--
19
-- Current Database: `VegCore`
20
--
21

    
22
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `VegCore` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
23

    
24
USE `VegCore`;
25

    
26
--
27
-- Table structure for table `aggregate_observation`
28
--
29

    
30
/*!40101 SET @saved_cs_client     = @@character_set_client */;
31
/*!40101 SET character_set_client = utf8 */;
32
CREATE TABLE `aggregate_observation` (
33
  `id` varbinary(767) NOT NULL,
34
  `occurrence_status` varbinary(767) DEFAULT NULL,
35
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
36
  PRIMARY KEY (`id`),
37
  CONSTRAINT `fk_taxon_presence_taxa_sampling_event10` FOREIGN KEY (`id`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
38
  CONSTRAINT `fk_taxon_presence_taxon_determination10` FOREIGN KEY (`id`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
39
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
40
/*!40101 SET character_set_client = @saved_cs_client */;
41

    
42
--
43
-- Dumping data for table `aggregate_observation`
44
--
45

    
46
/*!40000 ALTER TABLE `aggregate_observation` DISABLE KEYS */;
47
/*!40000 ALTER TABLE `aggregate_observation` ENABLE KEYS */;
48

    
49
--
50
-- Table structure for table `base_class`
51
--
52

    
53
/*!40101 SET @saved_cs_client     = @@character_set_client */;
54
/*!40101 SET character_set_client = utf8 */;
55
CREATE TABLE `base_class` (
56
  `id` varbinary(767) NOT NULL,
57
  `referenced_class` varbinary(767) NOT NULL,
58
  PRIMARY KEY (`id`),
59
  KEY `fk_base_class_referenced_class1_idx` (`referenced_class`),
60
  CONSTRAINT `fk_base_class_referenced_class1` FOREIGN KEY (`referenced_class`) REFERENCES `referenced_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
61
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
62
/*!40101 SET character_set_client = @saved_cs_client */;
63

    
64
--
65
-- Dumping data for table `base_class`
66
--
67

    
68
/*!40000 ALTER TABLE `base_class` DISABLE KEYS */;
69
/*!40000 ALTER TABLE `base_class` ENABLE KEYS */;
70

    
71
--
72
-- Table structure for table `collection`
73
--
74

    
75
/*!40101 SET @saved_cs_client     = @@character_set_client */;
76
/*!40101 SET character_set_client = utf8 */;
77
CREATE TABLE `collection` (
78
  `id` varbinary(767) NOT NULL,
79
  `institution` varbinary(767) NOT NULL,
80
  `name` varbinary(767) NOT NULL,
81
  PRIMARY KEY (`id`),
82
  UNIQUE KEY `collection_unique` (`institution`,`name`),
83
  KEY `fk_collection_organization1_idx` (`institution`),
84
  KEY `fk_collection_source1_idx` (`id`),
85
  CONSTRAINT `fk_collection_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
86
  CONSTRAINT `fk_collection_source1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
87
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"the collection within the institution where a specimen is held" ("Brad Boyle":https://projects.nceas.ucsb.edu/nceas/attachments/download/621/vegbien_identifier_examples.xlsx#terms/collectionCode)';
88
/*!40101 SET character_set_client = @saved_cs_client */;
89

    
90
--
91
-- Dumping data for table `collection`
92
--
93

    
94
/*!40000 ALTER TABLE `collection` DISABLE KEYS */;
95
/*!40000 ALTER TABLE `collection` ENABLE KEYS */;
96

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

    
101
/*!40101 SET @saved_cs_client     = @@character_set_client */;
102
/*!40101 SET character_set_client = utf8 */;
103
CREATE TABLE `community` (
104
  `id` varbinary(767) NOT NULL,
105
  `name` varbinary(767) NOT NULL,
106
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
107
  PRIMARY KEY (`id`),
108
  CONSTRAINT `fk_community_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
109
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A community type is an abstract grouping of organisms that tend to co-occur on the landscape due to shared ecological requirements or preferences. May be designated by syntaxon or physiognomic types." ([[VegCore#VegX|VegX]])';
110
/*!40101 SET character_set_client = @saved_cs_client */;
111

    
112
--
113
-- Dumping data for table `community`
114
--
115

    
116
/*!40000 ALTER TABLE `community` DISABLE KEYS */;
117
/*!40000 ALTER TABLE `community` ENABLE KEYS */;
118

    
119
--
120
-- Table structure for table `derived_class`
121
--
122

    
123
/*!40101 SET @saved_cs_client     = @@character_set_client */;
124
/*!40101 SET character_set_client = utf8 */;
125
CREATE TABLE `derived_class` (
126
  `id` varbinary(767) NOT NULL,
127
  PRIMARY KEY (`id`),
128
  CONSTRAINT `fk_derived_class_base_class1` FOREIGN KEY (`id`) REFERENCES `base_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
129
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
130
/*!40101 SET character_set_client = @saved_cs_client */;
131

    
132
--
133
-- Dumping data for table `derived_class`
134
--
135

    
136
/*!40000 ALTER TABLE `derived_class` DISABLE KEYS */;
137
/*!40000 ALTER TABLE `derived_class` ENABLE KEYS */;
138

    
139
--
140
-- Table structure for table `event`
141
--
142

    
143
/*!40101 SET @saved_cs_client     = @@character_set_client */;
144
/*!40101 SET character_set_client = utf8 */;
145
CREATE TABLE `event` (
146
  `id` varbinary(767) NOT NULL,
147
  `parent` varbinary(767) DEFAULT NULL,
148
  `name` varbinary(767) DEFAULT NULL,
149
  `date_range` varbinary(767) DEFAULT NULL,
150
  `place` varbinary(767) DEFAULT NULL,
151
  `participants` varbinary(767) DEFAULT NULL,
152
  PRIMARY KEY (`id`),
153
  KEY `fk_event_place1_idx` (`place`),
154
  KEY `fk_event1_idx` (`parent`),
155
  KEY `fk_event_party_list1_idx` (`participants`),
156
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
157
  CONSTRAINT `fk_event_party_list1` FOREIGN KEY (`participants`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
158
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
159
  CONSTRAINT `fk_event_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
160
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"an action that occurs at a place and during a period of time" ("DwC":http://rs.tdwg.org/dwc/terms/#Event)';
161
/*!40101 SET character_set_client = @saved_cs_client */;
162

    
163
--
164
-- Dumping data for table `event`
165
--
166

    
167
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
168
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
169

    
170
--
171
-- Table structure for table `geological_context`
172
--
173

    
174
/*!40101 SET @saved_cs_client     = @@character_set_client */;
175
/*!40101 SET character_set_client = utf8 */;
176
CREATE TABLE `geological_context` (
177
  `id` varbinary(767) NOT NULL,
178
  `name` varbinary(767) NOT NULL,
179
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
180
  PRIMARY KEY (`id`),
181
  CONSTRAINT `fk_geological_context_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
182
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"information pertaining to a location within a geological context, such as stratigraphy" ("DwC":http://rs.tdwg.org/dwc/terms/#GeologicalContext)';
183
/*!40101 SET character_set_client = @saved_cs_client */;
184

    
185
--
186
-- Dumping data for table `geological_context`
187
--
188

    
189
/*!40000 ALTER TABLE `geological_context` DISABLE KEYS */;
190
/*!40000 ALTER TABLE `geological_context` ENABLE KEYS */;
191

    
192
--
193
-- Table structure for table `geopath`
194
--
195

    
196
/*!40101 SET @saved_cs_client     = @@character_set_client */;
197
/*!40101 SET character_set_client = utf8 */;
198
CREATE TABLE `geopath` (
199
  `id` varbinary(767) NOT NULL,
200
  `continent` varbinary(767) DEFAULT NULL,
201
  `country` varbinary(767) DEFAULT NULL,
202
  `state_province` varbinary(767) DEFAULT NULL,
203
  `county` varbinary(767) DEFAULT NULL,
204
  `municipality` varbinary(767) DEFAULT NULL,
205
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
206
  PRIMARY KEY (`id`)
207
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
208
/*!40101 SET character_set_client = @saved_cs_client */;
209

    
210
--
211
-- Dumping data for table `geopath`
212
--
213

    
214
/*!40000 ALTER TABLE `geopath` DISABLE KEYS */;
215
/*!40000 ALTER TABLE `geopath` ENABLE KEYS */;
216

    
217
--
218
-- Table structure for table `geoplace`
219
--
220

    
221
/*!40101 SET @saved_cs_client     = @@character_set_client */;
222
/*!40101 SET character_set_client = utf8 */;
223
CREATE TABLE `geoplace` (
224
  `id` varbinary(767) NOT NULL,
225
  `latitude_deg` varbinary(767) NOT NULL,
226
  `longitude_deg` varbinary(767) NOT NULL,
227
  `boundary_WKT` varbinary(767) NOT NULL DEFAULT 'point',
228
  `official_name` varbinary(767) DEFAULT NULL,
229
  PRIMARY KEY (`id`),
230
  CONSTRAINT `fk_geoplace_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
231
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point';
232
/*!40101 SET character_set_client = @saved_cs_client */;
233

    
234
--
235
-- Dumping data for table `geoplace`
236
--
237

    
238
/*!40000 ALTER TABLE `geoplace` DISABLE KEYS */;
239
/*!40000 ALTER TABLE `geoplace` ENABLE KEYS */;
240

    
241
--
242
-- Table structure for table `georeferencing`
243
--
244

    
245
/*!40101 SET @saved_cs_client     = @@character_set_client */;
246
/*!40101 SET character_set_client = utf8 */;
247
CREATE TABLE `georeferencing` (
248
  `id` varbinary(767) NOT NULL,
249
  `input_place` varbinary(767) NOT NULL,
250
  `geoplace` varbinary(767) DEFAULT NULL,
251
  `georeferenced_by` varbinary(767) DEFAULT NULL,
252
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
253
  PRIMARY KEY (`id`),
254
  KEY `fk_georef_place1_idx` (`input_place`),
255
  KEY `fk_georeferencing_party_list1_idx` (`georeferenced_by`),
256
  KEY `fk_georeferencing_geoplace1_idx` (`geoplace`),
257
  CONSTRAINT `fk_georeferencing_geoplace1` FOREIGN KEY (`geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
258
  CONSTRAINT `fk_georeferencing_party_list1` FOREIGN KEY (`georeferenced_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
259
  CONSTRAINT `fk_georef_place1` FOREIGN KEY (`input_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
260
  CONSTRAINT `fk_geovalidation_record100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
261
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='also stored GNRS results';
262
/*!40101 SET character_set_client = @saved_cs_client */;
263

    
264
--
265
-- Dumping data for table `georeferencing`
266
--
267

    
268
/*!40000 ALTER TABLE `georeferencing` DISABLE KEYS */;
269
/*!40000 ALTER TABLE `georeferencing` ENABLE KEYS */;
270

    
271
--
272
-- Table structure for table `geovalidatable_place`
273
--
274

    
275
/*!40101 SET @saved_cs_client     = @@character_set_client */;
276
/*!40101 SET character_set_client = utf8 */;
277
CREATE TABLE `geovalidatable_place` (
278
  `id` varbinary(767) NOT NULL,
279
  `parent_geoplace` varbinary(767) NOT NULL,
280
  PRIMARY KEY (`id`),
281
  KEY `fk_geovalidatable_place_geoplace1_idx` (`parent_geoplace`),
282
  CONSTRAINT `fk_geovalidatable_place_geoplace1` FOREIGN KEY (`parent_geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
283
  CONSTRAINT `fk_nested_geoplace_geoplace1` FOREIGN KEY (`id`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
284
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores only scrubbed geoplaces (GADM places, and distinct point coordinates that GNRS says should be located within them)';
285
/*!40101 SET character_set_client = @saved_cs_client */;
286

    
287
--
288
-- Dumping data for table `geovalidatable_place`
289
--
290

    
291
/*!40000 ALTER TABLE `geovalidatable_place` DISABLE KEYS */;
292
/*!40000 ALTER TABLE `geovalidatable_place` ENABLE KEYS */;
293

    
294
--
295
-- Table structure for table `geovalidation`
296
--
297

    
298
/*!40101 SET @saved_cs_client     = @@character_set_client */;
299
/*!40101 SET character_set_client = utf8 */;
300
CREATE TABLE `geovalidation` (
301
  `id` varbinary(767) NOT NULL,
302
  `input_geoplace` varbinary(767) NOT NULL,
303
  `geovalid` tinyint(1) NOT NULL,
304
  `lat_long_domain_valid` tinyint(1) NOT NULL,
305
  `lat_long_in_place_ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
306
  `corrected_geoplace` varbinary(767) DEFAULT NULL,
307
  PRIMARY KEY (`id`),
308
  KEY `fk_geovalidation_geoplace1_idx` (`input_geoplace`),
309
  KEY `fk_geovalidation_geoplace2_idx` (`corrected_geoplace`),
310
  CONSTRAINT `fk_geovalidation_geoplace1` FOREIGN KEY (`input_geoplace`) REFERENCES `geovalidatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
311
  CONSTRAINT `fk_geovalidation_geoplace2` FOREIGN KEY (`corrected_geoplace`) REFERENCES `geovalidatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
312
  CONSTRAINT `fk_geovalidation_georeferencing1` FOREIGN KEY (`id`) REFERENCES `georeferencing` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
313
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
314
/*!40101 SET character_set_client = @saved_cs_client */;
315

    
316
--
317
-- Dumping data for table `geovalidation`
318
--
319

    
320
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
321
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
322

    
323
--
324
-- Table structure for table `individual`
325
--
326

    
327
/*!40101 SET @saved_cs_client     = @@character_set_client */;
328
/*!40101 SET character_set_client = utf8 */;
329
CREATE TABLE `individual` (
330
  `id` varbinary(767) NOT NULL,
331
  `within_place` varbinary(767) NOT NULL COMMENT 'for specimens, this is the place the specimen was collected at',
332
  `identifying_place` varbinary(767) DEFAULT NULL COMMENT 'subplace within plot. not specified for specimens since their coordinates are usually not precise enough to identify an individual.',
333
  `tag` varbinary(767) DEFAULT NULL,
334
  `tag_history` set('hstore') COLLATE utf8_bin DEFAULT NULL,
335
  PRIMARY KEY (`id`),
336
  KEY `fk_individual_place1_idx` (`within_place`),
337
  KEY `fk_individual_subplace1_idx` (`identifying_place`),
338
  CONSTRAINT `fk_individual_place1` FOREIGN KEY (`within_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
339
  CONSTRAINT `fk_individual_record1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
340
  CONSTRAINT `fk_individual_subplace1` FOREIGN KEY (`identifying_place`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
341
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism';
342
/*!40101 SET character_set_client = @saved_cs_client */;
343

    
344
--
345
-- Dumping data for table `individual`
346
--
347

    
348
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
349
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
350

    
351
--
352
-- Table structure for table `individual_count`
353
--
354

    
355
/*!40101 SET @saved_cs_client     = @@character_set_client */;
356
/*!40101 SET character_set_client = utf8 */;
357
CREATE TABLE `individual_count` (
358
  `id` varbinary(767) NOT NULL,
359
  `taxon` varbinary(767) NOT NULL,
360
  `size_class` varbinary(767) DEFAULT NULL,
361
  `aggregating_traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
362
  `count` int(11) DEFAULT NULL,
363
  PRIMARY KEY (`id`),
364
  KEY `fk_aggregate_observation_taxon_presence1_idx` (`taxon`),
365
  KEY `fk_aggregate_observation_size_class1_idx` (`size_class`),
366
  CONSTRAINT `fk_aggregate_observation_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
367
  CONSTRAINT `fk_aggregate_observation_size_class1` FOREIGN KEY (`size_class`) REFERENCES `size_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
368
  CONSTRAINT `fk_aggregate_observation_taxon_presence1` FOREIGN KEY (`taxon`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
369
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stemCount.VegBank.vegpath.org';
370
/*!40101 SET character_set_client = @saved_cs_client */;
371

    
372
--
373
-- Dumping data for table `individual_count`
374
--
375

    
376
/*!40000 ALTER TABLE `individual_count` DISABLE KEYS */;
377
/*!40000 ALTER TABLE `individual_count` ENABLE KEYS */;
378

    
379
--
380
-- Table structure for table `individual_observation`
381
--
382

    
383
/*!40101 SET @saved_cs_client     = @@character_set_client */;
384
/*!40101 SET character_set_client = utf8 */;
385
CREATE TABLE `individual_observation` (
386
  `id` varbinary(767) NOT NULL,
387
  `place_observed_at` varbinary(767) DEFAULT NULL,
388
  `individual` varbinary(767) DEFAULT NULL COMMENT 'optional because an individual_observation cannot have an associated individual unless the individual is traceable to a specific plant',
389
  `code` varbinary(767) DEFAULT NULL,
390
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
391
  PRIMARY KEY (`id`),
392
  KEY `fk_individual_observation_individual1_idx` (`individual`),
393
  KEY `fk_individual_observation_place1_idx` (`place_observed_at`),
394
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
395
  CONSTRAINT `fk_individual_observation_place1` FOREIGN KEY (`place_observed_at`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
396
  CONSTRAINT `fk_individual_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
397
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]';
398
/*!40101 SET character_set_client = @saved_cs_client */;
399

    
400
--
401
-- Dumping data for table `individual_observation`
402
--
403

    
404
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
405
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
406

    
407
--
408
-- Table structure for table `layer`
409
--
410

    
411
/*!40101 SET @saved_cs_client     = @@character_set_client */;
412
/*!40101 SET character_set_client = utf8 */;
413
CREATE TABLE `layer` (
414
  `id` varbinary(767) NOT NULL,
415
  `name` varbinary(767) NOT NULL,
416
  `height_min_m` varbinary(767) DEFAULT NULL,
417
  `height_max_m` varbinary(767) DEFAULT NULL,
418
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
419
  PRIMARY KEY (`id`),
420
  CONSTRAINT `fk_layer_stratum1` FOREIGN KEY (`id`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
421
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratumType.VegBank.vegpath.org';
422
/*!40101 SET character_set_client = @saved_cs_client */;
423

    
424
--
425
-- Dumping data for table `layer`
426
--
427

    
428
/*!40000 ALTER TABLE `layer` DISABLE KEYS */;
429
/*!40000 ALTER TABLE `layer` ENABLE KEYS */;
430

    
431
--
432
-- Table structure for table `method`
433
--
434

    
435
/*!40101 SET @saved_cs_client     = @@character_set_client */;
436
/*!40101 SET character_set_client = utf8 */;
437
CREATE TABLE `method` (
438
  `id` varbinary(767) NOT NULL,
439
  `parent` varbinary(767) DEFAULT NULL,
440
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
441
  PRIMARY KEY (`id`),
442
  KEY `fk_method_method1_idx` (`parent`),
443
  CONSTRAINT `fk_method_method1` FOREIGN KEY (`parent`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
444
  CONSTRAINT `fk_method_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
445
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A specific method definition followed in the creation of the dataset. Each method links to a protocol and literature citation reference. A protocol may have many method or steps." ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/methods/method)';
446
/*!40101 SET character_set_client = @saved_cs_client */;
447

    
448
--
449
-- Dumping data for table `method`
450
--
451

    
452
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
453
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
454

    
455
--
456
-- Table structure for table `organization`
457
--
458

    
459
/*!40101 SET @saved_cs_client     = @@character_set_client */;
460
/*!40101 SET character_set_client = utf8 */;
461
CREATE TABLE `organization` (
462
  `id` varbinary(767) NOT NULL,
463
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
464
  PRIMARY KEY (`id`),
465
  CONSTRAINT `fk_organization_party1` FOREIGN KEY (`id`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
466
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
467
/*!40101 SET character_set_client = @saved_cs_client */;
468

    
469
--
470
-- Dumping data for table `organization`
471
--
472

    
473
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
474
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
475

    
476
--
477
-- Table structure for table `party`
478
--
479

    
480
/*!40101 SET @saved_cs_client     = @@character_set_client */;
481
/*!40101 SET character_set_client = utf8 */;
482
CREATE TABLE `party` (
483
  `id` varbinary(767) NOT NULL,
484
  `organization` varbinary(767) DEFAULT NULL,
485
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
486
  PRIMARY KEY (`id`),
487
  KEY `fk_party_organization1_idx` (`organization`),
488
  CONSTRAINT `fk_collection_source10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
489
  CONSTRAINT `fk_party_organization1` FOREIGN KEY (`organization`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
490
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
491
/*!40101 SET character_set_client = @saved_cs_client */;
492

    
493
--
494
-- Dumping data for table `party`
495
--
496

    
497
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
498
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
499

    
500
--
501
-- Table structure for table `party_list`
502
--
503

    
504
/*!40101 SET @saved_cs_client     = @@character_set_client */;
505
/*!40101 SET character_set_client = utf8 */;
506
CREATE TABLE `party_list` (
507
  `id` varbinary(767) NOT NULL,
508
  `count` int(11) NOT NULL,
509
  PRIMARY KEY (`id`),
510
  CONSTRAINT `fk_collection_source100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
511
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
512
/*!40101 SET character_set_client = @saved_cs_client */;
513

    
514
--
515
-- Dumping data for table `party_list`
516
--
517

    
518
/*!40000 ALTER TABLE `party_list` DISABLE KEYS */;
519
/*!40000 ALTER TABLE `party_list` ENABLE KEYS */;
520

    
521
--
522
-- Table structure for table `party_list_entry`
523
--
524

    
525
/*!40101 SET @saved_cs_client     = @@character_set_client */;
526
/*!40101 SET character_set_client = utf8 */;
527
CREATE TABLE `party_list_entry` (
528
  `id` varbinary(767) NOT NULL,
529
  `entry` varbinary(767) NOT NULL,
530
  `sort_order` int(11) DEFAULT NULL,
531
  PRIMARY KEY (`id`,`entry`),
532
  KEY `fk_party_list_has_party_party1_idx` (`entry`),
533
  KEY `fk_party_list_has_party_party_list1_idx` (`id`),
534
  CONSTRAINT `fk_party_list_has_party_party1` FOREIGN KEY (`entry`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
535
  CONSTRAINT `fk_party_list_has_party_party_list1` FOREIGN KEY (`id`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
536
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
537
/*!40101 SET character_set_client = @saved_cs_client */;
538

    
539
--
540
-- Dumping data for table `party_list_entry`
541
--
542

    
543
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
544
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
545

    
546
--
547
-- Table structure for table `place`
548
--
549

    
550
/*!40101 SET @saved_cs_client     = @@character_set_client */;
551
/*!40101 SET character_set_client = utf8 */;
552
CREATE TABLE `place` (
553
  `id` varbinary(767) NOT NULL,
554
  `parent` varbinary(767) DEFAULT NULL,
555
  `rank` varbinary(767) DEFAULT NULL,
556
  `name` varbinary(767) DEFAULT NULL,
557
  `geopath` varbinary(767) DEFAULT NULL,
558
  `locality` varbinary(767) DEFAULT NULL,
559
  `verbatim` set('hstore') COLLATE utf8_bin DEFAULT NULL COMMENT 'for verbatim coordinates, etc.',
560
  PRIMARY KEY (`id`),
561
  KEY `fk_place1_idx` (`parent`),
562
  KEY `fk_place_geopath1_idx` (`geopath`),
563
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
564
  CONSTRAINT `fk_place_geopath1` FOREIGN KEY (`geopath`) REFERENCES `geopath` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
565
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
566
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
567
/*!40101 SET character_set_client = @saved_cs_client */;
568

    
569
--
570
-- Dumping data for table `place`
571
--
572

    
573
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
574
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
575

    
576
--
577
-- Table structure for table `place_observation`
578
--
579

    
580
/*!40101 SET @saved_cs_client     = @@character_set_client */;
581
/*!40101 SET character_set_client = utf8 */;
582
CREATE TABLE `place_observation` (
583
  `id` varbinary(767) NOT NULL,
584
  `place` varbinary(767) NOT NULL,
585
  `elevation_m` double DEFAULT NULL,
586
  `slope_incline_deg` double DEFAULT NULL,
587
  `slope_direction_deg_N` double DEFAULT NULL,
588
  `geological_context` varbinary(767) DEFAULT NULL,
589
  `community` varbinary(767) DEFAULT NULL,
590
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
591
  PRIMARY KEY (`id`),
592
  KEY `fk_place_observation_place1_idx` (`place`),
593
  KEY `fk_place_observation_geological_context1_idx` (`geological_context`),
594
  KEY `fk_place_observation_community1_idx` (`community`),
595
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
596
  CONSTRAINT `fk_place_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
597
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
598
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
599
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
600
/*!40101 SET character_set_client = @saved_cs_client */;
601

    
602
--
603
-- Dumping data for table `place_observation`
604
--
605

    
606
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
607
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
608

    
609
--
610
-- Table structure for table `plot`
611
--
612

    
613
/*!40101 SET @saved_cs_client     = @@character_set_client */;
614
/*!40101 SET character_set_client = utf8 */;
615
CREATE TABLE `plot` (
616
  `id` varbinary(767) NOT NULL,
617
  `name` varbinary(767) DEFAULT NULL,
618
  `area_m2` double DEFAULT NULL,
619
  `shape` varbinary(767) DEFAULT NULL,
620
  `length_m` varbinary(767) DEFAULT NULL,
621
  `width_m` varbinary(767) DEFAULT NULL,
622
  `azimuth_deg_N` varbinary(767) DEFAULT NULL,
623
  `boundary_WKT` varbinary(767) DEFAULT NULL,
624
  `dimensions` set('hstore') COLLATE utf8_bin DEFAULT NULL,
625
  PRIMARY KEY (`id`),
626
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
627
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
628
/*!40101 SET character_set_client = @saved_cs_client */;
629

    
630
--
631
-- Dumping data for table `plot`
632
--
633

    
634
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
635
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
636

    
637
--
638
-- Table structure for table `project`
639
--
640

    
641
/*!40101 SET @saved_cs_client     = @@character_set_client */;
642
/*!40101 SET character_set_client = utf8 */;
643
CREATE TABLE `project` (
644
  `id` varbinary(767) NOT NULL,
645
  `name` varbinary(767) NOT NULL,
646
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
647
  PRIMARY KEY (`id`),
648
  CONSTRAINT `fk_project_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
649
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A "project established to collect vegetation plot data. Each plot originates as part of a project." ("VegBank":http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=project&entity=dba_tabledescription&where=where_tablename)';
650
/*!40101 SET character_set_client = @saved_cs_client */;
651

    
652
--
653
-- Dumping data for table `project`
654
--
655

    
656
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
657
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
658

    
659
--
660
-- Table structure for table `record`
661
--
662

    
663
/*!40101 SET @saved_cs_client     = @@character_set_client */;
664
/*!40101 SET character_set_client = utf8 */;
665
CREATE TABLE `record` (
666
  `id` varbinary(767) NOT NULL,
667
  `source` varbinary(767) NOT NULL,
668
  `source_id_scope` varbinary(767) DEFAULT NULL,
669
  `source_record_id` varbinary(767) DEFAULT NULL,
670
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
671
  PRIMARY KEY (`id`),
672
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
673
  KEY `fk_record_source1_idx` (`source`),
674
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
675
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
676
/*!40101 SET character_set_client = @saved_cs_client */;
677

    
678
--
679
-- Dumping data for table `record`
680
--
681

    
682
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
683
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
684

    
685
--
686
-- Table structure for table `referenced_class`
687
--
688

    
689
/*!40101 SET @saved_cs_client     = @@character_set_client */;
690
/*!40101 SET character_set_client = utf8 */;
691
CREATE TABLE `referenced_class` (
692
  `id` varbinary(767) NOT NULL,
693
  PRIMARY KEY (`id`),
694
  CONSTRAINT `fk_example_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
695
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
696
/*!40101 SET character_set_client = @saved_cs_client */;
697

    
698
--
699
-- Dumping data for table `referenced_class`
700
--
701

    
702
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
703
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
704

    
705
--
706
-- Table structure for table `relationship`
707
--
708

    
709
/*!40101 SET @saved_cs_client     = @@character_set_client */;
710
/*!40101 SET character_set_client = utf8 */;
711
CREATE TABLE `relationship` (
712
  `id` varbinary(767) NOT NULL,
713
  `record` varbinary(767) NOT NULL,
714
  `related_record` varbinary(767) NOT NULL,
715
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
716
  PRIMARY KEY (`id`),
717
  KEY `fk_relationship_record1_idx` (`record`),
718
  KEY `fk_relationship_related_record_idx` (`related_record`),
719
  CONSTRAINT `fk_relationship_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
720
  CONSTRAINT `fk_relationship_record2` FOREIGN KEY (`record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
721
  CONSTRAINT `fk_relationship_related_record` FOREIGN KEY (`related_record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
722
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"information pertaining to relationships between resources (instances of data records, such as Occurrences, Taxa, Locations, Events)" ("DwC":http://rs.tdwg.org/dwc/terms/#ResourceRelationship)';
723
/*!40101 SET character_set_client = @saved_cs_client */;
724

    
725
--
726
-- Dumping data for table `relationship`
727
--
728

    
729
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
730
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
731

    
732
--
733
-- Table structure for table `reobservable`
734
--
735

    
736
/*!40101 SET @saved_cs_client     = @@character_set_client */;
737
/*!40101 SET character_set_client = utf8 */;
738
CREATE TABLE `reobservable` (
739
  `id` varbinary(767) NOT NULL,
740
  `current_determination` varbinary(767) DEFAULT NULL,
741
  `original_determination` varbinary(767) DEFAULT NULL,
742
  PRIMARY KEY (`id`),
743
  KEY `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination`),
744
  KEY `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination`),
745
  CONSTRAINT `fk_taxon_occurrence_event1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
746
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1` FOREIGN KEY (`original_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
747
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2` FOREIGN KEY (`current_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
748
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
749
/*!40101 SET character_set_client = @saved_cs_client */;
750

    
751
--
752
-- Dumping data for table `reobservable`
753
--
754

    
755
/*!40000 ALTER TABLE `reobservable` DISABLE KEYS */;
756
/*!40000 ALTER TABLE `reobservable` ENABLE KEYS */;
757

    
758
--
759
-- Table structure for table `reobservable_presence`
760
--
761

    
762
/*!40101 SET @saved_cs_client     = @@character_set_client */;
763
/*!40101 SET character_set_client = utf8 */;
764
CREATE TABLE `reobservable_presence` (
765
  `id` varbinary(767) NOT NULL,
766
  `voucher` varbinary(767) NOT NULL,
767
  PRIMARY KEY (`id`),
768
  KEY `fk_reobservable_presence_specimen1_idx` (`voucher`),
769
  CONSTRAINT `fk_reobservable_presence_reobservable1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
770
  CONSTRAINT `fk_reobservable_presence_specimen1` FOREIGN KEY (`voucher`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
771
  CONSTRAINT `fk_reobservable_presence_taxon_presence1` FOREIGN KEY (`id`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
772
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
773
/*!40101 SET character_set_client = @saved_cs_client */;
774

    
775
--
776
-- Dumping data for table `reobservable_presence`
777
--
778

    
779
/*!40000 ALTER TABLE `reobservable_presence` DISABLE KEYS */;
780
/*!40000 ALTER TABLE `reobservable_presence` ENABLE KEYS */;
781

    
782
--
783
-- Table structure for table `size_class`
784
--
785

    
786
/*!40101 SET @saved_cs_client     = @@character_set_client */;
787
/*!40101 SET character_set_client = utf8 */;
788
CREATE TABLE `size_class` (
789
  `id` varbinary(767) NOT NULL,
790
  `diameter_min_m` double NOT NULL,
791
  `diameter_max_m` double NOT NULL,
792
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
793
  PRIMARY KEY (`id`),
794
  CONSTRAINT `fk_layer_stratum10` FOREIGN KEY (`id`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
795
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
796
/*!40101 SET character_set_client = @saved_cs_client */;
797

    
798
--
799
-- Dumping data for table `size_class`
800
--
801

    
802
/*!40000 ALTER TABLE `size_class` DISABLE KEYS */;
803
/*!40000 ALTER TABLE `size_class` ENABLE KEYS */;
804

    
805
--
806
-- Table structure for table `soil_observation`
807
--
808

    
809
/*!40101 SET @saved_cs_client     = @@character_set_client */;
810
/*!40101 SET character_set_client = utf8 */;
811
CREATE TABLE `soil_observation` (
812
  `id` varbinary(767) NOT NULL,
813
  `place_observation` varbinary(767) NOT NULL,
814
  `measurement_spot` varbinary(767) DEFAULT NULL,
815
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
816
  PRIMARY KEY (`id`),
817
  KEY `fk_soil_observation_place_observation1_idx` (`place_observation`),
818
  KEY `fk_soil_observation_subplace1_idx` (`measurement_spot`),
819
  CONSTRAINT `fk_soil_observation_place_observation1` FOREIGN KEY (`place_observation`) REFERENCES `place_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
820
  CONSTRAINT `fk_soil_observation_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
821
  CONSTRAINT `fk_soil_observation_subplace1` FOREIGN KEY (`measurement_spot`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
822
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil';
823
/*!40101 SET character_set_client = @saved_cs_client */;
824

    
825
--
826
-- Dumping data for table `soil_observation`
827
--
828

    
829
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
830
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
831

    
832
--
833
-- Table structure for table `source`
834
--
835

    
836
/*!40101 SET @saved_cs_client     = @@character_set_client */;
837
/*!40101 SET character_set_client = utf8 */;
838
CREATE TABLE `source` (
839
  `id` varbinary(767) NOT NULL,
840
  `parent` varbinary(767) DEFAULT NULL,
841
  `name` varbinary(767) NOT NULL,
842
  `first_publisher` varbinary(767) DEFAULT NULL,
843
  `owner` varbinary(767) DEFAULT NULL,
844
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
845
  PRIMARY KEY (`id`),
846
  UNIQUE KEY `source_unique` (`parent`,`name`),
847
  KEY `fk_source1_idx` (`parent`),
848
  KEY `fk_source_party1_idx` (`owner`),
849
  KEY `fk_source_party2_idx` (`first_publisher`),
850
  CONSTRAINT `fk_source1` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
851
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`owner`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
852
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
853
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a "reference [...] cited within the database" ("VegBank":http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=reference&entity=dba_tabledescription&where=where_tablename)';
854
/*!40101 SET character_set_client = @saved_cs_client */;
855

    
856
--
857
-- Dumping data for table `source`
858
--
859

    
860
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
861
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
862

    
863
--
864
-- Table structure for table `specimen`
865
--
866

    
867
/*!40101 SET @saved_cs_client     = @@character_set_client */;
868
/*!40101 SET character_set_client = utf8 */;
869
CREATE TABLE `specimen` (
870
  `id` varbinary(767) NOT NULL,
871
  `individual` varbinary(767) DEFAULT NULL,
872
  `individual_observation` varbinary(767) DEFAULT NULL COMMENT 'stores observations about the plant the specimen was collected from. some specimens may not be traceable to a reobservable individual, but will still have these plant observations. the collection_event should be set to this field when provided.',
873
  `code_in_individual` varbinary(767) DEFAULT NULL COMMENT 'can also be within the individual_observation if no reobservable individual is available',
874
  `collection_event` varbinary(767) DEFAULT NULL,
875
  `orig_collection` varbinary(767) DEFAULT NULL,
876
  `barcode` varbinary(767) DEFAULT NULL,
877
  `accession_number` varbinary(767) DEFAULT NULL,
878
  `specimenholder_institutions` varbinary(767) DEFAULT NULL,
879
  `current_collection` varbinary(767) DEFAULT NULL,
880
  `owner_collection` varbinary(767) DEFAULT NULL,
881
  PRIMARY KEY (`id`),
882
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
883
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
884
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
885
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
886
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
887
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
888
  KEY `fk_specimen_individual1_idx` (`individual`),
889
  KEY `fk_specimen_collection2_idx` (`current_collection`),
890
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
891
  KEY `fk_specimen_party_list1_idx` (`specimenholder_institutions`),
892
  KEY `fk_specimen_individual_observation1_idx` (`individual_observation`),
893
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
894
  CONSTRAINT `fk_specimen_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
895
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
896
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
897
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
898
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
899
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
900
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
901
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a "part of a plant" ("Wikipedia":http://en.wikipedia.org/wiki/Specimen) which was collected from it. when there are multiple specimen replicates (copies) of a specimen, each gets its own specimen_observation pointing to the same specimen.';
902
/*!40101 SET character_set_client = @saved_cs_client */;
903

    
904
--
905
-- Dumping data for table `specimen`
906
--
907

    
908
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
909
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
910

    
911
--
912
-- Table structure for table `specimen_observation`
913
--
914

    
915
/*!40101 SET @saved_cs_client     = @@character_set_client */;
916
/*!40101 SET character_set_client = utf8 */;
917
CREATE TABLE `specimen_observation` (
918
  `id` varbinary(767) NOT NULL,
919
  `specimen` varbinary(767) NOT NULL,
920
  `description` varbinary(767) DEFAULT NULL,
921
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
922
  PRIMARY KEY (`id`),
923
  KEY `fk_specimen_observation_specimen1_idx` (`specimen`),
924
  CONSTRAINT `fk_specimen_observation_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
925
  CONSTRAINT `fk_specimen_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
926
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
927
/*!40101 SET character_set_client = @saved_cs_client */;
928

    
929
--
930
-- Dumping data for table `specimen_observation`
931
--
932

    
933
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
934
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
935

    
936
--
937
-- Table structure for table `stem`
938
--
939

    
940
/*!40101 SET @saved_cs_client     = @@character_set_client */;
941
/*!40101 SET character_set_client = utf8 */;
942
CREATE TABLE `stem` (
943
  `id` varbinary(767) NOT NULL,
944
  `individual` varbinary(767) DEFAULT NULL,
945
  PRIMARY KEY (`id`),
946
  KEY `fk_stem_individual1_idx` (`individual`),
947
  CONSTRAINT `fk_stem_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
948
  CONSTRAINT `fk_stem_individual2` FOREIGN KEY (`id`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
949
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An "individual tree stem" ("VegBank":http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemlocation&entity=dba_tabledescription&where=where_tablename)';
950
/*!40101 SET character_set_client = @saved_cs_client */;
951

    
952
--
953
-- Dumping data for table `stem`
954
--
955

    
956
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
957
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
958

    
959
--
960
-- Table structure for table `stem_observation`
961
--
962

    
963
/*!40101 SET @saved_cs_client     = @@character_set_client */;
964
/*!40101 SET character_set_client = utf8 */;
965
CREATE TABLE `stem_observation` (
966
  `id` varbinary(767) NOT NULL,
967
  `individual_observation` varbinary(767) DEFAULT NULL,
968
  `stem` varbinary(767) DEFAULT NULL,
969
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
970
  PRIMARY KEY (`id`),
971
  UNIQUE KEY `stem_observation_unique` (`individual_observation`,`stem`),
972
  KEY `fk_stem_observation_individual_observation1_idx` (`individual_observation`),
973
  KEY `fk_stem_observation_stem1_idx` (`stem`),
974
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
975
  CONSTRAINT `fk_stem_observation_individual_observation2` FOREIGN KEY (`id`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
976
  CONSTRAINT `fk_stem_observation_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
977
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]';
978
/*!40101 SET character_set_client = @saved_cs_client */;
979

    
980
--
981
-- Dumping data for table `stem_observation`
982
--
983

    
984
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
985
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
986

    
987
--
988
-- Table structure for table `stratum`
989
--
990

    
991
/*!40101 SET @saved_cs_client     = @@character_set_client */;
992
/*!40101 SET character_set_client = utf8 */;
993
CREATE TABLE `stratum` (
994
  `id` varbinary(767) NOT NULL,
995
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
996
  PRIMARY KEY (`id`),
997
  CONSTRAINT `fk_place_path_record10` FOREIGN KEY (`id`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
998
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratumType.VegBank.vegpath.org';
999
/*!40101 SET character_set_client = @saved_cs_client */;
1000

    
1001
--
1002
-- Dumping data for table `stratum`
1003
--
1004

    
1005
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
1006
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
1007

    
1008
--
1009
-- Table structure for table `stratum_event`
1010
--
1011

    
1012
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1013
/*!40101 SET character_set_client = utf8 */;
1014
CREATE TABLE `stratum_event` (
1015
  `id` varbinary(767) NOT NULL,
1016
  `parent_event` varbinary(767) NOT NULL,
1017
  `stratum` varbinary(767) NOT NULL,
1018
  PRIMARY KEY (`id`),
1019
  KEY `fk_stratum_event_stratum1_idx` (`stratum`),
1020
  KEY `fk_stratum_event_sampling_event2_idx` (`parent_event`),
1021
  CONSTRAINT `fk_stratum_event_sampling_event1` FOREIGN KEY (`id`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1022
  CONSTRAINT `fk_stratum_event_sampling_event2` FOREIGN KEY (`parent_event`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1023
  CONSTRAINT `fk_stratum_event_stratum1` FOREIGN KEY (`stratum`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1024
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratum.VegBank.vegpath.org (which was confusingly named)';
1025
/*!40101 SET character_set_client = @saved_cs_client */;
1026

    
1027
--
1028
-- Dumping data for table `stratum_event`
1029
--
1030

    
1031
/*!40000 ALTER TABLE `stratum_event` DISABLE KEYS */;
1032
/*!40000 ALTER TABLE `stratum_event` ENABLE KEYS */;
1033

    
1034
--
1035
-- Table structure for table `subplace`
1036
--
1037

    
1038
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1039
/*!40101 SET character_set_client = utf8 */;
1040
CREATE TABLE `subplace` (
1041
  `id` varbinary(767) NOT NULL,
1042
  `parent` varbinary(767) NOT NULL,
1043
  `x_m` double DEFAULT NULL,
1044
  `y_m` double DEFAULT NULL,
1045
  `coords` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1046
  PRIMARY KEY (`id`),
1047
  KEY `fk_rel_place_place1_idx` (`parent`),
1048
  CONSTRAINT `fk_rel_place_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1049
  CONSTRAINT `fk_subplot_place2` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1050
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores plot elements such as subplots ("subplot, line, or any other subsample  or subdivision of plot" ("SALVIAS":http://salvias.net/Documents/salvias_data_dictionary.html#Plot_data/subplot))';
1051
/*!40101 SET character_set_client = @saved_cs_client */;
1052

    
1053
--
1054
-- Dumping data for table `subplace`
1055
--
1056

    
1057
/*!40000 ALTER TABLE `subplace` DISABLE KEYS */;
1058
/*!40000 ALTER TABLE `subplace` ENABLE KEYS */;
1059

    
1060
--
1061
-- Table structure for table `subplot`
1062
--
1063

    
1064
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1065
/*!40101 SET character_set_client = utf8 */;
1066
CREATE TABLE `subplot` (
1067
  `id` varbinary(767) NOT NULL,
1068
  `parent_plot` varbinary(767) NOT NULL,
1069
  PRIMARY KEY (`id`),
1070
  KEY `fk_subplot_plot2_idx` (`parent_plot`),
1071
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1072
  CONSTRAINT `fk_subplot_plot2` FOREIGN KEY (`parent_plot`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1073
  CONSTRAINT `fk_subplot_rel_place1` FOREIGN KEY (`id`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1074
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1075
/*!40101 SET character_set_client = @saved_cs_client */;
1076

    
1077
--
1078
-- Dumping data for table `subplot`
1079
--
1080

    
1081
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
1082
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
1083

    
1084
--
1085
-- Table structure for table `taxa_sampling_event`
1086
--
1087

    
1088
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1089
/*!40101 SET character_set_client = utf8 */;
1090
CREATE TABLE `taxa_sampling_event` (
1091
  `id` varbinary(767) NOT NULL,
1092
  `within_place` varbinary(767) NOT NULL,
1093
  `method` varbinary(767) DEFAULT NULL,
1094
  PRIMARY KEY (`id`),
1095
  KEY `fk_sampling_event_method1_idx` (`method`),
1096
  KEY `fk_taxa_sampling_event_place1_idx` (`within_place`),
1097
  CONSTRAINT `fk_project_event10` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1098
  CONSTRAINT `fk_sampling_event_method1` FOREIGN KEY (`method`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1099
  CONSTRAINT `fk_taxa_sampling_event_place1` FOREIGN KEY (`within_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1100
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='for plots and aggregate_observations within them';
1101
/*!40101 SET character_set_client = @saved_cs_client */;
1102

    
1103
--
1104
-- Dumping data for table `taxa_sampling_event`
1105
--
1106

    
1107
/*!40000 ALTER TABLE `taxa_sampling_event` DISABLE KEYS */;
1108
/*!40000 ALTER TABLE `taxa_sampling_event` ENABLE KEYS */;
1109

    
1110
--
1111
-- Table structure for table `taxon_absence`
1112
--
1113

    
1114
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1115
/*!40101 SET character_set_client = utf8 */;
1116
CREATE TABLE `taxon_absence` (
1117
  `id` varbinary(767) NOT NULL,
1118
  PRIMARY KEY (`id`),
1119
  CONSTRAINT `fk_taxon_absence_taxa_sampling_event1` FOREIGN KEY (`id`) REFERENCES `aggregate_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1120
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place';
1121
/*!40101 SET character_set_client = @saved_cs_client */;
1122

    
1123
--
1124
-- Dumping data for table `taxon_absence`
1125
--
1126

    
1127
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
1128
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
1129

    
1130
--
1131
-- Table structure for table `taxon_assertion`
1132
--
1133

    
1134
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1135
/*!40101 SET character_set_client = utf8 */;
1136
CREATE TABLE `taxon_assertion` (
1137
  `id` varbinary(767) NOT NULL,
1138
  `string` varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
1139
  `taxon` varbinary(767) DEFAULT NULL,
1140
  `cf_aff` varbinary(767) DEFAULT NULL,
1141
  `annotations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1142
  PRIMARY KEY (`id`),
1143
  KEY `fk_taxon_assertion_taxon_string1_idx` (`string`),
1144
  KEY `fk_taxon_assertion_taxon_name1_idx` (`taxon`),
1145
  CONSTRAINT `fk_qualified_taxon_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1146
  CONSTRAINT `fk_taxon_assertion_taxon_name1` FOREIGN KEY (`taxon`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1147
  CONSTRAINT `fk_taxon_assertion_taxon_string1` FOREIGN KEY (`string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
1148
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1149
/*!40101 SET character_set_client = @saved_cs_client */;
1150

    
1151
--
1152
-- Dumping data for table `taxon_assertion`
1153
--
1154

    
1155
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
1156
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
1157

    
1158
--
1159
-- Table structure for table `taxon_concept`
1160
--
1161

    
1162
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1163
/*!40101 SET character_set_client = utf8 */;
1164
CREATE TABLE `taxon_concept` (
1165
  `id` varbinary(767) NOT NULL,
1166
  `according_to` varbinary(767) NOT NULL,
1167
  `parent` varbinary(767) DEFAULT NULL,
1168
  `accepted_taxon_concept` varbinary(767) DEFAULT NULL,
1169
  PRIMARY KEY (`id`),
1170
  UNIQUE KEY `taxon_concept_unique_name` (`according_to`),
1171
  KEY `fk_taxon_taxon1_idx` (`parent`),
1172
  KEY `fk_taxon_concept_source1_idx` (`according_to`),
1173
  KEY `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon_concept`),
1174
  CONSTRAINT `fk_taxon_concept_source1` FOREIGN KEY (`according_to`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1175
  CONSTRAINT `fk_taxon_concept_taxon_concept1` FOREIGN KEY (`accepted_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1176
  CONSTRAINT `fk_taxon_concept_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1177
  CONSTRAINT `fk_taxon_taxon1` FOREIGN KEY (`parent`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1178
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]';
1179
/*!40101 SET character_set_client = @saved_cs_client */;
1180

    
1181
--
1182
-- Dumping data for table `taxon_concept`
1183
--
1184

    
1185
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
1186
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
1187

    
1188
--
1189
-- Table structure for table `taxon_determination`
1190
--
1191

    
1192
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1193
/*!40101 SET character_set_client = utf8 */;
1194
CREATE TABLE `taxon_determination` (
1195
  `id` varbinary(767) NOT NULL,
1196
  `taxon_assertion` varbinary(767) NOT NULL,
1197
  `identified_by` varbinary(767) DEFAULT NULL,
1198
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1199
  PRIMARY KEY (`id`),
1200
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
1201
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
1202
  KEY `fk_taxon_determination_party_list1_idx` (`identified_by`),
1203
  CONSTRAINT `fk_taxon_determination_party_list1` FOREIGN KEY (`identified_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1204
  CONSTRAINT `fk_taxon_determination_taxon_observation1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1205
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1206
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
1207
/*!40101 SET character_set_client = @saved_cs_client */;
1208

    
1209
--
1210
-- Dumping data for table `taxon_determination`
1211
--
1212

    
1213
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
1214
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
1215

    
1216
--
1217
-- Table structure for table `taxon_name`
1218
--
1219

    
1220
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1221
/*!40101 SET character_set_client = utf8 */;
1222
CREATE TABLE `taxon_name` (
1223
  `id` varbinary(767) NOT NULL,
1224
  `unique_name` varbinary(767) NOT NULL,
1225
  `formal_name` varbinary(767) DEFAULT NULL,
1226
  `taxon_name` varbinary(767) DEFAULT NULL,
1227
  `author` varbinary(767) DEFAULT NULL,
1228
  `common_name` varbinary(767) DEFAULT NULL,
1229
  `rank` varbinary(767) DEFAULT NULL,
1230
  `taxon_path` varbinary(767) DEFAULT NULL,
1231
  PRIMARY KEY (`id`),
1232
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
1233
  KEY `fk_taxon_name_taxon_path1_idx` (`taxon_path`),
1234
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
1235
  CONSTRAINT `fk_taxon_name_taxon_path1` FOREIGN KEY (`taxon_path`) REFERENCES `taxon_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1236
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1237
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1238
/*!40101 SET character_set_client = @saved_cs_client */;
1239

    
1240
--
1241
-- Dumping data for table `taxon_name`
1242
--
1243

    
1244
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
1245
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
1246

    
1247
--
1248
-- Table structure for table `taxon_observation`
1249
--
1250

    
1251
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1252
/*!40101 SET character_set_client = utf8 */;
1253
CREATE TABLE `taxon_observation` (
1254
  `id` varbinary(767) NOT NULL,
1255
  `observation_in_parent_place` varbinary(767) DEFAULT NULL COMMENT 'points to the observation of the same taxon/individual in the parent place; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID',
1256
  `collectors` varbinary(767) DEFAULT NULL,
1257
  `collector_number` varbinary(767) DEFAULT NULL,
1258
  `growth_form` varbinary(767) DEFAULT NULL,
1259
  `cultivated` tinyint(1) DEFAULT NULL,
1260
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1261
  PRIMARY KEY (`id`),
1262
  KEY `fk_taxon_observation_party_list1_idx` (`collectors`),
1263
  KEY `fk_taxon_observation_taxon_observation1_idx` (`observation_in_parent_place`),
1264
  CONSTRAINT `fk_taxon_observation_party_list1` FOREIGN KEY (`collectors`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1265
  CONSTRAINT `fk_taxon_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1266
  CONSTRAINT `fk_taxon_observation_taxon_observation1` FOREIGN KEY (`observation_in_parent_place`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1267
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1268
/*!40101 SET character_set_client = @saved_cs_client */;
1269

    
1270
--
1271
-- Dumping data for table `taxon_observation`
1272
--
1273

    
1274
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1275
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1276

    
1277
--
1278
-- Table structure for table `taxon_path`
1279
--
1280

    
1281
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1282
/*!40101 SET character_set_client = utf8 */;
1283
CREATE TABLE `taxon_path` (
1284
  `id` varbinary(767) NOT NULL,
1285
  `family` varbinary(767) DEFAULT NULL,
1286
  `genus` varbinary(767) DEFAULT NULL,
1287
  `specific_epithet` varbinary(767) DEFAULT NULL,
1288
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1289
  PRIMARY KEY (`id`)
1290
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"a group of one (or more) populations of organism(s), which a taxonomist adjudges to be a unit" ("Wikipedia":http://en.wikipedia.org/wiki/Taxon)';
1291
/*!40101 SET character_set_client = @saved_cs_client */;
1292

    
1293
--
1294
-- Dumping data for table `taxon_path`
1295
--
1296

    
1297
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1298
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1299

    
1300
--
1301
-- Table structure for table `taxon_presence`
1302
--
1303

    
1304
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1305
/*!40101 SET character_set_client = utf8 */;
1306
CREATE TABLE `taxon_presence` (
1307
  `id` varbinary(767) NOT NULL,
1308
  `cover_percent` double DEFAULT NULL,
1309
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1310
  PRIMARY KEY (`id`),
1311
  CONSTRAINT `fk_taxon_presence_taxon_determination1` FOREIGN KEY (`id`) REFERENCES `aggregate_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1312
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= aggregateOrganismObservation.VegX.vegpath.org, taxonImportance.VegBank.vegpath.org; "An observation applying to all occurrences of an organism" ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/aggregateOrganismObservations/aggregateOrganismObservation).';
1313
/*!40101 SET character_set_client = @saved_cs_client */;
1314

    
1315
--
1316
-- Dumping data for table `taxon_presence`
1317
--
1318

    
1319
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1320
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1321

    
1322
--
1323
-- Table structure for table `taxon_scrub`
1324
--
1325

    
1326
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1327
/*!40101 SET character_set_client = utf8 */;
1328
CREATE TABLE `taxon_scrub` (
1329
  `id` varbinary(767) NOT NULL,
1330
  `input_string` varbinary(767) NOT NULL,
1331
  `parsed_taxon_assertion` varbinary(767) NOT NULL,
1332
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
1333
  `match_score` float DEFAULT NULL,
1334
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1335
  PRIMARY KEY (`id`),
1336
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
1337
  KEY `fk_taxon_scrub_taxon_assertion1_idx` (`parsed_taxon_assertion`),
1338
  KEY `fk_taxon_scrub_taxon_string1_idx` (`input_string`),
1339
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1340
  CONSTRAINT `fk_taxon_scrub_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1341
  CONSTRAINT `fk_taxon_scrub_taxon_assertion1` FOREIGN KEY (`parsed_taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1342
  CONSTRAINT `fk_taxon_scrub_taxon_string1` FOREIGN KEY (`input_string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
1343
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1344
/*!40101 SET character_set_client = @saved_cs_client */;
1345

    
1346
--
1347
-- Dumping data for table `taxon_scrub`
1348
--
1349

    
1350
/*!40000 ALTER TABLE `taxon_scrub` DISABLE KEYS */;
1351
/*!40000 ALTER TABLE `taxon_scrub` ENABLE KEYS */;
1352

    
1353
--
1354
-- Table structure for table `taxon_string`
1355
--
1356

    
1357
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1358
/*!40101 SET character_set_client = utf8 */;
1359
CREATE TABLE `taxon_string` (
1360
  `string` varbinary(767) NOT NULL,
1361
  PRIMARY KEY (`string`)
1362
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='to get the parsed_taxon_assertion (TNRS result) for a taxon_string, join using taxon_string.string<-taxon_assertion(string)::parsed_taxon_assertion[source=''TNRS.version''] (see wiki.vegpath.org/SQL_dotpaths)';
1363
/*!40101 SET character_set_client = @saved_cs_client */;
1364

    
1365
--
1366
-- Dumping data for table `taxon_string`
1367
--
1368

    
1369
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1370
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1371
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1372

    
1373
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1374
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1375
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1376
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1377
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1378
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1379
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1380

    
1381
-- Dump completed
(9-9/15)