Project

General

Profile

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

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

    
18
--
19
-- 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 `derived_class`
111
--
112

    
113
/*!40101 SET @saved_cs_client     = @@character_set_client */;
114
/*!40101 SET character_set_client = utf8 */;
115
CREATE TABLE `derived_class` (
116
  `id` varbinary(767) NOT NULL,
117
  PRIMARY KEY (`id`),
118
  CONSTRAINT `fk_derived_class_base_class1` FOREIGN KEY (`id`) REFERENCES `base_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
119
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
120
/*!40101 SET character_set_client = @saved_cs_client */;
121

    
122
--
123
-- Dumping data for table `derived_class`
124
--
125

    
126
/*!40000 ALTER TABLE `derived_class` DISABLE KEYS */;
127
/*!40000 ALTER TABLE `derived_class` ENABLE KEYS */;
128

    
129
--
130
-- Table structure for table `event`
131
--
132

    
133
/*!40101 SET @saved_cs_client     = @@character_set_client */;
134
/*!40101 SET character_set_client = utf8 */;
135
CREATE TABLE `event` (
136
  `id` varbinary(767) NOT NULL,
137
  `parent` varbinary(767) NOT NULL,
138
  `name` varbinary(767) DEFAULT NULL,
139
  `date_range` varbinary(767) DEFAULT NULL,
140
  `place` varbinary(767) DEFAULT NULL,
141
  `participants` varbinary(767) DEFAULT NULL,
142
  PRIMARY KEY (`id`),
143
  KEY `fk_event_place1_idx` (`place`),
144
  KEY `fk_event1_idx` (`parent`),
145
  KEY `fk_event_party_list1_idx` (`participants`),
146
  CONSTRAINT `fk_event_party_list1` FOREIGN KEY (`participants`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
147
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
148
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
149
  CONSTRAINT `fk_event_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
150
) 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)';
151
/*!40101 SET character_set_client = @saved_cs_client */;
152

    
153
--
154
-- Dumping data for table `event`
155
--
156

    
157
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
158
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
159

    
160
--
161
-- Table structure for table `geocoords`
162
--
163

    
164
/*!40101 SET @saved_cs_client     = @@character_set_client */;
165
/*!40101 SET character_set_client = utf8 */;
166
CREATE TABLE `geocoords` (
167
  `id` varbinary(767) NOT NULL,
168
  `latitude_deg` varbinary(767) NOT NULL,
169
  `longitude_deg` varbinary(767) NOT NULL,
170
  PRIMARY KEY (`id`),
171
  KEY `geocoords_unique` (`latitude_deg`,`longitude_deg`)
172
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point';
173
/*!40101 SET character_set_client = @saved_cs_client */;
174

    
175
--
176
-- Dumping data for table `geocoords`
177
--
178

    
179
/*!40000 ALTER TABLE `geocoords` DISABLE KEYS */;
180
/*!40000 ALTER TABLE `geocoords` ENABLE KEYS */;
181

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

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

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

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

    
204
--
205
-- Table structure for table `geopath`
206
--
207

    
208
/*!40101 SET @saved_cs_client     = @@character_set_client */;
209
/*!40101 SET character_set_client = utf8 */;
210
CREATE TABLE `geopath` (
211
  `id` varbinary(767) NOT NULL,
212
  `continent` varbinary(767) DEFAULT NULL,
213
  `country` varbinary(767) NOT NULL,
214
  `state_province` varbinary(767) DEFAULT NULL,
215
  `county` varbinary(767) DEFAULT NULL,
216
  `municipality` varbinary(767) DEFAULT NULL,
217
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
218
  PRIMARY KEY (`id`)
219
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
220
/*!40101 SET character_set_client = @saved_cs_client */;
221

    
222
--
223
-- Dumping data for table `geopath`
224
--
225

    
226
/*!40000 ALTER TABLE `geopath` DISABLE KEYS */;
227
/*!40000 ALTER TABLE `geopath` ENABLE KEYS */;
228

    
229
--
230
-- Table structure for table `geoplace`
231
--
232

    
233
/*!40101 SET @saved_cs_client     = @@character_set_client */;
234
/*!40101 SET character_set_client = utf8 */;
235
CREATE TABLE `geoplace` (
236
  `id` varbinary(767) NOT NULL,
237
  `geocoords` varbinary(767) NOT NULL,
238
  `geopath` varbinary(767) NOT NULL,
239
  PRIMARY KEY (`id`),
240
  UNIQUE KEY `validatable_place_unique` (`geopath`,`geocoords`),
241
  KEY `fk_geovalidation_place_path1_idx` (`geopath`),
242
  KEY `fk_geovalidation_coordinates1_idx` (`geocoords`),
243
  CONSTRAINT `fk_geovalidation_coordinates1` FOREIGN KEY (`geocoords`) REFERENCES `geocoords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
244
  CONSTRAINT `fk_geovalidation_place_path1` FOREIGN KEY (`geopath`) REFERENCES `geopath` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
245
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
246
/*!40101 SET character_set_client = @saved_cs_client */;
247

    
248
--
249
-- Dumping data for table `geoplace`
250
--
251

    
252
/*!40000 ALTER TABLE `geoplace` DISABLE KEYS */;
253
/*!40000 ALTER TABLE `geoplace` ENABLE KEYS */;
254

    
255
--
256
-- Table structure for table `geovalidation`
257
--
258

    
259
/*!40101 SET @saved_cs_client     = @@character_set_client */;
260
/*!40101 SET character_set_client = utf8 */;
261
CREATE TABLE `geovalidation` (
262
  `id` varbinary(767) NOT NULL,
263
  `geovalid` tinyint(1) NOT NULL,
264
  `lat_long_domain_valid` tinyint(1) NOT NULL,
265
  `lat_long_in_place_ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
266
  PRIMARY KEY (`id`),
267
  CONSTRAINT `fk_geovalidation_validatable_place1` FOREIGN KEY (`id`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
268
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
269
/*!40101 SET character_set_client = @saved_cs_client */;
270

    
271
--
272
-- Dumping data for table `geovalidation`
273
--
274

    
275
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
276
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
277

    
278
--
279
-- Table structure for table `individual`
280
--
281

    
282
/*!40101 SET @saved_cs_client     = @@character_set_client */;
283
/*!40101 SET character_set_client = utf8 */;
284
CREATE TABLE `individual` (
285
  `id` varbinary(767) NOT NULL,
286
  `tag` varbinary(767) DEFAULT NULL,
287
  `tag_history` set('hstore') COLLATE utf8_bin DEFAULT NULL,
288
  PRIMARY KEY (`id`),
289
  CONSTRAINT `fk_individual_record1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
290
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism';
291
/*!40101 SET character_set_client = @saved_cs_client */;
292

    
293
--
294
-- Dumping data for table `individual`
295
--
296

    
297
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
298
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
299

    
300
--
301
-- Table structure for table `individual_observation`
302
--
303

    
304
/*!40101 SET @saved_cs_client     = @@character_set_client */;
305
/*!40101 SET character_set_client = utf8 */;
306
CREATE TABLE `individual_observation` (
307
  `id` varbinary(767) NOT NULL,
308
  `individual` varbinary(767) DEFAULT NULL,
309
  `code` varbinary(767) DEFAULT NULL,
310
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
311
  PRIMARY KEY (`id`),
312
  KEY `fk_individual_observation_individual1_idx` (`individual`),
313
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
314
  CONSTRAINT `fk_individual_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
315
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]';
316
/*!40101 SET character_set_client = @saved_cs_client */;
317

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

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

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

    
329
/*!40101 SET @saved_cs_client     = @@character_set_client */;
330
/*!40101 SET character_set_client = utf8 */;
331
CREATE TABLE `method` (
332
  `id` varbinary(767) NOT NULL,
333
  `parent` varbinary(767) NOT NULL,
334
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
335
  PRIMARY KEY (`id`),
336
  KEY `fk_method_method1_idx` (`parent`),
337
  CONSTRAINT `fk_method_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
338
  CONSTRAINT `fk_method_method1` FOREIGN KEY (`parent`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
339
) 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)';
340
/*!40101 SET character_set_client = @saved_cs_client */;
341

    
342
--
343
-- Dumping data for table `method`
344
--
345

    
346
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
347
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
348

    
349
--
350
-- Table structure for table `organization`
351
--
352

    
353
/*!40101 SET @saved_cs_client     = @@character_set_client */;
354
/*!40101 SET character_set_client = utf8 */;
355
CREATE TABLE `organization` (
356
  `id` varbinary(767) NOT NULL,
357
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
358
  PRIMARY KEY (`id`),
359
  CONSTRAINT `fk_organization_party1` FOREIGN KEY (`id`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
360
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
361
/*!40101 SET character_set_client = @saved_cs_client */;
362

    
363
--
364
-- Dumping data for table `organization`
365
--
366

    
367
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
368
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
369

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

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

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

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

    
394
--
395
-- Table structure for table `party_list`
396
--
397

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

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

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

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

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

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

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

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

    
444
/*!40101 SET @saved_cs_client     = @@character_set_client */;
445
/*!40101 SET character_set_client = utf8 */;
446
CREATE TABLE `place` (
447
  `id` varbinary(767) NOT NULL,
448
  `parent` varbinary(767) NOT NULL,
449
  `geocoords` varbinary(767) DEFAULT NULL,
450
  `geopath` varbinary(767) DEFAULT NULL,
451
  `locality` varbinary(767) DEFAULT NULL,
452
  `coords` set('hstore') COLLATE utf8_bin DEFAULT NULL COMMENT 'for verbatim coordinates, etc.',
453
  PRIMARY KEY (`id`),
454
  KEY `fk_place_coordinates1_idx` (`geocoords`),
455
  KEY `fk_place1_idx` (`parent`),
456
  KEY `fk_place_place_path1_idx` (`geopath`),
457
  CONSTRAINT `fk_place_coordinates1` FOREIGN KEY (`geocoords`) REFERENCES `geocoords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
458
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
459
  CONSTRAINT `fk_place_place_path1` FOREIGN KEY (`geopath`) REFERENCES `geopath` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
460
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`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
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
491
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
492
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
493
  CONSTRAINT `fk_place_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
494
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
495
/*!40101 SET character_set_client = @saved_cs_client */;
496

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

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

    
504
--
505
-- Table structure for table `plot`
506
--
507

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

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

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

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

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

    
545
--
546
-- Dumping data for table `project`
547
--
548

    
549
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
550
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
551

    
552
--
553
-- Table structure for table `record`
554
--
555

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

    
571
--
572
-- Dumping data for table `record`
573
--
574

    
575
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
576
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
577

    
578
--
579
-- Table structure for table `referenced_class`
580
--
581

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

    
591
--
592
-- Dumping data for table `referenced_class`
593
--
594

    
595
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
596
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
597

    
598
--
599
-- Table structure for table `relationship`
600
--
601

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

    
618
--
619
-- Dumping data for table `relationship`
620
--
621

    
622
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
623
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
624

    
625
--
626
-- Table structure for table `sampling_event`
627
--
628

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

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

    
645
/*!40000 ALTER TABLE `sampling_event` DISABLE KEYS */;
646
/*!40000 ALTER TABLE `sampling_event` 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
  `specimenholder_institutions` varbinary(767) DEFAULT NULL,
715
  `current_collection` varbinary(767) DEFAULT NULL,
716
  `owner_collection` varbinary(767) DEFAULT NULL,
717
  PRIMARY KEY (`id`),
718
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
719
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
720
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
721
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
722
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
723
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
724
  KEY `fk_specimen_individual1_idx` (`individual`),
725
  KEY `fk_specimen_collection2_idx` (`current_collection`),
726
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
727
  KEY `fk_specimen_party_list1_idx` (`specimenholder_institutions`),
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
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
733
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
734
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
735
) 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';
736
/*!40101 SET character_set_client = @saved_cs_client */;
737

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

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

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

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

    
762
--
763
-- Dumping data for table `specimen_observation`
764
--
765

    
766
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
767
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
768

    
769
--
770
-- Table structure for table `stem`
771
--
772

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

    
785
--
786
-- Dumping data for table `stem`
787
--
788

    
789
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
790
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
791

    
792
--
793
-- Table structure for table `stem_observation`
794
--
795

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

    
813
--
814
-- Dumping data for table `stem_observation`
815
--
816

    
817
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
818
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
819

    
820
--
821
-- Table structure for table `stratum`
822
--
823

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

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

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

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

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

    
858
--
859
-- Dumping data for table `subplot`
860
--
861

    
862
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
863
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
864

    
865
--
866
-- Table structure for table `taxon_absence`
867
--
868

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

    
881
--
882
-- Dumping data for table `taxon_absence`
883
--
884

    
885
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
886
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
887

    
888
--
889
-- Table structure for table `taxon_assertion`
890
--
891

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

    
909
--
910
-- Dumping data for table `taxon_assertion`
911
--
912

    
913
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
914
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
915

    
916
--
917
-- Table structure for table `taxon_concept`
918
--
919

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

    
939
--
940
-- Dumping data for table `taxon_concept`
941
--
942

    
943
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
944
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
945

    
946
--
947
-- Table structure for table `taxon_determination`
948
--
949

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

    
967
--
968
-- Dumping data for table `taxon_determination`
969
--
970

    
971
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
972
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
973

    
974
--
975
-- Table structure for table `taxon_name`
976
--
977

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

    
995
--
996
-- Dumping data for table `taxon_name`
997
--
998

    
999
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
1000
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
1001

    
1002
--
1003
-- Table structure for table `taxon_observation`
1004
--
1005

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

    
1028
--
1029
-- Dumping data for table `taxon_observation`
1030
--
1031

    
1032
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1033
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1034

    
1035
--
1036
-- Table structure for table `taxon_occurrence`
1037
--
1038

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

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

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

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

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

    
1078
--
1079
-- Dumping data for table `taxon_path`
1080
--
1081

    
1082
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1083
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1084

    
1085
--
1086
-- Table structure for table `taxon_presence`
1087
--
1088

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

    
1102
--
1103
-- Dumping data for table `taxon_presence`
1104
--
1105

    
1106
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1107
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1108

    
1109
--
1110
-- Table structure for table `taxon_scrub`
1111
--
1112

    
1113
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1114
/*!40101 SET character_set_client = utf8 */;
1115
CREATE TABLE `taxon_scrub` (
1116
  `id` varbinary(767) NOT NULL,
1117
  `input_string` varbinary(767) NOT NULL,
1118
  `parsed_taxon_assertion` varbinary(767) NOT NULL,
1119
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
1120
  `match_score` float DEFAULT NULL,
1121
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1122
  PRIMARY KEY (`id`),
1123
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
1124
  KEY `fk_taxon_scrub_taxon_assertion1_idx` (`parsed_taxon_assertion`),
1125
  KEY `fk_taxon_scrub_taxon_string1_idx` (`input_string`),
1126
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1127
  CONSTRAINT `fk_taxon_scrub_taxon_assertion1` FOREIGN KEY (`parsed_taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1128
  CONSTRAINT `fk_taxon_scrub_taxon_string1` FOREIGN KEY (`input_string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
1129
  CONSTRAINT `fk_taxon_scrub_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1130
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1131
/*!40101 SET character_set_client = @saved_cs_client */;
1132

    
1133
--
1134
-- Dumping data for table `taxon_scrub`
1135
--
1136

    
1137
/*!40000 ALTER TABLE `taxon_scrub` DISABLE KEYS */;
1138
/*!40000 ALTER TABLE `taxon_scrub` ENABLE KEYS */;
1139

    
1140
--
1141
-- Table structure for table `taxon_string`
1142
--
1143

    
1144
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1145
/*!40101 SET character_set_client = utf8 */;
1146
CREATE TABLE `taxon_string` (
1147
  `string` varbinary(767) NOT NULL,
1148
  PRIMARY KEY (`string`)
1149
) 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)';
1150
/*!40101 SET character_set_client = @saved_cs_client */;
1151

    
1152
--
1153
-- Dumping data for table `taxon_string`
1154
--
1155

    
1156
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1157
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1158
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1159

    
1160
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1161
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1162
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1163
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1164
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1165
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1166
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1167

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