Project

General

Profile

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

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

    
18
--
19
-- Table structure for table `aggregate_observation`
20
--
21

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

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

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

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

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

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

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

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

    
68
/*!40101 SET @saved_cs_client     = @@character_set_client */;
69
/*!40101 SET character_set_client = utf8 */;
70
CREATE TABLE `collection` (
71
  `id` varbinary(767) NOT NULL,
72
  `institution` varbinary(767) NOT NULL,
73
  `name` varbinary(767) NOT NULL,
74
  PRIMARY KEY (`id`),
75
  UNIQUE KEY `collection_unique` (`institution`,`name`),
76
  KEY `fk_collection_organization1_idx` (`institution`),
77
  KEY `fk_collection_source1_idx` (`id`),
78
  CONSTRAINT `fk_collection_source1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
79
  CONSTRAINT `fk_collection_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
80
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"the collection within the institution where a specimen is held" ("Brad Boyle":https://projects.nceas.ucsb.edu/nceas/attachments/download/621/vegbien_identifier_examples.xlsx#terms/collectionCode)';
81
/*!40101 SET character_set_client = @saved_cs_client */;
82

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

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

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

    
94
/*!40101 SET @saved_cs_client     = @@character_set_client */;
95
/*!40101 SET character_set_client = utf8 */;
96
CREATE TABLE `community` (
97
  `id` varbinary(767) NOT NULL,
98
  `name` varbinary(767) NOT NULL,
99
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
100
  PRIMARY KEY (`id`),
101
  CONSTRAINT `fk_community_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
102
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A community type is an abstract grouping of organisms that tend to co-occur on the landscape due to shared ecological requirements or preferences. May be designated by syntaxon or physiognomic types." ([[VegCore#VegX|VegX]])';
103
/*!40101 SET character_set_client = @saved_cs_client */;
104

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

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

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

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

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

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

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

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

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

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

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

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

    
180
--
181
-- Dumping data for table `event`
182
--
183

    
184
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
185
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
186

    
187
--
188
-- Table structure for table `geological_context`
189
--
190

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

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

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

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

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

    
225
--
226
-- Dumping data for table `geovalidation`
227
--
228

    
229
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
230
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
231

    
232
--
233
-- Table structure for table `individual`
234
--
235

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

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

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

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

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

    
272
--
273
-- Dumping data for table `individual_observation`
274
--
275

    
276
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
277
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
278

    
279
--
280
-- Table structure for table `method`
281
--
282

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

    
296
--
297
-- Dumping data for table `method`
298
--
299

    
300
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
301
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
302

    
303
--
304
-- Table structure for table `organization`
305
--
306

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

    
317
--
318
-- Dumping data for table `organization`
319
--
320

    
321
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
322
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
323

    
324
--
325
-- Table structure for table `parsed_taxon_assertion`
326
--
327

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

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

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

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

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

    
366
--
367
-- Dumping data for table `party`
368
--
369

    
370
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
371
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
372

    
373
--
374
-- Table structure for table `party_list`
375
--
376

    
377
/*!40101 SET @saved_cs_client     = @@character_set_client */;
378
/*!40101 SET character_set_client = utf8 */;
379
CREATE TABLE `party_list` (
380
  `id` varbinary(767) NOT NULL,
381
  `count` int(11) NOT NULL,
382
  PRIMARY KEY (`id`),
383
  CONSTRAINT `fk_collection_source100` 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_list`
389
--
390

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

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

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

    
412
--
413
-- Dumping data for table `party_list_entry`
414
--
415

    
416
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
417
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
418

    
419
--
420
-- Table structure for table `place`
421
--
422

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

    
442
--
443
-- Dumping data for table `place`
444
--
445

    
446
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
447
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
448

    
449
--
450
-- Table structure for table `place_observation`
451
--
452

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

    
476
--
477
-- Dumping data for table `place_observation`
478
--
479

    
480
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
481
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
482

    
483
--
484
-- Table structure for table `place_path`
485
--
486

    
487
/*!40101 SET @saved_cs_client     = @@character_set_client */;
488
/*!40101 SET character_set_client = utf8 */;
489
CREATE TABLE `place_path` (
490
  `id` varbinary(767) NOT NULL,
491
  `continent` varbinary(767) DEFAULT NULL,
492
  `country` varbinary(767) DEFAULT NULL,
493
  `state_province` varbinary(767) DEFAULT NULL,
494
  `county` varbinary(767) DEFAULT NULL,
495
  `municipality` varbinary(767) DEFAULT NULL,
496
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
497
  PRIMARY KEY (`id`)
498
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
499
/*!40101 SET character_set_client = @saved_cs_client */;
500

    
501
--
502
-- Dumping data for table `place_path`
503
--
504

    
505
/*!40000 ALTER TABLE `place_path` DISABLE KEYS */;
506
/*!40000 ALTER TABLE `place_path` ENABLE KEYS */;
507

    
508
--
509
-- Table structure for table `plot`
510
--
511

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
626
--
627
-- Table structure for table `soil_observation`
628
--
629

    
630
/*!40101 SET @saved_cs_client     = @@character_set_client */;
631
/*!40101 SET character_set_client = utf8 */;
632
CREATE TABLE `soil_observation` (
633
  `id` varbinary(767) NOT NULL,
634
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
635
  PRIMARY KEY (`id`),
636
  CONSTRAINT `fk_soil_observation_place_observation1` FOREIGN KEY (`id`) REFERENCES `place_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
637
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil';
638
/*!40101 SET character_set_client = @saved_cs_client */;
639

    
640
--
641
-- Dumping data for table `soil_observation`
642
--
643

    
644
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
645
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
646

    
647
--
648
-- Table structure for table `source`
649
--
650

    
651
/*!40101 SET @saved_cs_client     = @@character_set_client */;
652
/*!40101 SET character_set_client = utf8 */;
653
CREATE TABLE `source` (
654
  `id` varbinary(767) NOT NULL,
655
  `parent` varbinary(767) NOT NULL,
656
  `name` varbinary(767) NOT NULL,
657
  `first_publisher` varbinary(767) DEFAULT NULL,
658
  `owner` varbinary(767) DEFAULT NULL,
659
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
660
  PRIMARY KEY (`id`),
661
  UNIQUE KEY `source_unique` (`parent`,`name`),
662
  KEY `fk_source1_idx` (`parent`),
663
  KEY `fk_source_party1_idx` (`owner`),
664
  KEY `fk_source_party2_idx` (`first_publisher`),
665
  CONSTRAINT `fk_source1` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
666
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`owner`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
667
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
668
) 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)';
669
/*!40101 SET character_set_client = @saved_cs_client */;
670

    
671
--
672
-- Dumping data for table `source`
673
--
674

    
675
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
676
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
677

    
678
--
679
-- Table structure for table `specimen`
680
--
681

    
682
/*!40101 SET @saved_cs_client     = @@character_set_client */;
683
/*!40101 SET character_set_client = utf8 */;
684
CREATE TABLE `specimen` (
685
  `id` varbinary(767) NOT NULL,
686
  `individual` varbinary(767) DEFAULT NULL,
687
  `code_in_individual` varbinary(767) DEFAULT NULL,
688
  `collection_event` varbinary(767) DEFAULT NULL,
689
  `orig_collection` varbinary(767) DEFAULT NULL,
690
  `barcode` varbinary(767) DEFAULT NULL,
691
  `accession_number` varbinary(767) DEFAULT NULL,
692
  `specimenholder_institutions` varbinary(767) DEFAULT NULL,
693
  `current_collection` varbinary(767) DEFAULT NULL,
694
  `owner_collection` varbinary(767) DEFAULT NULL,
695
  PRIMARY KEY (`id`),
696
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
697
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
698
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
699
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
700
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
701
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
702
  KEY `fk_specimen_individual1_idx` (`individual`),
703
  KEY `fk_specimen_collection2_idx` (`current_collection`),
704
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
705
  KEY `fk_specimen_party_list1_idx` (`specimenholder_institutions`),
706
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
707
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
708
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
709
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
710
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
711
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
712
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
713
) 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';
714
/*!40101 SET character_set_client = @saved_cs_client */;
715

    
716
--
717
-- Dumping data for table `specimen`
718
--
719

    
720
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
721
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
722

    
723
--
724
-- Table structure for table `specimen_observation`
725
--
726

    
727
/*!40101 SET @saved_cs_client     = @@character_set_client */;
728
/*!40101 SET character_set_client = utf8 */;
729
CREATE TABLE `specimen_observation` (
730
  `id` varbinary(767) NOT NULL,
731
  `specimen` varbinary(767) NOT NULL,
732
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
733
  PRIMARY KEY (`id`),
734
  KEY `fk_specimen_observation_specimen1_idx` (`specimen`),
735
  CONSTRAINT `fk_specimen_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
736
  CONSTRAINT `fk_specimen_observation_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
737
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
738
/*!40101 SET character_set_client = @saved_cs_client */;
739

    
740
--
741
-- Dumping data for table `specimen_observation`
742
--
743

    
744
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
745
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
746

    
747
--
748
-- Table structure for table `stem`
749
--
750

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

    
763
--
764
-- Dumping data for table `stem`
765
--
766

    
767
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
768
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
769

    
770
--
771
-- Table structure for table `stem_observation`
772
--
773

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

    
791
--
792
-- Dumping data for table `stem_observation`
793
--
794

    
795
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
796
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
797

    
798
--
799
-- Table structure for table `stratum`
800
--
801

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

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

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

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

    
824
/*!40101 SET @saved_cs_client     = @@character_set_client */;
825
/*!40101 SET character_set_client = utf8 */;
826
CREATE TABLE `subplot` (
827
  `id` varbinary(767) NOT NULL,
828
  `x_m` double DEFAULT NULL,
829
  `y_m` double DEFAULT NULL,
830
  PRIMARY KEY (`id`),
831
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
832
) 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)';
833
/*!40101 SET character_set_client = @saved_cs_client */;
834

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

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

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

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

    
863
--
864
-- Dumping data for table `taxon_assertion`
865
--
866

    
867
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
868
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
869

    
870
--
871
-- Table structure for table `taxon_concept`
872
--
873

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

    
893
--
894
-- Dumping data for table `taxon_concept`
895
--
896

    
897
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
898
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
899

    
900
--
901
-- Table structure for table `taxon_determination`
902
--
903

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

    
921
--
922
-- Dumping data for table `taxon_determination`
923
--
924

    
925
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
926
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
927

    
928
--
929
-- Table structure for table `taxon_name`
930
--
931

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

    
949
--
950
-- Dumping data for table `taxon_name`
951
--
952

    
953
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
954
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
955

    
956
--
957
-- Table structure for table `taxon_observation`
958
--
959

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

    
982
--
983
-- Dumping data for table `taxon_observation`
984
--
985

    
986
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
987
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
988

    
989
--
990
-- Table structure for table `taxon_occurrence`
991
--
992

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

    
1008
--
1009
-- Dumping data for table `taxon_occurrence`
1010
--
1011

    
1012
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1013
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1014

    
1015
--
1016
-- Table structure for table `taxon_path`
1017
--
1018

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

    
1032
--
1033
-- Dumping data for table `taxon_path`
1034
--
1035

    
1036
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1037
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1038

    
1039
--
1040
-- Table structure for table `taxon_presence`
1041
--
1042

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

    
1056
--
1057
-- Dumping data for table `taxon_presence`
1058
--
1059

    
1060
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1061
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1062

    
1063
--
1064
-- Table structure for table `taxon_string`
1065
--
1066

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

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

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

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

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

    
1101
--
1102
-- Dumping data for table `validatable_place`
1103
--
1104

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

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

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