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
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
27
  PRIMARY KEY (`id`),
28
  CONSTRAINT `fk_aggregate_observation_taxon_presence1` FOREIGN KEY (`id`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
29
) 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)';
30
/*!40101 SET character_set_client = @saved_cs_client */;
31

    
32
--
33
-- Dumping data for table `aggregate_observation`
34
--
35

    
36
/*!40000 ALTER TABLE `aggregate_observation` DISABLE KEYS */;
37
/*!40000 ALTER TABLE `aggregate_observation` ENABLE KEYS */;
38

    
39
--
40
-- Table structure for table `base_class`
41
--
42

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

    
54
--
55
-- Dumping data for table `base_class`
56
--
57

    
58
/*!40000 ALTER TABLE `base_class` DISABLE KEYS */;
59
/*!40000 ALTER TABLE `base_class` ENABLE KEYS */;
60

    
61
--
62
-- Table structure for table `collection`
63
--
64

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

    
80
--
81
-- Dumping data for table `collection`
82
--
83

    
84
/*!40000 ALTER TABLE `collection` DISABLE KEYS */;
85
/*!40000 ALTER TABLE `collection` ENABLE KEYS */;
86

    
87
--
88
-- Table structure for table `community`
89
--
90

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

    
102
--
103
-- Dumping data for table `community`
104
--
105

    
106
/*!40000 ALTER TABLE `community` DISABLE KEYS */;
107
/*!40000 ALTER TABLE `community` ENABLE KEYS */;
108

    
109
--
110
-- Table structure for table `coordinates`
111
--
112

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

    
123
--
124
-- Dumping data for table `coordinates`
125
--
126

    
127
/*!40000 ALTER TABLE `coordinates` DISABLE KEYS */;
128
/*!40000 ALTER TABLE `coordinates` ENABLE KEYS */;
129

    
130
--
131
-- Table structure for table `derived_class`
132
--
133

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

    
143
--
144
-- Dumping data for table `derived_class`
145
--
146

    
147
/*!40000 ALTER TABLE `derived_class` DISABLE KEYS */;
148
/*!40000 ALTER TABLE `derived_class` ENABLE KEYS */;
149

    
150
--
151
-- Table structure for table `event`
152
--
153

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

    
174
--
175
-- Dumping data for table `event`
176
--
177

    
178
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
179
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
180

    
181
--
182
-- Table structure for table `geological_context`
183
--
184

    
185
/*!40101 SET @saved_cs_client     = @@character_set_client */;
186
/*!40101 SET character_set_client = utf8 */;
187
CREATE TABLE `geological_context` (
188
  `id` varbinary(767) NOT NULL,
189
  `name` varbinary(767) NOT NULL,
190
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
191
  PRIMARY KEY (`id`),
192
  CONSTRAINT `fk_geological_context_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
193
) 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)';
194
/*!40101 SET character_set_client = @saved_cs_client */;
195

    
196
--
197
-- Dumping data for table `geological_context`
198
--
199

    
200
/*!40000 ALTER TABLE `geological_context` DISABLE KEYS */;
201
/*!40000 ALTER TABLE `geological_context` ENABLE KEYS */;
202

    
203
--
204
-- Table structure for table `geovalidation`
205
--
206

    
207
/*!40101 SET @saved_cs_client     = @@character_set_client */;
208
/*!40101 SET character_set_client = utf8 */;
209
CREATE TABLE `geovalidation` (
210
  `id` varbinary(767) NOT NULL,
211
  `geovalid` tinyint(1) NOT NULL,
212
  `lat_long_domain_valid` tinyint(1) NOT NULL,
213
  `lat_long_in_place_ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
214
  PRIMARY KEY (`id`),
215
  CONSTRAINT `fk_geovalidation_validatable_place1` FOREIGN KEY (`id`) REFERENCES `validatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
216
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
217
/*!40101 SET character_set_client = @saved_cs_client */;
218

    
219
--
220
-- Dumping data for table `geovalidation`
221
--
222

    
223
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
224
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
225

    
226
--
227
-- Table structure for table `individual`
228
--
229

    
230
/*!40101 SET @saved_cs_client     = @@character_set_client */;
231
/*!40101 SET character_set_client = utf8 */;
232
CREATE TABLE `individual` (
233
  `id` varbinary(767) NOT NULL,
234
  `tag` varbinary(767) DEFAULT NULL,
235
  `tag_history` set('hstore') COLLATE utf8_bin DEFAULT NULL,
236
  PRIMARY KEY (`id`),
237
  CONSTRAINT `fk_individual_record1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
238
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism';
239
/*!40101 SET character_set_client = @saved_cs_client */;
240

    
241
--
242
-- Dumping data for table `individual`
243
--
244

    
245
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
246
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
247

    
248
--
249
-- Table structure for table `individual_observation`
250
--
251

    
252
/*!40101 SET @saved_cs_client     = @@character_set_client */;
253
/*!40101 SET character_set_client = utf8 */;
254
CREATE TABLE `individual_observation` (
255
  `id` varbinary(767) NOT NULL,
256
  `individual` varbinary(767) DEFAULT NULL,
257
  `code` varbinary(767) DEFAULT NULL,
258
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
259
  PRIMARY KEY (`id`),
260
  KEY `fk_individual_observation_individual1_idx` (`individual`),
261
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
262
  CONSTRAINT `fk_individual_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
263
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]';
264
/*!40101 SET character_set_client = @saved_cs_client */;
265

    
266
--
267
-- Dumping data for table `individual_observation`
268
--
269

    
270
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
271
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
272

    
273
--
274
-- Table structure for table `method`
275
--
276

    
277
/*!40101 SET @saved_cs_client     = @@character_set_client */;
278
/*!40101 SET character_set_client = utf8 */;
279
CREATE TABLE `method` (
280
  `id` varbinary(767) NOT NULL,
281
  `parent` varbinary(767) NOT NULL,
282
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
283
  PRIMARY KEY (`id`),
284
  KEY `fk_method_method1_idx` (`parent`),
285
  CONSTRAINT `fk_method_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
286
  CONSTRAINT `fk_method_method1` FOREIGN KEY (`parent`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
287
) 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)';
288
/*!40101 SET character_set_client = @saved_cs_client */;
289

    
290
--
291
-- Dumping data for table `method`
292
--
293

    
294
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
295
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
296

    
297
--
298
-- Table structure for table `organization`
299
--
300

    
301
/*!40101 SET @saved_cs_client     = @@character_set_client */;
302
/*!40101 SET character_set_client = utf8 */;
303
CREATE TABLE `organization` (
304
  `id` varbinary(767) NOT NULL,
305
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
306
  PRIMARY KEY (`id`),
307
  CONSTRAINT `fk_organization_party1` FOREIGN KEY (`id`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
308
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
309
/*!40101 SET character_set_client = @saved_cs_client */;
310

    
311
--
312
-- Dumping data for table `organization`
313
--
314

    
315
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
316
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
317

    
318
--
319
-- Table structure for table `parsed_taxon_assertion`
320
--
321

    
322
/*!40101 SET @saved_cs_client     = @@character_set_client */;
323
/*!40101 SET character_set_client = utf8 */;
324
CREATE TABLE `parsed_taxon_assertion` (
325
  `id` varbinary(767) NOT NULL,
326
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
327
  `match_score` float DEFAULT NULL,
328
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
329
  PRIMARY KEY (`id`),
330
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
331
  CONSTRAINT `fk_matched_taxon_qualified_taxon10` FOREIGN KEY (`id`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
332
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
333
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
334
/*!40101 SET character_set_client = @saved_cs_client */;
335

    
336
--
337
-- Dumping data for table `parsed_taxon_assertion`
338
--
339

    
340
/*!40000 ALTER TABLE `parsed_taxon_assertion` DISABLE KEYS */;
341
/*!40000 ALTER TABLE `parsed_taxon_assertion` ENABLE KEYS */;
342

    
343
--
344
-- Table structure for table `party`
345
--
346

    
347
/*!40101 SET @saved_cs_client     = @@character_set_client */;
348
/*!40101 SET character_set_client = utf8 */;
349
CREATE TABLE `party` (
350
  `id` varbinary(767) NOT NULL,
351
  `organization` varbinary(767) DEFAULT NULL,
352
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
353
  PRIMARY KEY (`id`),
354
  KEY `fk_party_organization1_idx` (`organization`),
355
  CONSTRAINT `fk_party_organization1` FOREIGN KEY (`organization`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
356
  CONSTRAINT `fk_collection_source10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
357
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
358
/*!40101 SET character_set_client = @saved_cs_client */;
359

    
360
--
361
-- Dumping data for table `party`
362
--
363

    
364
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
365
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
366

    
367
--
368
-- Table structure for table `party_list`
369
--
370

    
371
/*!40101 SET @saved_cs_client     = @@character_set_client */;
372
/*!40101 SET character_set_client = utf8 */;
373
CREATE TABLE `party_list` (
374
  `id` varbinary(767) NOT NULL,
375
  `count` int(11) NOT NULL,
376
  PRIMARY KEY (`id`),
377
  CONSTRAINT `fk_collection_source100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
378
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
379
/*!40101 SET character_set_client = @saved_cs_client */;
380

    
381
--
382
-- Dumping data for table `party_list`
383
--
384

    
385
/*!40000 ALTER TABLE `party_list` DISABLE KEYS */;
386
/*!40000 ALTER TABLE `party_list` ENABLE KEYS */;
387

    
388
--
389
-- Table structure for table `party_list_entry`
390
--
391

    
392
/*!40101 SET @saved_cs_client     = @@character_set_client */;
393
/*!40101 SET character_set_client = utf8 */;
394
CREATE TABLE `party_list_entry` (
395
  `id` varbinary(767) NOT NULL,
396
  `entry` varbinary(767) NOT NULL,
397
  `sort_order` int(11) DEFAULT NULL,
398
  PRIMARY KEY (`id`,`entry`),
399
  KEY `fk_party_list_has_party_party1_idx` (`entry`),
400
  KEY `fk_party_list_has_party_party_list1_idx` (`id`),
401
  CONSTRAINT `fk_party_list_has_party_party_list1` FOREIGN KEY (`id`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
402
  CONSTRAINT `fk_party_list_has_party_party1` FOREIGN KEY (`entry`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
403
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
404
/*!40101 SET character_set_client = @saved_cs_client */;
405

    
406
--
407
-- Dumping data for table `party_list_entry`
408
--
409

    
410
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
411
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
412

    
413
--
414
-- Table structure for table `place`
415
--
416

    
417
/*!40101 SET @saved_cs_client     = @@character_set_client */;
418
/*!40101 SET character_set_client = utf8 */;
419
CREATE TABLE `place` (
420
  `id` varbinary(767) NOT NULL,
421
  `parent` varbinary(767) NOT NULL,
422
  `coordinates` varbinary(767) DEFAULT NULL,
423
  `path` varbinary(767) DEFAULT NULL,
424
  `locality` varbinary(767) DEFAULT NULL,
425
  PRIMARY KEY (`id`),
426
  KEY `fk_place_coordinates1_idx` (`coordinates`),
427
  KEY `fk_place1_idx` (`parent`),
428
  KEY `fk_place_place_path1_idx` (`path`),
429
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
430
  CONSTRAINT `fk_place_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
431
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
432
  CONSTRAINT `fk_place_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
433
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
434
/*!40101 SET character_set_client = @saved_cs_client */;
435

    
436
--
437
-- Dumping data for table `place`
438
--
439

    
440
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
441
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
442

    
443
--
444
-- Table structure for table `place_observation`
445
--
446

    
447
/*!40101 SET @saved_cs_client     = @@character_set_client */;
448
/*!40101 SET character_set_client = utf8 */;
449
CREATE TABLE `place_observation` (
450
  `id` varbinary(767) NOT NULL,
451
  `place` varbinary(767) NOT NULL,
452
  `elevation_m` double DEFAULT NULL,
453
  `slope_incline_deg` double DEFAULT NULL,
454
  `slope_direction_deg_N` double DEFAULT NULL,
455
  `geological_context` varbinary(767) DEFAULT NULL,
456
  `community` varbinary(767) DEFAULT NULL,
457
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
458
  PRIMARY KEY (`id`),
459
  KEY `fk_place_observation_place1_idx` (`place`),
460
  KEY `fk_place_observation_geological_context1_idx` (`geological_context`),
461
  KEY `fk_place_observation_community1_idx` (`community`),
462
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
463
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
464
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
465
  CONSTRAINT `fk_place_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
466
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
467
/*!40101 SET character_set_client = @saved_cs_client */;
468

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

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

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

    
480
/*!40101 SET @saved_cs_client     = @@character_set_client */;
481
/*!40101 SET character_set_client = utf8 */;
482
CREATE TABLE `place_path` (
483
  `id` varbinary(767) NOT NULL,
484
  `continent` varbinary(767) DEFAULT NULL,
485
  `country` varbinary(767) DEFAULT NULL,
486
  `state_province` varbinary(767) DEFAULT NULL,
487
  `county` varbinary(767) DEFAULT NULL,
488
  `municipality` varbinary(767) DEFAULT NULL,
489
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
490
  PRIMARY KEY (`id`)
491
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
492
/*!40101 SET character_set_client = @saved_cs_client */;
493

    
494
--
495
-- Dumping data for table `place_path`
496
--
497

    
498
/*!40000 ALTER TABLE `place_path` DISABLE KEYS */;
499
/*!40000 ALTER TABLE `place_path` ENABLE KEYS */;
500

    
501
--
502
-- Table structure for table `plot`
503
--
504

    
505
/*!40101 SET @saved_cs_client     = @@character_set_client */;
506
/*!40101 SET character_set_client = utf8 */;
507
CREATE TABLE `plot` (
508
  `id` varbinary(767) NOT NULL,
509
  `name` varbinary(767) DEFAULT NULL,
510
  `area_m2` double DEFAULT NULL,
511
  `shape` varbinary(767) DEFAULT NULL,
512
  `bounding_box_rect` varbinary(767) DEFAULT NULL,
513
  `footprint_geom_WKT` varbinary(767) DEFAULT NULL,
514
  `dimensions` set('hstore') COLLATE utf8_bin DEFAULT NULL,
515
  PRIMARY KEY (`id`),
516
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
517
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
518
/*!40101 SET character_set_client = @saved_cs_client */;
519

    
520
--
521
-- Dumping data for table `plot`
522
--
523

    
524
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
525
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
526

    
527
--
528
-- Table structure for table `project`
529
--
530

    
531
/*!40101 SET @saved_cs_client     = @@character_set_client */;
532
/*!40101 SET character_set_client = utf8 */;
533
CREATE TABLE `project` (
534
  `id` varbinary(767) NOT NULL,
535
  `name` varbinary(767) NOT NULL,
536
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
537
  PRIMARY KEY (`id`),
538
  CONSTRAINT `fk_project_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
539
) 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)';
540
/*!40101 SET character_set_client = @saved_cs_client */;
541

    
542
--
543
-- Dumping data for table `project`
544
--
545

    
546
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
547
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
548

    
549
--
550
-- Table structure for table `record`
551
--
552

    
553
/*!40101 SET @saved_cs_client     = @@character_set_client */;
554
/*!40101 SET character_set_client = utf8 */;
555
CREATE TABLE `record` (
556
  `id` varbinary(767) NOT NULL,
557
  `source` varbinary(767) NOT NULL,
558
  `source_id_scope` varbinary(767) DEFAULT NULL,
559
  `source_record_id` varbinary(767) DEFAULT NULL,
560
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
561
  PRIMARY KEY (`id`),
562
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
563
  KEY `fk_record_source1_idx` (`source`),
564
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`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 `record`
570
--
571

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

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

    
579
/*!40101 SET @saved_cs_client     = @@character_set_client */;
580
/*!40101 SET character_set_client = utf8 */;
581
CREATE TABLE `referenced_class` (
582
  `id` varbinary(767) NOT NULL,
583
  PRIMARY KEY (`id`),
584
  CONSTRAINT `fk_example_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
585
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
586
/*!40101 SET character_set_client = @saved_cs_client */;
587

    
588
--
589
-- Dumping data for table `referenced_class`
590
--
591

    
592
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
593
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
594

    
595
--
596
-- Table structure for table `relationship`
597
--
598

    
599
/*!40101 SET @saved_cs_client     = @@character_set_client */;
600
/*!40101 SET character_set_client = utf8 */;
601
CREATE TABLE `relationship` (
602
  `id` varbinary(767) NOT NULL,
603
  `record` varbinary(767) NOT NULL,
604
  `related_record` varbinary(767) NOT NULL,
605
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
606
  PRIMARY KEY (`id`),
607
  KEY `fk_relationship_record1_idx` (`record`),
608
  KEY `fk_relationship_related_record_idx` (`related_record`),
609
  CONSTRAINT `fk_relationship_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
610
  CONSTRAINT `fk_relationship_record2` FOREIGN KEY (`record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
611
  CONSTRAINT `fk_relationship_related_record` FOREIGN KEY (`related_record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
612
) 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)';
613
/*!40101 SET character_set_client = @saved_cs_client */;
614

    
615
--
616
-- Dumping data for table `relationship`
617
--
618

    
619
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
620
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
621

    
622
--
623
-- Table structure for table `sampling_event`
624
--
625

    
626
/*!40101 SET @saved_cs_client     = @@character_set_client */;
627
/*!40101 SET character_set_client = utf8 */;
628
CREATE TABLE `sampling_event` (
629
  `id` varbinary(767) NOT NULL,
630
  `method` varbinary(767) DEFAULT NULL,
631
  PRIMARY KEY (`id`),
632
  KEY `fk_sampling_event_method1_idx` (`method`),
633
  CONSTRAINT `fk_sampling_event_method1` FOREIGN KEY (`method`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
634
  CONSTRAINT `fk_project_event10` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
635
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
636
/*!40101 SET character_set_client = @saved_cs_client */;
637

    
638
--
639
-- Dumping data for table `sampling_event`
640
--
641

    
642
/*!40000 ALTER TABLE `sampling_event` DISABLE KEYS */;
643
/*!40000 ALTER TABLE `sampling_event` ENABLE KEYS */;
644

    
645
--
646
-- Table structure for table `soil_observation`
647
--
648

    
649
/*!40101 SET @saved_cs_client     = @@character_set_client */;
650
/*!40101 SET character_set_client = utf8 */;
651
CREATE TABLE `soil_observation` (
652
  `id` varbinary(767) NOT NULL,
653
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
654
  PRIMARY KEY (`id`),
655
  CONSTRAINT `fk_soil_observation_place_observation1` FOREIGN KEY (`id`) REFERENCES `place_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
656
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil';
657
/*!40101 SET character_set_client = @saved_cs_client */;
658

    
659
--
660
-- Dumping data for table `soil_observation`
661
--
662

    
663
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
664
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
665

    
666
--
667
-- Table structure for table `source`
668
--
669

    
670
/*!40101 SET @saved_cs_client     = @@character_set_client */;
671
/*!40101 SET character_set_client = utf8 */;
672
CREATE TABLE `source` (
673
  `id` varbinary(767) NOT NULL,
674
  `parent` varbinary(767) NOT NULL,
675
  `name` varbinary(767) NOT NULL,
676
  `first_publisher` varbinary(767) DEFAULT NULL,
677
  `owner` varbinary(767) DEFAULT NULL,
678
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
679
  PRIMARY KEY (`id`),
680
  UNIQUE KEY `source_unique` (`parent`,`name`),
681
  KEY `fk_source1_idx` (`parent`),
682
  KEY `fk_source_party1_idx` (`owner`),
683
  KEY `fk_source_party2_idx` (`first_publisher`),
684
  CONSTRAINT `fk_source1` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
685
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`owner`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
686
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
687
) 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)';
688
/*!40101 SET character_set_client = @saved_cs_client */;
689

    
690
--
691
-- Dumping data for table `source`
692
--
693

    
694
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
695
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
696

    
697
--
698
-- Table structure for table `specimen`
699
--
700

    
701
/*!40101 SET @saved_cs_client     = @@character_set_client */;
702
/*!40101 SET character_set_client = utf8 */;
703
CREATE TABLE `specimen` (
704
  `id` varbinary(767) NOT NULL,
705
  `individual` varbinary(767) DEFAULT NULL,
706
  `code_in_individual` varbinary(767) DEFAULT NULL,
707
  `collection_event` varbinary(767) DEFAULT NULL,
708
  `orig_collection` varbinary(767) DEFAULT NULL,
709
  `barcode` varbinary(767) DEFAULT NULL,
710
  `accession_number` varbinary(767) DEFAULT NULL,
711
  `specimenholder_institutions` varbinary(767) DEFAULT NULL,
712
  `current_collection` varbinary(767) DEFAULT NULL,
713
  `owner_collection` varbinary(767) DEFAULT NULL,
714
  PRIMARY KEY (`id`),
715
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
716
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
717
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
718
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
719
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
720
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
721
  KEY `fk_specimen_individual1_idx` (`individual`),
722
  KEY `fk_specimen_collection2_idx` (`current_collection`),
723
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
724
  KEY `fk_specimen_party_list1_idx` (`specimenholder_institutions`),
725
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
726
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
727
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
728
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
729
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
730
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
731
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
732
) 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';
733
/*!40101 SET character_set_client = @saved_cs_client */;
734

    
735
--
736
-- Dumping data for table `specimen`
737
--
738

    
739
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
740
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
741

    
742
--
743
-- Table structure for table `specimen_observation`
744
--
745

    
746
/*!40101 SET @saved_cs_client     = @@character_set_client */;
747
/*!40101 SET character_set_client = utf8 */;
748
CREATE TABLE `specimen_observation` (
749
  `id` varbinary(767) NOT NULL,
750
  `specimen` varbinary(767) NOT NULL,
751
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
752
  PRIMARY KEY (`id`),
753
  KEY `fk_specimen_observation_specimen1_idx` (`specimen`),
754
  CONSTRAINT `fk_specimen_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
755
  CONSTRAINT `fk_specimen_observation_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
756
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
757
/*!40101 SET character_set_client = @saved_cs_client */;
758

    
759
--
760
-- Dumping data for table `specimen_observation`
761
--
762

    
763
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
764
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
765

    
766
--
767
-- Table structure for table `stem`
768
--
769

    
770
/*!40101 SET @saved_cs_client     = @@character_set_client */;
771
/*!40101 SET character_set_client = utf8 */;
772
CREATE TABLE `stem` (
773
  `id` varbinary(767) NOT NULL,
774
  `individual` varbinary(767) NOT NULL,
775
  PRIMARY KEY (`id`),
776
  KEY `fk_stem_individual1_idx` (`individual`),
777
  CONSTRAINT `fk_stem_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
778
  CONSTRAINT `fk_stem_individual2` FOREIGN KEY (`id`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
779
) 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)';
780
/*!40101 SET character_set_client = @saved_cs_client */;
781

    
782
--
783
-- Dumping data for table `stem`
784
--
785

    
786
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
787
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
788

    
789
--
790
-- Table structure for table `stem_observation`
791
--
792

    
793
/*!40101 SET @saved_cs_client     = @@character_set_client */;
794
/*!40101 SET character_set_client = utf8 */;
795
CREATE TABLE `stem_observation` (
796
  `id` varbinary(767) NOT NULL,
797
  `individual_observation` varbinary(767) NOT NULL,
798
  `stem` varbinary(767) DEFAULT NULL,
799
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
800
  PRIMARY KEY (`id`),
801
  UNIQUE KEY `stem_observation_unique` (`individual_observation`,`stem`),
802
  KEY `fk_stem_observation_individual_observation1_idx` (`individual_observation`),
803
  KEY `fk_stem_observation_stem1_idx` (`stem`),
804
  CONSTRAINT `fk_stem_observation_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
805
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
806
  CONSTRAINT `fk_stem_observation_individual_observation2` FOREIGN KEY (`id`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
807
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]';
808
/*!40101 SET character_set_client = @saved_cs_client */;
809

    
810
--
811
-- Dumping data for table `stem_observation`
812
--
813

    
814
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
815
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
816

    
817
--
818
-- Table structure for table `stratum`
819
--
820

    
821
/*!40101 SET @saved_cs_client     = @@character_set_client */;
822
/*!40101 SET character_set_client = utf8 */;
823
CREATE TABLE `stratum` (
824
  `id` varbinary(767) NOT NULL,
825
  `name` varbinary(767) NOT NULL,
826
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
827
  PRIMARY KEY (`id`),
828
  CONSTRAINT `fk_place_path_record10` FOREIGN KEY (`id`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
829
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
830
/*!40101 SET character_set_client = @saved_cs_client */;
831

    
832
--
833
-- Dumping data for table `stratum`
834
--
835

    
836
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
837
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
838

    
839
--
840
-- Table structure for table `subplot`
841
--
842

    
843
/*!40101 SET @saved_cs_client     = @@character_set_client */;
844
/*!40101 SET character_set_client = utf8 */;
845
CREATE TABLE `subplot` (
846
  `id` varbinary(767) NOT NULL,
847
  `x_m` double DEFAULT NULL,
848
  `y_m` double DEFAULT NULL,
849
  `coordinates` set('hstore') COLLATE utf8_bin DEFAULT NULL,
850
  PRIMARY KEY (`id`),
851
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
852
) 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)';
853
/*!40101 SET character_set_client = @saved_cs_client */;
854

    
855
--
856
-- Dumping data for table `subplot`
857
--
858

    
859
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
860
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
861

    
862
--
863
-- Table structure for table `taxon_absence`
864
--
865

    
866
/*!40101 SET @saved_cs_client     = @@character_set_client */;
867
/*!40101 SET character_set_client = utf8 */;
868
CREATE TABLE `taxon_absence` (
869
  `id` varbinary(767) NOT NULL,
870
  `taxon_concept` varbinary(767) NOT NULL,
871
  PRIMARY KEY (`id`),
872
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
873
  CONSTRAINT `fk_taxon_observation_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
874
  CONSTRAINT `fk_taxon_presence_taxon_name10` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
875
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place';
876
/*!40101 SET character_set_client = @saved_cs_client */;
877

    
878
--
879
-- Dumping data for table `taxon_absence`
880
--
881

    
882
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
883
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
884

    
885
--
886
-- Table structure for table `taxon_assertion`
887
--
888

    
889
/*!40101 SET @saved_cs_client     = @@character_set_client */;
890
/*!40101 SET character_set_client = utf8 */;
891
CREATE TABLE `taxon_assertion` (
892
  `id` varbinary(767) NOT NULL,
893
  `string` varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
894
  `taxon` varbinary(767) DEFAULT NULL,
895
  `cf_aff` varbinary(767) DEFAULT NULL,
896
  `annotations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
897
  PRIMARY KEY (`id`),
898
  KEY `fk_taxon_assertion_taxon_string1_idx` (`string`),
899
  KEY `fk_taxon_assertion_taxon_name1_idx` (`taxon`),
900
  CONSTRAINT `fk_qualified_taxon_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
901
  CONSTRAINT `fk_taxon_assertion_taxon_string1` FOREIGN KEY (`string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
902
  CONSTRAINT `fk_taxon_assertion_taxon_name1` FOREIGN KEY (`taxon`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
903
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
904
/*!40101 SET character_set_client = @saved_cs_client */;
905

    
906
--
907
-- Dumping data for table `taxon_assertion`
908
--
909

    
910
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
911
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
912

    
913
--
914
-- Table structure for table `taxon_concept`
915
--
916

    
917
/*!40101 SET @saved_cs_client     = @@character_set_client */;
918
/*!40101 SET character_set_client = utf8 */;
919
CREATE TABLE `taxon_concept` (
920
  `id` varbinary(767) NOT NULL,
921
  `according_to` varbinary(767) NOT NULL,
922
  `parent` varbinary(767) NOT NULL,
923
  `accepted_taxon_concept` varbinary(767) DEFAULT NULL,
924
  PRIMARY KEY (`id`),
925
  UNIQUE KEY `taxon_concept_unique_name` (`according_to`),
926
  KEY `fk_taxon_taxon1_idx` (`parent`),
927
  KEY `fk_taxon_concept_source1_idx` (`according_to`),
928
  KEY `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon_concept`),
929
  CONSTRAINT `fk_taxon_taxon1` FOREIGN KEY (`parent`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
930
  CONSTRAINT `fk_taxon_concept_source1` FOREIGN KEY (`according_to`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
931
  CONSTRAINT `fk_taxon_concept_taxon_concept1` FOREIGN KEY (`accepted_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
932
  CONSTRAINT `fk_taxon_concept_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
933
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]';
934
/*!40101 SET character_set_client = @saved_cs_client */;
935

    
936
--
937
-- Dumping data for table `taxon_concept`
938
--
939

    
940
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
941
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
942

    
943
--
944
-- Table structure for table `taxon_determination`
945
--
946

    
947
/*!40101 SET @saved_cs_client     = @@character_set_client */;
948
/*!40101 SET character_set_client = utf8 */;
949
CREATE TABLE `taxon_determination` (
950
  `id` varbinary(767) NOT NULL,
951
  `taxon_assertion` varbinary(767) NOT NULL,
952
  `identified_by` varbinary(767) DEFAULT NULL,
953
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
954
  PRIMARY KEY (`id`),
955
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
956
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
957
  KEY `fk_taxon_determination_party_list1_idx` (`identified_by`),
958
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
959
  CONSTRAINT `fk_taxon_determination_record1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
960
  CONSTRAINT `fk_taxon_determination_party_list1` FOREIGN KEY (`identified_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
961
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
962
/*!40101 SET character_set_client = @saved_cs_client */;
963

    
964
--
965
-- Dumping data for table `taxon_determination`
966
--
967

    
968
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
969
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
970

    
971
--
972
-- Table structure for table `taxon_name`
973
--
974

    
975
/*!40101 SET @saved_cs_client     = @@character_set_client */;
976
/*!40101 SET character_set_client = utf8 */;
977
CREATE TABLE `taxon_name` (
978
  `id` varbinary(767) NOT NULL,
979
  `unique_name` varbinary(767) NOT NULL,
980
  `formal_name` varbinary(767) DEFAULT NULL,
981
  `taxon_name` varbinary(767) DEFAULT NULL,
982
  `author` varbinary(767) DEFAULT NULL,
983
  `common_name` varbinary(767) DEFAULT NULL,
984
  `rank` varbinary(767) DEFAULT NULL,
985
  PRIMARY KEY (`id`),
986
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
987
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
988
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
989
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
990
/*!40101 SET character_set_client = @saved_cs_client */;
991

    
992
--
993
-- Dumping data for table `taxon_name`
994
--
995

    
996
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
997
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
998

    
999
--
1000
-- Table structure for table `taxon_observation`
1001
--
1002

    
1003
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1004
/*!40101 SET character_set_client = utf8 */;
1005
CREATE TABLE `taxon_observation` (
1006
  `id` varbinary(767) NOT NULL,
1007
  `taxon_occurrence` varbinary(767) NOT NULL,
1008
  `collectors` varbinary(767) DEFAULT NULL,
1009
  `collector_number` varbinary(767) DEFAULT NULL,
1010
  `voucher` varbinary(767) DEFAULT NULL,
1011
  `growth_form` varbinary(767) DEFAULT NULL,
1012
  `cultivated` tinyint(1) DEFAULT NULL,
1013
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1014
  PRIMARY KEY (`id`),
1015
  KEY `fk_taxon_observation_taxon_occurrence2_idx` (`taxon_occurrence`),
1016
  KEY `fk_taxon_observation_specimen1_idx` (`voucher`),
1017
  KEY `fk_taxon_observation_party_list1_idx` (`collectors`),
1018
  CONSTRAINT `fk_taxon_observation_party_list1` FOREIGN KEY (`collectors`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1019
  CONSTRAINT `fk_taxon_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1020
  CONSTRAINT `fk_taxon_observation_specimen1` FOREIGN KEY (`voucher`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1021
  CONSTRAINT `fk_taxon_observation_taxon_occurrence2` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1022
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1023
/*!40101 SET character_set_client = @saved_cs_client */;
1024

    
1025
--
1026
-- Dumping data for table `taxon_observation`
1027
--
1028

    
1029
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1030
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1031

    
1032
--
1033
-- Table structure for table `taxon_occurrence`
1034
--
1035

    
1036
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1037
/*!40101 SET character_set_client = utf8 */;
1038
CREATE TABLE `taxon_occurrence` (
1039
  `id` varbinary(767) NOT NULL,
1040
  `current_determination` varbinary(767) DEFAULT NULL,
1041
  `original_determination` varbinary(767) DEFAULT NULL,
1042
  PRIMARY KEY (`id`),
1043
  KEY `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination`),
1044
  KEY `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination`),
1045
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1` FOREIGN KEY (`original_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1046
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2` FOREIGN KEY (`current_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1047
  CONSTRAINT `fk_taxon_occurrence_event1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1048
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
1049
/*!40101 SET character_set_client = @saved_cs_client */;
1050

    
1051
--
1052
-- Dumping data for table `taxon_occurrence`
1053
--
1054

    
1055
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1056
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1057

    
1058
--
1059
-- Table structure for table `taxon_path`
1060
--
1061

    
1062
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1063
/*!40101 SET character_set_client = utf8 */;
1064
CREATE TABLE `taxon_path` (
1065
  `id` varbinary(767) NOT NULL,
1066
  `family` varbinary(767) DEFAULT NULL,
1067
  `genus` varbinary(767) DEFAULT NULL,
1068
  `specific_epithet` varbinary(767) DEFAULT NULL,
1069
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1070
  PRIMARY KEY (`id`),
1071
  CONSTRAINT `fk_taxon_path_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1072
) 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)';
1073
/*!40101 SET character_set_client = @saved_cs_client */;
1074

    
1075
--
1076
-- Dumping data for table `taxon_path`
1077
--
1078

    
1079
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1080
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1081

    
1082
--
1083
-- Table structure for table `taxon_presence`
1084
--
1085

    
1086
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1087
/*!40101 SET character_set_client = utf8 */;
1088
CREATE TABLE `taxon_presence` (
1089
  `id` varbinary(767) NOT NULL,
1090
  `taxon_concept` varbinary(767) NOT NULL,
1091
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1092
  PRIMARY KEY (`id`),
1093
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
1094
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1095
  CONSTRAINT `fk_taxon_presence_taxon_name1` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1096
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_';
1097
/*!40101 SET character_set_client = @saved_cs_client */;
1098

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

    
1103
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1104
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1105

    
1106
--
1107
-- Table structure for table `taxon_string`
1108
--
1109

    
1110
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1111
/*!40101 SET character_set_client = utf8 */;
1112
CREATE TABLE `taxon_string` (
1113
  `string` varbinary(767) NOT NULL,
1114
  PRIMARY KEY (`string`)
1115
) 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)';
1116
/*!40101 SET character_set_client = @saved_cs_client */;
1117

    
1118
--
1119
-- Dumping data for table `taxon_string`
1120
--
1121

    
1122
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1123
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1124

    
1125
--
1126
-- Table structure for table `validatable_place`
1127
--
1128

    
1129
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1130
/*!40101 SET character_set_client = utf8 */;
1131
CREATE TABLE `validatable_place` (
1132
  `id` varbinary(767) NOT NULL,
1133
  `coordinates` varbinary(767) NOT NULL,
1134
  `path` varbinary(767) NOT NULL,
1135
  PRIMARY KEY (`id`),
1136
  UNIQUE KEY `validatable_place_unique` (`path`,`coordinates`),
1137
  KEY `fk_geovalidation_place_path1_idx` (`path`),
1138
  KEY `fk_geovalidation_coordinates1_idx` (`coordinates`),
1139
  CONSTRAINT `fk_geovalidation_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1140
  CONSTRAINT `fk_geovalidation_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1141
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1142
/*!40101 SET character_set_client = @saved_cs_client */;
1143

    
1144
--
1145
-- Dumping data for table `validatable_place`
1146
--
1147

    
1148
/*!40000 ALTER TABLE `validatable_place` DISABLE KEYS */;
1149
/*!40000 ALTER TABLE `validatable_place` ENABLE KEYS */;
1150
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1151

    
1152
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1153
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1154
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1155
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1156
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1157
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1158
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1159

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