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
  `bounding_box_WKT` varbinary(767) DEFAULT NULL,
512
  `footprint_geom_WKT` varbinary(767) DEFAULT NULL,
513
  PRIMARY KEY (`id`),
514
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
515
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
516
/*!40101 SET character_set_client = @saved_cs_client */;
517

    
518
--
519
-- Dumping data for table `plot`
520
--
521

    
522
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
523
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
524

    
525
--
526
-- Table structure for table `project`
527
--
528

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

    
540
--
541
-- Dumping data for table `project`
542
--
543

    
544
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
545
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
546

    
547
--
548
-- Table structure for table `record`
549
--
550

    
551
/*!40101 SET @saved_cs_client     = @@character_set_client */;
552
/*!40101 SET character_set_client = utf8 */;
553
CREATE TABLE `record` (
554
  `id` varbinary(767) NOT NULL,
555
  `source` varbinary(767) NOT NULL,
556
  `source_id_scope` varbinary(767) DEFAULT NULL,
557
  `source_record_id` varbinary(767) DEFAULT NULL,
558
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
559
  PRIMARY KEY (`id`),
560
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
561
  KEY `fk_record_source1_idx` (`source`),
562
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
563
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
564
/*!40101 SET character_set_client = @saved_cs_client */;
565

    
566
--
567
-- Dumping data for table `record`
568
--
569

    
570
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
571
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
572

    
573
--
574
-- Table structure for table `referenced_class`
575
--
576

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

    
586
--
587
-- Dumping data for table `referenced_class`
588
--
589

    
590
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
591
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
592

    
593
--
594
-- Table structure for table `relationship`
595
--
596

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

    
613
--
614
-- Dumping data for table `relationship`
615
--
616

    
617
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
618
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
619

    
620
--
621
-- Table structure for table `sampling_event`
622
--
623

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

    
636
--
637
-- Dumping data for table `sampling_event`
638
--
639

    
640
/*!40000 ALTER TABLE `sampling_event` DISABLE KEYS */;
641
/*!40000 ALTER TABLE `sampling_event` ENABLE KEYS */;
642

    
643
--
644
-- Table structure for table `soil_observation`
645
--
646

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

    
657
--
658
-- Dumping data for table `soil_observation`
659
--
660

    
661
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
662
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
663

    
664
--
665
-- Table structure for table `source`
666
--
667

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

    
688
--
689
-- Dumping data for table `source`
690
--
691

    
692
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
693
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
694

    
695
--
696
-- Table structure for table `specimen`
697
--
698

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

    
733
--
734
-- Dumping data for table `specimen`
735
--
736

    
737
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
738
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
739

    
740
--
741
-- Table structure for table `specimen_observation`
742
--
743

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

    
757
--
758
-- Dumping data for table `specimen_observation`
759
--
760

    
761
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
762
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
763

    
764
--
765
-- Table structure for table `stem`
766
--
767

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

    
780
--
781
-- Dumping data for table `stem`
782
--
783

    
784
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
785
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
786

    
787
--
788
-- Table structure for table `stem_observation`
789
--
790

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

    
808
--
809
-- Dumping data for table `stem_observation`
810
--
811

    
812
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
813
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
814

    
815
--
816
-- Table structure for table `stratum`
817
--
818

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

    
830
--
831
-- Dumping data for table `stratum`
832
--
833

    
834
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
835
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
836

    
837
--
838
-- Table structure for table `subplot`
839
--
840

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

    
852
--
853
-- Dumping data for table `subplot`
854
--
855

    
856
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
857
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
858

    
859
--
860
-- Table structure for table `taxon_absence`
861
--
862

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

    
875
--
876
-- Dumping data for table `taxon_absence`
877
--
878

    
879
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
880
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
881

    
882
--
883
-- Table structure for table `taxon_assertion`
884
--
885

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

    
903
--
904
-- Dumping data for table `taxon_assertion`
905
--
906

    
907
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
908
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
909

    
910
--
911
-- Table structure for table `taxon_concept`
912
--
913

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

    
933
--
934
-- Dumping data for table `taxon_concept`
935
--
936

    
937
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
938
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
939

    
940
--
941
-- Table structure for table `taxon_determination`
942
--
943

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

    
961
--
962
-- Dumping data for table `taxon_determination`
963
--
964

    
965
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
966
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
967

    
968
--
969
-- Table structure for table `taxon_name`
970
--
971

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

    
989
--
990
-- Dumping data for table `taxon_name`
991
--
992

    
993
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
994
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
995

    
996
--
997
-- Table structure for table `taxon_observation`
998
--
999

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

    
1022
--
1023
-- Dumping data for table `taxon_observation`
1024
--
1025

    
1026
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1027
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1028

    
1029
--
1030
-- Table structure for table `taxon_occurrence`
1031
--
1032

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

    
1048
--
1049
-- Dumping data for table `taxon_occurrence`
1050
--
1051

    
1052
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1053
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1054

    
1055
--
1056
-- Table structure for table `taxon_path`
1057
--
1058

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

    
1072
--
1073
-- Dumping data for table `taxon_path`
1074
--
1075

    
1076
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1077
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1078

    
1079
--
1080
-- Table structure for table `taxon_presence`
1081
--
1082

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

    
1096
--
1097
-- Dumping data for table `taxon_presence`
1098
--
1099

    
1100
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1101
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1102

    
1103
--
1104
-- Table structure for table `taxon_string`
1105
--
1106

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

    
1115
--
1116
-- Dumping data for table `taxon_string`
1117
--
1118

    
1119
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1120
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1121

    
1122
--
1123
-- Table structure for table `validatable_place`
1124
--
1125

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

    
1141
--
1142
-- Dumping data for table `validatable_place`
1143
--
1144

    
1145
/*!40000 ALTER TABLE `validatable_place` DISABLE KEYS */;
1146
/*!40000 ALTER TABLE `validatable_place` ENABLE KEYS */;
1147
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1148

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

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