Project

General

Profile

1
-- MySQL dump 10.13  Distrib 5.5.31, for debian-linux-gnu (x86_64)
2
--
3
-- Host: localhost    Database: VegCore
4
-- ------------------------------------------------------
5
-- Server version	5.5.31-0ubuntu0.12.04.2
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
-- Table structure for table `aggregate_observation`
20
--
21

    
22
/*!40101 SET @saved_cs_client     = @@character_set_client */;
23
/*!40101 SET character_set_client = utf8 */;
24
CREATE TABLE `aggregate_observation` (
25
  `id` varbinary(767) NOT NULL,
26
  `taxon_concept` varbinary(767) NOT NULL,
27
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
28
  PRIMARY KEY (`id`),
29
  KEY `fk_aggregate_observation_taxon_name1_idx` (`taxon_concept`),
30
  CONSTRAINT `fk_aggregate_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
31
  CONSTRAINT `fk_aggregate_observation_taxon_name1` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
32
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"An observation applying to all occurrences of an organism based on an aggregation factor" ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/aggregateOrganismObservations/aggregateOrganismObservation)';
33
/*!40101 SET character_set_client = @saved_cs_client */;
34

    
35
--
36
-- Dumping data for table `aggregate_observation`
37
--
38

    
39
/*!40000 ALTER TABLE `aggregate_observation` DISABLE KEYS */;
40
/*!40000 ALTER TABLE `aggregate_observation` ENABLE KEYS */;
41

    
42
--
43
-- Table structure for table `base_class`
44
--
45

    
46
/*!40101 SET @saved_cs_client     = @@character_set_client */;
47
/*!40101 SET character_set_client = utf8 */;
48
CREATE TABLE `base_class` (
49
  `id` varbinary(767) NOT NULL,
50
  `referenced_class` varbinary(767) NOT NULL,
51
  PRIMARY KEY (`id`),
52
  KEY `fk_base_class_referenced_class1_idx` (`referenced_class`),
53
  CONSTRAINT `fk_base_class_referenced_class1` FOREIGN KEY (`referenced_class`) REFERENCES `referenced_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
54
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
55
/*!40101 SET character_set_client = @saved_cs_client */;
56

    
57
--
58
-- Dumping data for table `base_class`
59
--
60

    
61
/*!40000 ALTER TABLE `base_class` DISABLE KEYS */;
62
/*!40000 ALTER TABLE `base_class` ENABLE KEYS */;
63

    
64
--
65
-- Table structure for table `collection`
66
--
67

    
68
/*!40101 SET @saved_cs_client     = @@character_set_client */;
69
/*!40101 SET character_set_client = utf8 */;
70
CREATE TABLE `collection` (
71
  `id` varbinary(767) NOT NULL,
72
  `institution` varbinary(767) NOT NULL,
73
  `name` varbinary(767) NOT NULL,
74
  PRIMARY KEY (`id`),
75
  UNIQUE KEY `collection_unique` (`institution`,`name`),
76
  KEY `fk_collection_organization1_idx` (`institution`),
77
  KEY `fk_collection_source1_idx` (`id`),
78
  CONSTRAINT `fk_collection_source1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
79
  CONSTRAINT `fk_collection_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
80
) 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)';
81
/*!40101 SET character_set_client = @saved_cs_client */;
82

    
83
--
84
-- Dumping data for table `collection`
85
--
86

    
87
/*!40000 ALTER TABLE `collection` DISABLE KEYS */;
88
/*!40000 ALTER TABLE `collection` ENABLE KEYS */;
89

    
90
--
91
-- Table structure for table `community`
92
--
93

    
94
/*!40101 SET @saved_cs_client     = @@character_set_client */;
95
/*!40101 SET character_set_client = utf8 */;
96
CREATE TABLE `community` (
97
  `id` varbinary(767) NOT NULL,
98
  `name` varbinary(767) NOT NULL,
99
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
100
  PRIMARY KEY (`id`),
101
  CONSTRAINT `fk_community_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
102
) 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]])';
103
/*!40101 SET character_set_client = @saved_cs_client */;
104

    
105
--
106
-- Dumping data for table `community`
107
--
108

    
109
/*!40000 ALTER TABLE `community` DISABLE KEYS */;
110
/*!40000 ALTER TABLE `community` ENABLE KEYS */;
111

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

    
116
/*!40101 SET @saved_cs_client     = @@character_set_client */;
117
/*!40101 SET character_set_client = utf8 */;
118
CREATE TABLE `coordinates` (
119
  `id` varbinary(767) NOT NULL,
120
  `latitude_deg` varbinary(767) DEFAULT NULL,
121
  `longitude_deg` varbinary(767) DEFAULT NULL,
122
  PRIMARY KEY (`id`)
123
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point';
124
/*!40101 SET character_set_client = @saved_cs_client */;
125

    
126
--
127
-- Dumping data for table `coordinates`
128
--
129

    
130
/*!40000 ALTER TABLE `coordinates` DISABLE KEYS */;
131
/*!40000 ALTER TABLE `coordinates` ENABLE KEYS */;
132

    
133
--
134
-- Table structure for table `derived_class`
135
--
136

    
137
/*!40101 SET @saved_cs_client     = @@character_set_client */;
138
/*!40101 SET character_set_client = utf8 */;
139
CREATE TABLE `derived_class` (
140
  `id` varbinary(767) NOT NULL,
141
  PRIMARY KEY (`id`),
142
  CONSTRAINT `fk_derived_class_base_class1` FOREIGN KEY (`id`) REFERENCES `base_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
143
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
144
/*!40101 SET character_set_client = @saved_cs_client */;
145

    
146
--
147
-- Dumping data for table `derived_class`
148
--
149

    
150
/*!40000 ALTER TABLE `derived_class` DISABLE KEYS */;
151
/*!40000 ALTER TABLE `derived_class` ENABLE KEYS */;
152

    
153
--
154
-- Table structure for table `event`
155
--
156

    
157
/*!40101 SET @saved_cs_client     = @@character_set_client */;
158
/*!40101 SET character_set_client = utf8 */;
159
CREATE TABLE `event` (
160
  `id` varbinary(767) NOT NULL,
161
  `parent` varbinary(767) NOT NULL,
162
  `name` varbinary(767) DEFAULT NULL,
163
  `date_range` varbinary(767) DEFAULT NULL,
164
  `place` varbinary(767) DEFAULT NULL,
165
  `method` varbinary(767) DEFAULT NULL,
166
  PRIMARY KEY (`id`),
167
  KEY `fk_event_place1_idx` (`place`),
168
  KEY `fk_event1_idx` (`parent`),
169
  KEY `fk_event_method1_idx` (`method`),
170
  CONSTRAINT `fk_event_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
171
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
172
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
173
  CONSTRAINT `fk_event_method1` FOREIGN KEY (`method`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
174
) 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)';
175
/*!40101 SET character_set_client = @saved_cs_client */;
176

    
177
--
178
-- Dumping data for table `event`
179
--
180

    
181
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
182
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
183

    
184
--
185
-- Table structure for table `event_participant`
186
--
187

    
188
/*!40101 SET @saved_cs_client     = @@character_set_client */;
189
/*!40101 SET character_set_client = utf8 */;
190
CREATE TABLE `event_participant` (
191
  `event` varbinary(767) NOT NULL,
192
  `party` varbinary(767) NOT NULL,
193
  `sort_order` int(11) DEFAULT NULL,
194
  PRIMARY KEY (`event`,`party`),
195
  KEY `fk_event_has_party_party1_idx` (`party`),
196
  KEY `fk_event_has_party_event1_idx` (`event`),
197
  CONSTRAINT `fk_event_has_party_event1` FOREIGN KEY (`event`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
198
  CONSTRAINT `fk_event_has_party_party1` FOREIGN KEY (`party`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
199
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
200
/*!40101 SET character_set_client = @saved_cs_client */;
201

    
202
--
203
-- Dumping data for table `event_participant`
204
--
205

    
206
/*!40000 ALTER TABLE `event_participant` DISABLE KEYS */;
207
/*!40000 ALTER TABLE `event_participant` ENABLE KEYS */;
208

    
209
--
210
-- Table structure for table `geological_context`
211
--
212

    
213
/*!40101 SET @saved_cs_client     = @@character_set_client */;
214
/*!40101 SET character_set_client = utf8 */;
215
CREATE TABLE `geological_context` (
216
  `id` varbinary(767) NOT NULL,
217
  `name` varbinary(767) NOT NULL,
218
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
219
  PRIMARY KEY (`id`),
220
  CONSTRAINT `fk_geological_context_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
221
) 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)';
222
/*!40101 SET character_set_client = @saved_cs_client */;
223

    
224
--
225
-- Dumping data for table `geological_context`
226
--
227

    
228
/*!40000 ALTER TABLE `geological_context` DISABLE KEYS */;
229
/*!40000 ALTER TABLE `geological_context` ENABLE KEYS */;
230

    
231
--
232
-- Table structure for table `geovalidation`
233
--
234

    
235
/*!40101 SET @saved_cs_client     = @@character_set_client */;
236
/*!40101 SET character_set_client = utf8 */;
237
CREATE TABLE `geovalidation` (
238
  `id` varbinary(767) NOT NULL,
239
  `geovalid` tinyint(1) NOT NULL,
240
  `lat_long_domain_valid` tinyint(1) NOT NULL,
241
  `lat_long_in_place_ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
242
  PRIMARY KEY (`id`),
243
  CONSTRAINT `fk_geovalidation_validatable_place1` FOREIGN KEY (`id`) REFERENCES `validatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
244
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
245
/*!40101 SET character_set_client = @saved_cs_client */;
246

    
247
--
248
-- Dumping data for table `geovalidation`
249
--
250

    
251
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
252
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
253

    
254
--
255
-- Table structure for table `individual`
256
--
257

    
258
/*!40101 SET @saved_cs_client     = @@character_set_client */;
259
/*!40101 SET character_set_client = utf8 */;
260
CREATE TABLE `individual` (
261
  `id` varbinary(767) NOT NULL,
262
  `tag` varbinary(767) DEFAULT NULL,
263
  `tag_history` set('hstore') COLLATE utf8_bin DEFAULT NULL,
264
  PRIMARY KEY (`id`),
265
  CONSTRAINT `fk_individual_record1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
266
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism';
267
/*!40101 SET character_set_client = @saved_cs_client */;
268

    
269
--
270
-- Dumping data for table `individual`
271
--
272

    
273
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
274
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
275

    
276
--
277
-- Table structure for table `individual_observation`
278
--
279

    
280
/*!40101 SET @saved_cs_client     = @@character_set_client */;
281
/*!40101 SET character_set_client = utf8 */;
282
CREATE TABLE `individual_observation` (
283
  `id` varbinary(767) NOT NULL,
284
  `individual` varbinary(767) DEFAULT NULL,
285
  `code` varbinary(767) DEFAULT NULL,
286
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
287
  PRIMARY KEY (`id`),
288
  KEY `fk_individual_observation_individual1_idx` (`individual`),
289
  CONSTRAINT `fk_individual_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
290
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
291
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]';
292
/*!40101 SET character_set_client = @saved_cs_client */;
293

    
294
--
295
-- Dumping data for table `individual_observation`
296
--
297

    
298
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
299
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
300

    
301
--
302
-- Table structure for table `method`
303
--
304

    
305
/*!40101 SET @saved_cs_client     = @@character_set_client */;
306
/*!40101 SET character_set_client = utf8 */;
307
CREATE TABLE `method` (
308
  `id` varbinary(767) NOT NULL,
309
  `parent` varbinary(767) NOT NULL,
310
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
311
  PRIMARY KEY (`id`),
312
  KEY `fk_method_method1_idx` (`parent`),
313
  CONSTRAINT `fk_method_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
314
  CONSTRAINT `fk_method_method1` FOREIGN KEY (`parent`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
315
) 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)';
316
/*!40101 SET character_set_client = @saved_cs_client */;
317

    
318
--
319
-- Dumping data for table `method`
320
--
321

    
322
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
323
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
324

    
325
--
326
-- Table structure for table `organization`
327
--
328

    
329
/*!40101 SET @saved_cs_client     = @@character_set_client */;
330
/*!40101 SET character_set_client = utf8 */;
331
CREATE TABLE `organization` (
332
  `id` varbinary(767) NOT NULL,
333
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
334
  PRIMARY KEY (`id`),
335
  CONSTRAINT `fk_organization_party1` FOREIGN KEY (`id`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
336
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
337
/*!40101 SET character_set_client = @saved_cs_client */;
338

    
339
--
340
-- Dumping data for table `organization`
341
--
342

    
343
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
344
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
345

    
346
--
347
-- Table structure for table `parsed_taxon_assertion`
348
--
349

    
350
/*!40101 SET @saved_cs_client     = @@character_set_client */;
351
/*!40101 SET character_set_client = utf8 */;
352
CREATE TABLE `parsed_taxon_assertion` (
353
  `id` varbinary(767) NOT NULL,
354
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
355
  `match_score` float DEFAULT NULL,
356
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
357
  PRIMARY KEY (`id`),
358
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
359
  CONSTRAINT `fk_matched_taxon_qualified_taxon10` FOREIGN KEY (`id`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
360
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
361
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
362
/*!40101 SET character_set_client = @saved_cs_client */;
363

    
364
--
365
-- Dumping data for table `parsed_taxon_assertion`
366
--
367

    
368
/*!40000 ALTER TABLE `parsed_taxon_assertion` DISABLE KEYS */;
369
/*!40000 ALTER TABLE `parsed_taxon_assertion` ENABLE KEYS */;
370

    
371
--
372
-- Table structure for table `party`
373
--
374

    
375
/*!40101 SET @saved_cs_client     = @@character_set_client */;
376
/*!40101 SET character_set_client = utf8 */;
377
CREATE TABLE `party` (
378
  `id` varbinary(767) NOT NULL,
379
  `organization` varbinary(767) DEFAULT NULL,
380
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
381
  PRIMARY KEY (`id`),
382
  KEY `fk_party_organization1_idx` (`organization`),
383
  CONSTRAINT `fk_collection_source10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
384
  CONSTRAINT `fk_party_organization1` FOREIGN KEY (`organization`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
385
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
386
/*!40101 SET character_set_client = @saved_cs_client */;
387

    
388
--
389
-- Dumping data for table `party`
390
--
391

    
392
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
393
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
394

    
395
--
396
-- Table structure for table `place`
397
--
398

    
399
/*!40101 SET @saved_cs_client     = @@character_set_client */;
400
/*!40101 SET character_set_client = utf8 */;
401
CREATE TABLE `place` (
402
  `id` varbinary(767) NOT NULL,
403
  `parent` varbinary(767) NOT NULL,
404
  `coordinates` varbinary(767) DEFAULT NULL,
405
  `path` varbinary(767) DEFAULT NULL,
406
  `locality` varbinary(767) DEFAULT NULL,
407
  PRIMARY KEY (`id`),
408
  KEY `fk_place_coordinates1_idx` (`coordinates`),
409
  KEY `fk_place1_idx` (`parent`),
410
  KEY `fk_place_place_path1_idx` (`path`),
411
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
412
  CONSTRAINT `fk_place_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
413
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
414
  CONSTRAINT `fk_place_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
415
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
416
/*!40101 SET character_set_client = @saved_cs_client */;
417

    
418
--
419
-- Dumping data for table `place`
420
--
421

    
422
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
423
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
424

    
425
--
426
-- Table structure for table `place_observation`
427
--
428

    
429
/*!40101 SET @saved_cs_client     = @@character_set_client */;
430
/*!40101 SET character_set_client = utf8 */;
431
CREATE TABLE `place_observation` (
432
  `id` varbinary(767) NOT NULL,
433
  `place` varbinary(767) NOT NULL,
434
  `elevation_m` double DEFAULT NULL,
435
  `slope_incline_deg` double DEFAULT NULL,
436
  `slope_direction_deg_N` double DEFAULT NULL,
437
  `geological_context` varbinary(767) DEFAULT NULL,
438
  `community` varbinary(767) DEFAULT NULL,
439
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
440
  PRIMARY KEY (`id`),
441
  KEY `fk_place_observation_place1_idx` (`place`),
442
  KEY `fk_place_observation_geological_context1_idx` (`geological_context`),
443
  KEY `fk_place_observation_community1_idx` (`community`),
444
  KEY `fk_place_observation_event1_idx` (`id`),
445
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
446
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
447
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
448
  CONSTRAINT `fk_place_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
449
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
450
/*!40101 SET character_set_client = @saved_cs_client */;
451

    
452
--
453
-- Dumping data for table `place_observation`
454
--
455

    
456
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
457
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
458

    
459
--
460
-- Table structure for table `place_path`
461
--
462

    
463
/*!40101 SET @saved_cs_client     = @@character_set_client */;
464
/*!40101 SET character_set_client = utf8 */;
465
CREATE TABLE `place_path` (
466
  `id` varbinary(767) NOT NULL,
467
  `continent` varbinary(767) DEFAULT NULL,
468
  `country` varbinary(767) DEFAULT NULL,
469
  `state_province` varbinary(767) DEFAULT NULL,
470
  `county` varbinary(767) DEFAULT NULL,
471
  `municipality` varbinary(767) DEFAULT NULL,
472
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
473
  PRIMARY KEY (`id`)
474
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
475
/*!40101 SET character_set_client = @saved_cs_client */;
476

    
477
--
478
-- Dumping data for table `place_path`
479
--
480

    
481
/*!40000 ALTER TABLE `place_path` DISABLE KEYS */;
482
/*!40000 ALTER TABLE `place_path` ENABLE KEYS */;
483

    
484
--
485
-- Table structure for table `plot`
486
--
487

    
488
/*!40101 SET @saved_cs_client     = @@character_set_client */;
489
/*!40101 SET character_set_client = utf8 */;
490
CREATE TABLE `plot` (
491
  `id` varbinary(767) NOT NULL,
492
  `name` varbinary(767) DEFAULT NULL,
493
  `area_m2` double DEFAULT NULL,
494
  `bounding_box` varbinary(767) DEFAULT NULL,
495
  PRIMARY KEY (`id`),
496
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
497
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
498
/*!40101 SET character_set_client = @saved_cs_client */;
499

    
500
--
501
-- Dumping data for table `plot`
502
--
503

    
504
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
505
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
506

    
507
--
508
-- Table structure for table `project`
509
--
510

    
511
/*!40101 SET @saved_cs_client     = @@character_set_client */;
512
/*!40101 SET character_set_client = utf8 */;
513
CREATE TABLE `project` (
514
  `id` varbinary(767) NOT NULL,
515
  `name` varbinary(767) NOT NULL,
516
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
517
  PRIMARY KEY (`id`),
518
  CONSTRAINT `fk_project_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
519
) 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)';
520
/*!40101 SET character_set_client = @saved_cs_client */;
521

    
522
--
523
-- Dumping data for table `project`
524
--
525

    
526
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
527
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
528

    
529
--
530
-- Table structure for table `record`
531
--
532

    
533
/*!40101 SET @saved_cs_client     = @@character_set_client */;
534
/*!40101 SET character_set_client = utf8 */;
535
CREATE TABLE `record` (
536
  `id` varbinary(767) NOT NULL,
537
  `source` varbinary(767) NOT NULL,
538
  `source_id_scope` varbinary(767) DEFAULT NULL,
539
  `source_record_id` varbinary(767) DEFAULT NULL,
540
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
541
  PRIMARY KEY (`id`),
542
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
543
  KEY `fk_record_source1_idx` (`source`),
544
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
545
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
546
/*!40101 SET character_set_client = @saved_cs_client */;
547

    
548
--
549
-- Dumping data for table `record`
550
--
551

    
552
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
553
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
554

    
555
--
556
-- Table structure for table `referenced_class`
557
--
558

    
559
/*!40101 SET @saved_cs_client     = @@character_set_client */;
560
/*!40101 SET character_set_client = utf8 */;
561
CREATE TABLE `referenced_class` (
562
  `id` varbinary(767) NOT NULL,
563
  PRIMARY KEY (`id`),
564
  CONSTRAINT `fk_example_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
565
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
566
/*!40101 SET character_set_client = @saved_cs_client */;
567

    
568
--
569
-- Dumping data for table `referenced_class`
570
--
571

    
572
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
573
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
574

    
575
--
576
-- Table structure for table `relationship`
577
--
578

    
579
/*!40101 SET @saved_cs_client     = @@character_set_client */;
580
/*!40101 SET character_set_client = utf8 */;
581
CREATE TABLE `relationship` (
582
  `id` varbinary(767) NOT NULL,
583
  `record` varbinary(767) NOT NULL,
584
  `related_record` varbinary(767) NOT NULL,
585
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
586
  PRIMARY KEY (`id`),
587
  KEY `fk_relationship_record1_idx` (`record`),
588
  KEY `fk_relationship_related_record_idx` (`related_record`),
589
  CONSTRAINT `fk_relationship_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
590
  CONSTRAINT `fk_relationship_record2` FOREIGN KEY (`record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
591
  CONSTRAINT `fk_relationship_related_record` FOREIGN KEY (`related_record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
592
) 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)';
593
/*!40101 SET character_set_client = @saved_cs_client */;
594

    
595
--
596
-- Dumping data for table `relationship`
597
--
598

    
599
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
600
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
601

    
602
--
603
-- Table structure for table `soil_observation`
604
--
605

    
606
/*!40101 SET @saved_cs_client     = @@character_set_client */;
607
/*!40101 SET character_set_client = utf8 */;
608
CREATE TABLE `soil_observation` (
609
  `id` varbinary(767) NOT NULL,
610
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
611
  PRIMARY KEY (`id`),
612
  CONSTRAINT `fk_soil_observation_place_observation1` FOREIGN KEY (`id`) REFERENCES `place_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
613
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil';
614
/*!40101 SET character_set_client = @saved_cs_client */;
615

    
616
--
617
-- Dumping data for table `soil_observation`
618
--
619

    
620
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
621
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
622

    
623
--
624
-- Table structure for table `source`
625
--
626

    
627
/*!40101 SET @saved_cs_client     = @@character_set_client */;
628
/*!40101 SET character_set_client = utf8 */;
629
CREATE TABLE `source` (
630
  `id` varbinary(767) NOT NULL,
631
  `parent` varbinary(767) NOT NULL,
632
  `name` varbinary(767) NOT NULL,
633
  `first_publisher` varbinary(767) DEFAULT NULL,
634
  `owner` varbinary(767) DEFAULT NULL,
635
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
636
  PRIMARY KEY (`id`),
637
  UNIQUE KEY `source_unique` (`parent`,`name`),
638
  KEY `fk_source1_idx` (`parent`),
639
  KEY `fk_source_party1_idx` (`owner`),
640
  KEY `fk_source_party2_idx` (`first_publisher`),
641
  CONSTRAINT `fk_source1` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
642
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`owner`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
643
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
644
) 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)';
645
/*!40101 SET character_set_client = @saved_cs_client */;
646

    
647
--
648
-- Dumping data for table `source`
649
--
650

    
651
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
652
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
653

    
654
--
655
-- Table structure for table `specimen`
656
--
657

    
658
/*!40101 SET @saved_cs_client     = @@character_set_client */;
659
/*!40101 SET character_set_client = utf8 */;
660
CREATE TABLE `specimen` (
661
  `id` varbinary(767) NOT NULL,
662
  `individual` varbinary(767) DEFAULT NULL,
663
  `code_in_individual` varbinary(767) DEFAULT NULL,
664
  `collection_event` varbinary(767) DEFAULT NULL,
665
  `orig_collection` varbinary(767) DEFAULT NULL,
666
  `barcode` varbinary(767) DEFAULT NULL,
667
  `accession_number` varbinary(767) DEFAULT NULL,
668
  `current_collection` varbinary(767) DEFAULT NULL,
669
  `owner_collection` varbinary(767) DEFAULT NULL,
670
  PRIMARY KEY (`id`),
671
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
672
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
673
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
674
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
675
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
676
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
677
  KEY `fk_specimen_individual1_idx` (`individual`),
678
  KEY `fk_specimen_collection2_idx` (`current_collection`),
679
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
680
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
681
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
682
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
683
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
684
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
685
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
686
) 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';
687
/*!40101 SET character_set_client = @saved_cs_client */;
688

    
689
--
690
-- Dumping data for table `specimen`
691
--
692

    
693
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
694
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
695

    
696
--
697
-- Table structure for table `specimen_observation`
698
--
699

    
700
/*!40101 SET @saved_cs_client     = @@character_set_client */;
701
/*!40101 SET character_set_client = utf8 */;
702
CREATE TABLE `specimen_observation` (
703
  `id` varbinary(767) NOT NULL,
704
  `specimen` varbinary(767) NOT NULL,
705
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
706
  PRIMARY KEY (`id`),
707
  KEY `fk_specimen_observation_specimen1_idx` (`specimen`),
708
  CONSTRAINT `fk_specimen_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
709
  CONSTRAINT `fk_specimen_observation_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
710
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
711
/*!40101 SET character_set_client = @saved_cs_client */;
712

    
713
--
714
-- Dumping data for table `specimen_observation`
715
--
716

    
717
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
718
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
719

    
720
--
721
-- Table structure for table `specimenholder_institution`
722
--
723

    
724
/*!40101 SET @saved_cs_client     = @@character_set_client */;
725
/*!40101 SET character_set_client = utf8 */;
726
CREATE TABLE `specimenholder_institution` (
727
  `specimen` varbinary(767) NOT NULL,
728
  `institution` varbinary(767) NOT NULL,
729
  `sort_order` int(11) DEFAULT NULL,
730
  PRIMARY KEY (`specimen`,`institution`),
731
  KEY `fk_specimen_has_organization_organization1_idx` (`institution`),
732
  KEY `fk_specimen_has_organization_specimen1_idx` (`specimen`),
733
  CONSTRAINT `fk_specimen_has_organization_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
734
  CONSTRAINT `fk_specimen_has_organization_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
735
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
736
/*!40101 SET character_set_client = @saved_cs_client */;
737

    
738
--
739
-- Dumping data for table `specimenholder_institution`
740
--
741

    
742
/*!40000 ALTER TABLE `specimenholder_institution` DISABLE KEYS */;
743
/*!40000 ALTER TABLE `specimenholder_institution` ENABLE KEYS */;
744

    
745
--
746
-- Table structure for table `stem`
747
--
748

    
749
/*!40101 SET @saved_cs_client     = @@character_set_client */;
750
/*!40101 SET character_set_client = utf8 */;
751
CREATE TABLE `stem` (
752
  `id` varbinary(767) NOT NULL,
753
  `individual` varbinary(767) NOT NULL,
754
  PRIMARY KEY (`id`),
755
  KEY `fk_stem_individual1_idx` (`individual`),
756
  CONSTRAINT `fk_stem_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
757
  CONSTRAINT `fk_stem_individual2` FOREIGN KEY (`id`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
758
) 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)';
759
/*!40101 SET character_set_client = @saved_cs_client */;
760

    
761
--
762
-- Dumping data for table `stem`
763
--
764

    
765
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
766
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
767

    
768
--
769
-- Table structure for table `stem_observation`
770
--
771

    
772
/*!40101 SET @saved_cs_client     = @@character_set_client */;
773
/*!40101 SET character_set_client = utf8 */;
774
CREATE TABLE `stem_observation` (
775
  `id` varbinary(767) NOT NULL,
776
  `individual_observation` varbinary(767) NOT NULL,
777
  `stem` varbinary(767) DEFAULT NULL,
778
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
779
  PRIMARY KEY (`id`),
780
  UNIQUE KEY `stem_observation_unique` (`individual_observation`,`stem`),
781
  KEY `fk_stem_observation_individual_observation1_idx` (`individual_observation`),
782
  KEY `fk_stem_observation_stem1_idx` (`stem`),
783
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
784
  CONSTRAINT `fk_stem_observation_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
785
  CONSTRAINT `fk_stem_observation_individual_observation2` FOREIGN KEY (`id`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
786
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]';
787
/*!40101 SET character_set_client = @saved_cs_client */;
788

    
789
--
790
-- Dumping data for table `stem_observation`
791
--
792

    
793
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
794
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
795

    
796
--
797
-- Table structure for table `stratum`
798
--
799

    
800
/*!40101 SET @saved_cs_client     = @@character_set_client */;
801
/*!40101 SET character_set_client = utf8 */;
802
CREATE TABLE `stratum` (
803
  `id` varbinary(767) NOT NULL,
804
  `name` varbinary(767) NOT NULL,
805
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
806
  PRIMARY KEY (`id`),
807
  CONSTRAINT `fk_place_path_record10` FOREIGN KEY (`id`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
808
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
809
/*!40101 SET character_set_client = @saved_cs_client */;
810

    
811
--
812
-- Dumping data for table `stratum`
813
--
814

    
815
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
816
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
817

    
818
--
819
-- Table structure for table `subplot`
820
--
821

    
822
/*!40101 SET @saved_cs_client     = @@character_set_client */;
823
/*!40101 SET character_set_client = utf8 */;
824
CREATE TABLE `subplot` (
825
  `id` varbinary(767) NOT NULL,
826
  `x_m` double DEFAULT NULL,
827
  `y_m` double DEFAULT NULL,
828
  PRIMARY KEY (`id`),
829
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
830
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"subplot, line, or any other subsample  or subdivision of plot" ("SALVIAS":http://salvias.net/Documents/salvias_data_dictionary.html#Plot_data/subplot)';
831
/*!40101 SET character_set_client = @saved_cs_client */;
832

    
833
--
834
-- Dumping data for table `subplot`
835
--
836

    
837
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
838
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
839

    
840
--
841
-- Table structure for table `taxon_assertion`
842
--
843

    
844
/*!40101 SET @saved_cs_client     = @@character_set_client */;
845
/*!40101 SET character_set_client = utf8 */;
846
CREATE TABLE `taxon_assertion` (
847
  `id` varbinary(767) NOT NULL,
848
  `string` varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
849
  `taxon` varbinary(767) DEFAULT NULL,
850
  `cf_aff` varbinary(767) DEFAULT NULL,
851
  `annotations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
852
  PRIMARY KEY (`id`),
853
  KEY `fk_taxon_assertion_taxon_string1_idx` (`string`),
854
  KEY `fk_taxon_assertion_taxon_name1_idx` (`taxon`),
855
  CONSTRAINT `fk_qualified_taxon_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
856
  CONSTRAINT `fk_taxon_assertion_taxon_string1` FOREIGN KEY (`string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
857
  CONSTRAINT `fk_taxon_assertion_taxon_name1` FOREIGN KEY (`taxon`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
858
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
859
/*!40101 SET character_set_client = @saved_cs_client */;
860

    
861
--
862
-- Dumping data for table `taxon_assertion`
863
--
864

    
865
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
866
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
867

    
868
--
869
-- Table structure for table `taxon_concept`
870
--
871

    
872
/*!40101 SET @saved_cs_client     = @@character_set_client */;
873
/*!40101 SET character_set_client = utf8 */;
874
CREATE TABLE `taxon_concept` (
875
  `id` varbinary(767) NOT NULL,
876
  `according_to` varbinary(767) NOT NULL,
877
  `parent` varbinary(767) NOT NULL,
878
  `accepted_taxon_concept` varbinary(767) DEFAULT NULL,
879
  PRIMARY KEY (`id`),
880
  UNIQUE KEY `taxon_concept_unique_name` (`according_to`),
881
  KEY `fk_taxon_taxon1_idx` (`parent`),
882
  KEY `fk_taxon_concept_source1_idx` (`according_to`),
883
  KEY `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon_concept`),
884
  CONSTRAINT `fk_taxon_taxon1` FOREIGN KEY (`parent`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
885
  CONSTRAINT `fk_taxon_concept_source1` FOREIGN KEY (`according_to`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
886
  CONSTRAINT `fk_taxon_concept_taxon_concept1` FOREIGN KEY (`accepted_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
887
  CONSTRAINT `fk_taxon_concept_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
888
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]';
889
/*!40101 SET character_set_client = @saved_cs_client */;
890

    
891
--
892
-- Dumping data for table `taxon_concept`
893
--
894

    
895
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
896
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
897

    
898
--
899
-- Table structure for table `taxon_determination`
900
--
901

    
902
/*!40101 SET @saved_cs_client     = @@character_set_client */;
903
/*!40101 SET character_set_client = utf8 */;
904
CREATE TABLE `taxon_determination` (
905
  `id` varbinary(767) NOT NULL,
906
  `taxon_assertion` varbinary(767) NOT NULL,
907
  `identified_by` varbinary(767) DEFAULT NULL,
908
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
909
  PRIMARY KEY (`id`),
910
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
911
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
912
  KEY `fk_taxon_determination_party1_idx` (`identified_by`),
913
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
914
  CONSTRAINT `fk_taxon_determination_record1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
915
  CONSTRAINT `fk_taxon_determination_party1` FOREIGN KEY (`identified_by`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
916
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
917
/*!40101 SET character_set_client = @saved_cs_client */;
918

    
919
--
920
-- Dumping data for table `taxon_determination`
921
--
922

    
923
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
924
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
925

    
926
--
927
-- Table structure for table `taxon_name`
928
--
929

    
930
/*!40101 SET @saved_cs_client     = @@character_set_client */;
931
/*!40101 SET character_set_client = utf8 */;
932
CREATE TABLE `taxon_name` (
933
  `id` varbinary(767) NOT NULL,
934
  `unique_name` varbinary(767) NOT NULL,
935
  `formal_name` varbinary(767) DEFAULT NULL,
936
  `taxon_name` varbinary(767) DEFAULT NULL,
937
  `author` varbinary(767) DEFAULT NULL,
938
  `common_name` varbinary(767) DEFAULT NULL,
939
  `rank` varbinary(767) DEFAULT NULL,
940
  PRIMARY KEY (`id`),
941
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
942
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
943
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
944
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
945
/*!40101 SET character_set_client = @saved_cs_client */;
946

    
947
--
948
-- Dumping data for table `taxon_name`
949
--
950

    
951
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
952
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
953

    
954
--
955
-- Table structure for table `taxon_observation`
956
--
957

    
958
/*!40101 SET @saved_cs_client     = @@character_set_client */;
959
/*!40101 SET character_set_client = utf8 */;
960
CREATE TABLE `taxon_observation` (
961
  `id` varbinary(767) NOT NULL,
962
  `taxon_occurrence` varbinary(767) NOT NULL,
963
  `collector` varbinary(767) DEFAULT NULL,
964
  `collector_number` varbinary(767) DEFAULT NULL,
965
  `voucher` varbinary(767) DEFAULT NULL,
966
  `growth_form` varbinary(767) DEFAULT NULL,
967
  `cultivated` tinyint(1) DEFAULT NULL,
968
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
969
  PRIMARY KEY (`id`),
970
  KEY `fk_taxon_observation_taxon_occurrence2_idx` (`taxon_occurrence`),
971
  KEY `fk_taxon_observation_specimen1_idx` (`voucher`),
972
  KEY `fk_taxon_observation_party1_idx` (`collector`),
973
  CONSTRAINT `fk_taxon_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
974
  CONSTRAINT `fk_taxon_observation_taxon_occurrence2` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
975
  CONSTRAINT `fk_taxon_observation_specimen1` FOREIGN KEY (`voucher`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
976
  CONSTRAINT `fk_taxon_observation_party1` FOREIGN KEY (`collector`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
977
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
978
/*!40101 SET character_set_client = @saved_cs_client */;
979

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

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

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

    
991
/*!40101 SET @saved_cs_client     = @@character_set_client */;
992
/*!40101 SET character_set_client = utf8 */;
993
CREATE TABLE `taxon_occurrence` (
994
  `id` varbinary(767) NOT NULL,
995
  `current_determination` varbinary(767) DEFAULT NULL,
996
  `original_determination` varbinary(767) DEFAULT NULL,
997
  PRIMARY KEY (`id`),
998
  KEY `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination`),
999
  KEY `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination`),
1000
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1` FOREIGN KEY (`original_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1001
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2` FOREIGN KEY (`current_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1002
  CONSTRAINT `fk_taxon_occurrence_event1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1003
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
1004
/*!40101 SET character_set_client = @saved_cs_client */;
1005

    
1006
--
1007
-- Dumping data for table `taxon_occurrence`
1008
--
1009

    
1010
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1011
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1012

    
1013
--
1014
-- Table structure for table `taxon_path`
1015
--
1016

    
1017
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1018
/*!40101 SET character_set_client = utf8 */;
1019
CREATE TABLE `taxon_path` (
1020
  `id` varbinary(767) NOT NULL,
1021
  `family` varbinary(767) DEFAULT NULL,
1022
  `genus` varbinary(767) DEFAULT NULL,
1023
  `specific_epithet` varbinary(767) DEFAULT NULL,
1024
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1025
  PRIMARY KEY (`id`),
1026
  CONSTRAINT `fk_taxon_path_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1027
) 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)';
1028
/*!40101 SET character_set_client = @saved_cs_client */;
1029

    
1030
--
1031
-- Dumping data for table `taxon_path`
1032
--
1033

    
1034
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1035
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1036

    
1037
--
1038
-- Table structure for table `taxon_presence`
1039
--
1040

    
1041
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1042
/*!40101 SET character_set_client = utf8 */;
1043
CREATE TABLE `taxon_presence` (
1044
  `id` varbinary(767) NOT NULL,
1045
  `taxon_concept` varbinary(767) NOT NULL,
1046
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1047
  PRIMARY KEY (`id`),
1048
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
1049
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1050
  CONSTRAINT `fk_taxon_presence_taxon_name1` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1051
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_';
1052
/*!40101 SET character_set_client = @saved_cs_client */;
1053

    
1054
--
1055
-- Dumping data for table `taxon_presence`
1056
--
1057

    
1058
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1059
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1060

    
1061
--
1062
-- Table structure for table `taxon_string`
1063
--
1064

    
1065
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1066
/*!40101 SET character_set_client = utf8 */;
1067
CREATE TABLE `taxon_string` (
1068
  `string` varbinary(767) NOT NULL,
1069
  PRIMARY KEY (`string`)
1070
) 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)';
1071
/*!40101 SET character_set_client = @saved_cs_client */;
1072

    
1073
--
1074
-- Dumping data for table `taxon_string`
1075
--
1076

    
1077
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1078
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1079

    
1080
--
1081
-- Table structure for table `validatable_place`
1082
--
1083

    
1084
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1085
/*!40101 SET character_set_client = utf8 */;
1086
CREATE TABLE `validatable_place` (
1087
  `id` varbinary(767) NOT NULL,
1088
  `coordinates` varbinary(767) NOT NULL,
1089
  `path` varbinary(767) NOT NULL,
1090
  PRIMARY KEY (`id`),
1091
  UNIQUE KEY `validatable_place_unique` (`path`,`coordinates`),
1092
  KEY `fk_geovalidation_place_path1_idx` (`path`),
1093
  KEY `fk_geovalidation_coordinates1_idx` (`coordinates`),
1094
  CONSTRAINT `fk_geovalidation_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1095
  CONSTRAINT `fk_geovalidation_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1096
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1097
/*!40101 SET character_set_client = @saved_cs_client */;
1098

    
1099
--
1100
-- Dumping data for table `validatable_place`
1101
--
1102

    
1103
/*!40000 ALTER TABLE `validatable_place` DISABLE KEYS */;
1104
/*!40000 ALTER TABLE `validatable_place` ENABLE KEYS */;
1105
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1106

    
1107
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1108
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1109
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1110
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1111
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1112
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1113
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1114

    
1115
-- Dump completed
(8-8/14)