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 `party_list`
397
--
398

    
399
/*!40101 SET @saved_cs_client     = @@character_set_client */;
400
/*!40101 SET character_set_client = utf8 */;
401
CREATE TABLE `party_list` (
402
  `id` varbinary(767) NOT NULL,
403
  `count` int(11) NOT NULL,
404
  PRIMARY KEY (`id`),
405
  CONSTRAINT `fk_collection_source100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
406
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
407
/*!40101 SET character_set_client = @saved_cs_client */;
408

    
409
--
410
-- Dumping data for table `party_list`
411
--
412

    
413
/*!40000 ALTER TABLE `party_list` DISABLE KEYS */;
414
/*!40000 ALTER TABLE `party_list` ENABLE KEYS */;
415

    
416
--
417
-- Table structure for table `party_list_entry`
418
--
419

    
420
/*!40101 SET @saved_cs_client     = @@character_set_client */;
421
/*!40101 SET character_set_client = utf8 */;
422
CREATE TABLE `party_list_entry` (
423
  `id` varbinary(767) NOT NULL,
424
  `entry` varbinary(767) NOT NULL,
425
  `sort_order` int(11) DEFAULT NULL,
426
  PRIMARY KEY (`id`,`entry`),
427
  KEY `fk_party_list_has_party_party1_idx` (`entry`),
428
  KEY `fk_party_list_has_party_party_list1_idx` (`id`),
429
  CONSTRAINT `fk_party_list_has_party_party_list1` FOREIGN KEY (`id`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
430
  CONSTRAINT `fk_party_list_has_party_party1` FOREIGN KEY (`entry`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
431
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
432
/*!40101 SET character_set_client = @saved_cs_client */;
433

    
434
--
435
-- Dumping data for table `party_list_entry`
436
--
437

    
438
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
439
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
440

    
441
--
442
-- Table structure for table `place`
443
--
444

    
445
/*!40101 SET @saved_cs_client     = @@character_set_client */;
446
/*!40101 SET character_set_client = utf8 */;
447
CREATE TABLE `place` (
448
  `id` varbinary(767) NOT NULL,
449
  `parent` varbinary(767) NOT NULL,
450
  `coordinates` varbinary(767) DEFAULT NULL,
451
  `path` varbinary(767) DEFAULT NULL,
452
  `locality` varbinary(767) DEFAULT NULL,
453
  PRIMARY KEY (`id`),
454
  KEY `fk_place_coordinates1_idx` (`coordinates`),
455
  KEY `fk_place1_idx` (`parent`),
456
  KEY `fk_place_place_path1_idx` (`path`),
457
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
458
  CONSTRAINT `fk_place_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
459
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
460
  CONSTRAINT `fk_place_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
461
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
462
/*!40101 SET character_set_client = @saved_cs_client */;
463

    
464
--
465
-- Dumping data for table `place`
466
--
467

    
468
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
469
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
470

    
471
--
472
-- Table structure for table `place_observation`
473
--
474

    
475
/*!40101 SET @saved_cs_client     = @@character_set_client */;
476
/*!40101 SET character_set_client = utf8 */;
477
CREATE TABLE `place_observation` (
478
  `id` varbinary(767) NOT NULL,
479
  `place` varbinary(767) NOT NULL,
480
  `elevation_m` double DEFAULT NULL,
481
  `slope_incline_deg` double DEFAULT NULL,
482
  `slope_direction_deg_N` double DEFAULT NULL,
483
  `geological_context` varbinary(767) DEFAULT NULL,
484
  `community` varbinary(767) DEFAULT NULL,
485
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
486
  PRIMARY KEY (`id`),
487
  KEY `fk_place_observation_place1_idx` (`place`),
488
  KEY `fk_place_observation_geological_context1_idx` (`geological_context`),
489
  KEY `fk_place_observation_community1_idx` (`community`),
490
  KEY `fk_place_observation_event1_idx` (`id`),
491
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
492
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
493
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
494
  CONSTRAINT `fk_place_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
495
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
496
/*!40101 SET character_set_client = @saved_cs_client */;
497

    
498
--
499
-- Dumping data for table `place_observation`
500
--
501

    
502
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
503
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
504

    
505
--
506
-- Table structure for table `place_path`
507
--
508

    
509
/*!40101 SET @saved_cs_client     = @@character_set_client */;
510
/*!40101 SET character_set_client = utf8 */;
511
CREATE TABLE `place_path` (
512
  `id` varbinary(767) NOT NULL,
513
  `continent` varbinary(767) DEFAULT NULL,
514
  `country` varbinary(767) DEFAULT NULL,
515
  `state_province` varbinary(767) DEFAULT NULL,
516
  `county` varbinary(767) DEFAULT NULL,
517
  `municipality` varbinary(767) DEFAULT NULL,
518
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
519
  PRIMARY KEY (`id`)
520
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
521
/*!40101 SET character_set_client = @saved_cs_client */;
522

    
523
--
524
-- Dumping data for table `place_path`
525
--
526

    
527
/*!40000 ALTER TABLE `place_path` DISABLE KEYS */;
528
/*!40000 ALTER TABLE `place_path` ENABLE KEYS */;
529

    
530
--
531
-- Table structure for table `plot`
532
--
533

    
534
/*!40101 SET @saved_cs_client     = @@character_set_client */;
535
/*!40101 SET character_set_client = utf8 */;
536
CREATE TABLE `plot` (
537
  `id` varbinary(767) NOT NULL,
538
  `name` varbinary(767) DEFAULT NULL,
539
  `area_m2` double DEFAULT NULL,
540
  `bounding_box` varbinary(767) DEFAULT NULL,
541
  PRIMARY KEY (`id`),
542
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
543
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
544
/*!40101 SET character_set_client = @saved_cs_client */;
545

    
546
--
547
-- Dumping data for table `plot`
548
--
549

    
550
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
551
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
552

    
553
--
554
-- Table structure for table `project`
555
--
556

    
557
/*!40101 SET @saved_cs_client     = @@character_set_client */;
558
/*!40101 SET character_set_client = utf8 */;
559
CREATE TABLE `project` (
560
  `id` varbinary(767) NOT NULL,
561
  `name` varbinary(767) NOT NULL,
562
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
563
  PRIMARY KEY (`id`),
564
  CONSTRAINT `fk_project_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
565
) 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)';
566
/*!40101 SET character_set_client = @saved_cs_client */;
567

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

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

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

    
579
/*!40101 SET @saved_cs_client     = @@character_set_client */;
580
/*!40101 SET character_set_client = utf8 */;
581
CREATE TABLE `record` (
582
  `id` varbinary(767) NOT NULL,
583
  `source` varbinary(767) NOT NULL,
584
  `source_id_scope` varbinary(767) DEFAULT NULL,
585
  `source_record_id` varbinary(767) DEFAULT NULL,
586
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
587
  PRIMARY KEY (`id`),
588
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
589
  KEY `fk_record_source1_idx` (`source`),
590
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
591
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
592
/*!40101 SET character_set_client = @saved_cs_client */;
593

    
594
--
595
-- Dumping data for table `record`
596
--
597

    
598
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
599
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
600

    
601
--
602
-- Table structure for table `referenced_class`
603
--
604

    
605
/*!40101 SET @saved_cs_client     = @@character_set_client */;
606
/*!40101 SET character_set_client = utf8 */;
607
CREATE TABLE `referenced_class` (
608
  `id` varbinary(767) NOT NULL,
609
  PRIMARY KEY (`id`),
610
  CONSTRAINT `fk_example_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
611
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
612
/*!40101 SET character_set_client = @saved_cs_client */;
613

    
614
--
615
-- Dumping data for table `referenced_class`
616
--
617

    
618
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
619
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
620

    
621
--
622
-- Table structure for table `relationship`
623
--
624

    
625
/*!40101 SET @saved_cs_client     = @@character_set_client */;
626
/*!40101 SET character_set_client = utf8 */;
627
CREATE TABLE `relationship` (
628
  `id` varbinary(767) NOT NULL,
629
  `record` varbinary(767) NOT NULL,
630
  `related_record` varbinary(767) NOT NULL,
631
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
632
  PRIMARY KEY (`id`),
633
  KEY `fk_relationship_record1_idx` (`record`),
634
  KEY `fk_relationship_related_record_idx` (`related_record`),
635
  CONSTRAINT `fk_relationship_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
636
  CONSTRAINT `fk_relationship_record2` FOREIGN KEY (`record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
637
  CONSTRAINT `fk_relationship_related_record` FOREIGN KEY (`related_record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
638
) 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)';
639
/*!40101 SET character_set_client = @saved_cs_client */;
640

    
641
--
642
-- Dumping data for table `relationship`
643
--
644

    
645
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
646
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
647

    
648
--
649
-- Table structure for table `soil_observation`
650
--
651

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

    
662
--
663
-- Dumping data for table `soil_observation`
664
--
665

    
666
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
667
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
668

    
669
--
670
-- Table structure for table `source`
671
--
672

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

    
693
--
694
-- Dumping data for table `source`
695
--
696

    
697
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
698
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
699

    
700
--
701
-- Table structure for table `specimen`
702
--
703

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

    
770
/*!40101 SET @saved_cs_client     = @@character_set_client */;
771
/*!40101 SET character_set_client = utf8 */;
772
CREATE TABLE `specimenholder_institution` (
773
  `specimen` varbinary(767) NOT NULL,
774
  `institution` varbinary(767) NOT NULL,
775
  `sort_order` int(11) DEFAULT NULL,
776
  PRIMARY KEY (`specimen`,`institution`),
777
  KEY `fk_specimen_has_organization_organization1_idx` (`institution`),
778
  KEY `fk_specimen_has_organization_specimen1_idx` (`specimen`),
779
  CONSTRAINT `fk_specimen_has_organization_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
780
  CONSTRAINT `fk_specimen_has_organization_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
781
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
782
/*!40101 SET character_set_client = @saved_cs_client */;
783

    
784
--
785
-- Dumping data for table `specimenholder_institution`
786
--
787

    
788
/*!40000 ALTER TABLE `specimenholder_institution` DISABLE KEYS */;
789
/*!40000 ALTER TABLE `specimenholder_institution` ENABLE KEYS */;
790

    
791
--
792
-- Table structure for table `stem`
793
--
794

    
795
/*!40101 SET @saved_cs_client     = @@character_set_client */;
796
/*!40101 SET character_set_client = utf8 */;
797
CREATE TABLE `stem` (
798
  `id` varbinary(767) NOT NULL,
799
  `individual` varbinary(767) NOT NULL,
800
  PRIMARY KEY (`id`),
801
  KEY `fk_stem_individual1_idx` (`individual`),
802
  CONSTRAINT `fk_stem_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
803
  CONSTRAINT `fk_stem_individual2` FOREIGN KEY (`id`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
804
) 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)';
805
/*!40101 SET character_set_client = @saved_cs_client */;
806

    
807
--
808
-- Dumping data for table `stem`
809
--
810

    
811
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
812
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
813

    
814
--
815
-- Table structure for table `stem_observation`
816
--
817

    
818
/*!40101 SET @saved_cs_client     = @@character_set_client */;
819
/*!40101 SET character_set_client = utf8 */;
820
CREATE TABLE `stem_observation` (
821
  `id` varbinary(767) NOT NULL,
822
  `individual_observation` varbinary(767) NOT NULL,
823
  `stem` varbinary(767) DEFAULT NULL,
824
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
825
  PRIMARY KEY (`id`),
826
  UNIQUE KEY `stem_observation_unique` (`individual_observation`,`stem`),
827
  KEY `fk_stem_observation_individual_observation1_idx` (`individual_observation`),
828
  KEY `fk_stem_observation_stem1_idx` (`stem`),
829
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
830
  CONSTRAINT `fk_stem_observation_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
831
  CONSTRAINT `fk_stem_observation_individual_observation2` FOREIGN KEY (`id`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
832
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]';
833
/*!40101 SET character_set_client = @saved_cs_client */;
834

    
835
--
836
-- Dumping data for table `stem_observation`
837
--
838

    
839
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
840
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
841

    
842
--
843
-- Table structure for table `stratum`
844
--
845

    
846
/*!40101 SET @saved_cs_client     = @@character_set_client */;
847
/*!40101 SET character_set_client = utf8 */;
848
CREATE TABLE `stratum` (
849
  `id` varbinary(767) NOT NULL,
850
  `name` varbinary(767) NOT NULL,
851
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
852
  PRIMARY KEY (`id`),
853
  CONSTRAINT `fk_place_path_record10` FOREIGN KEY (`id`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
854
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
855
/*!40101 SET character_set_client = @saved_cs_client */;
856

    
857
--
858
-- Dumping data for table `stratum`
859
--
860

    
861
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
862
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
863

    
864
--
865
-- Table structure for table `subplot`
866
--
867

    
868
/*!40101 SET @saved_cs_client     = @@character_set_client */;
869
/*!40101 SET character_set_client = utf8 */;
870
CREATE TABLE `subplot` (
871
  `id` varbinary(767) NOT NULL,
872
  `x_m` double DEFAULT NULL,
873
  `y_m` double DEFAULT NULL,
874
  PRIMARY KEY (`id`),
875
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
876
) 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)';
877
/*!40101 SET character_set_client = @saved_cs_client */;
878

    
879
--
880
-- Dumping data for table `subplot`
881
--
882

    
883
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
884
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
885

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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