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_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
173
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
174
  CONSTRAINT `fk_event_party_list1` FOREIGN KEY (`participants`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
175
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
176
  CONSTRAINT `fk_event_method1` FOREIGN KEY (`method`) REFERENCES `method` (`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_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
268
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`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_collection_source10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
362
  CONSTRAINT `fk_party_organization1` FOREIGN KEY (`organization`) REFERENCES `organization` (`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_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
707
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
708
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
709
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
710
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
711
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
712
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`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_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
786
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`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_absence`
844
--
845

    
846
/*!40101 SET @saved_cs_client     = @@character_set_client */;
847
/*!40101 SET character_set_client = utf8 */;
848
CREATE TABLE `taxon_absence` (
849
  `id` varbinary(767) NOT NULL,
850
  `taxon_concept` varbinary(767) NOT NULL,
851
  PRIMARY KEY (`id`),
852
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
853
  CONSTRAINT `fk_taxon_observation_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
854
  CONSTRAINT `fk_taxon_presence_taxon_name10` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
855
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place';
856
/*!40101 SET character_set_client = @saved_cs_client */;
857

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

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

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

    
869
/*!40101 SET @saved_cs_client     = @@character_set_client */;
870
/*!40101 SET character_set_client = utf8 */;
871
CREATE TABLE `taxon_assertion` (
872
  `id` varbinary(767) NOT NULL,
873
  `string` varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
874
  `taxon` varbinary(767) DEFAULT NULL,
875
  `cf_aff` varbinary(767) DEFAULT NULL,
876
  `annotations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
877
  PRIMARY KEY (`id`),
878
  KEY `fk_taxon_assertion_taxon_string1_idx` (`string`),
879
  KEY `fk_taxon_assertion_taxon_name1_idx` (`taxon`),
880
  CONSTRAINT `fk_qualified_taxon_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
881
  CONSTRAINT `fk_taxon_assertion_taxon_string1` FOREIGN KEY (`string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
882
  CONSTRAINT `fk_taxon_assertion_taxon_name1` FOREIGN KEY (`taxon`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
883
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
884
/*!40101 SET character_set_client = @saved_cs_client */;
885

    
886
--
887
-- Dumping data for table `taxon_assertion`
888
--
889

    
890
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
891
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
892

    
893
--
894
-- Table structure for table `taxon_concept`
895
--
896

    
897
/*!40101 SET @saved_cs_client     = @@character_set_client */;
898
/*!40101 SET character_set_client = utf8 */;
899
CREATE TABLE `taxon_concept` (
900
  `id` varbinary(767) NOT NULL,
901
  `according_to` varbinary(767) NOT NULL,
902
  `parent` varbinary(767) NOT NULL,
903
  `accepted_taxon_concept` varbinary(767) DEFAULT NULL,
904
  PRIMARY KEY (`id`),
905
  UNIQUE KEY `taxon_concept_unique_name` (`according_to`),
906
  KEY `fk_taxon_taxon1_idx` (`parent`),
907
  KEY `fk_taxon_concept_source1_idx` (`according_to`),
908
  KEY `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon_concept`),
909
  CONSTRAINT `fk_taxon_taxon1` FOREIGN KEY (`parent`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
910
  CONSTRAINT `fk_taxon_concept_source1` FOREIGN KEY (`according_to`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
911
  CONSTRAINT `fk_taxon_concept_taxon_concept1` FOREIGN KEY (`accepted_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
912
  CONSTRAINT `fk_taxon_concept_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
913
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]';
914
/*!40101 SET character_set_client = @saved_cs_client */;
915

    
916
--
917
-- Dumping data for table `taxon_concept`
918
--
919

    
920
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
921
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
922

    
923
--
924
-- Table structure for table `taxon_determination`
925
--
926

    
927
/*!40101 SET @saved_cs_client     = @@character_set_client */;
928
/*!40101 SET character_set_client = utf8 */;
929
CREATE TABLE `taxon_determination` (
930
  `id` varbinary(767) NOT NULL,
931
  `taxon_assertion` varbinary(767) NOT NULL,
932
  `identified_by` varbinary(767) DEFAULT NULL,
933
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
934
  PRIMARY KEY (`id`),
935
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
936
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
937
  KEY `fk_taxon_determination_party_list1_idx` (`identified_by`),
938
  CONSTRAINT `fk_taxon_determination_party_list1` FOREIGN KEY (`identified_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
939
  CONSTRAINT `fk_taxon_determination_record1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
940
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
941
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
942
/*!40101 SET character_set_client = @saved_cs_client */;
943

    
944
--
945
-- Dumping data for table `taxon_determination`
946
--
947

    
948
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
949
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
950

    
951
--
952
-- Table structure for table `taxon_name`
953
--
954

    
955
/*!40101 SET @saved_cs_client     = @@character_set_client */;
956
/*!40101 SET character_set_client = utf8 */;
957
CREATE TABLE `taxon_name` (
958
  `id` varbinary(767) NOT NULL,
959
  `unique_name` varbinary(767) NOT NULL,
960
  `formal_name` varbinary(767) DEFAULT NULL,
961
  `taxon_name` varbinary(767) DEFAULT NULL,
962
  `author` varbinary(767) DEFAULT NULL,
963
  `common_name` varbinary(767) DEFAULT NULL,
964
  `rank` varbinary(767) DEFAULT NULL,
965
  PRIMARY KEY (`id`),
966
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
967
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
968
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
969
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
970
/*!40101 SET character_set_client = @saved_cs_client */;
971

    
972
--
973
-- Dumping data for table `taxon_name`
974
--
975

    
976
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
977
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
978

    
979
--
980
-- Table structure for table `taxon_observation`
981
--
982

    
983
/*!40101 SET @saved_cs_client     = @@character_set_client */;
984
/*!40101 SET character_set_client = utf8 */;
985
CREATE TABLE `taxon_observation` (
986
  `id` varbinary(767) NOT NULL,
987
  `taxon_occurrence` varbinary(767) NOT NULL,
988
  `collectors` varbinary(767) DEFAULT NULL,
989
  `collector_number` varbinary(767) DEFAULT NULL,
990
  `voucher` varbinary(767) DEFAULT NULL,
991
  `growth_form` varbinary(767) DEFAULT NULL,
992
  `cultivated` tinyint(1) DEFAULT NULL,
993
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
994
  PRIMARY KEY (`id`),
995
  KEY `fk_taxon_observation_taxon_occurrence2_idx` (`taxon_occurrence`),
996
  KEY `fk_taxon_observation_specimen1_idx` (`voucher`),
997
  KEY `fk_taxon_observation_party_list1_idx` (`collectors`),
998
  CONSTRAINT `fk_taxon_observation_taxon_occurrence2` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
999
  CONSTRAINT `fk_taxon_observation_party_list1` FOREIGN KEY (`collectors`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1000
  CONSTRAINT `fk_taxon_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1001
  CONSTRAINT `fk_taxon_observation_specimen1` FOREIGN KEY (`voucher`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1002
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1003
/*!40101 SET character_set_client = @saved_cs_client */;
1004

    
1005
--
1006
-- Dumping data for table `taxon_observation`
1007
--
1008

    
1009
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1010
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1011

    
1012
--
1013
-- Table structure for table `taxon_occurrence`
1014
--
1015

    
1016
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1017
/*!40101 SET character_set_client = utf8 */;
1018
CREATE TABLE `taxon_occurrence` (
1019
  `id` varbinary(767) NOT NULL,
1020
  `current_determination` varbinary(767) DEFAULT NULL,
1021
  `original_determination` varbinary(767) DEFAULT NULL,
1022
  PRIMARY KEY (`id`),
1023
  KEY `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination`),
1024
  KEY `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination`),
1025
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1` FOREIGN KEY (`original_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1026
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2` FOREIGN KEY (`current_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1027
  CONSTRAINT `fk_taxon_occurrence_event1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1028
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
1029
/*!40101 SET character_set_client = @saved_cs_client */;
1030

    
1031
--
1032
-- Dumping data for table `taxon_occurrence`
1033
--
1034

    
1035
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1036
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1037

    
1038
--
1039
-- Table structure for table `taxon_path`
1040
--
1041

    
1042
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1043
/*!40101 SET character_set_client = utf8 */;
1044
CREATE TABLE `taxon_path` (
1045
  `id` varbinary(767) NOT NULL,
1046
  `family` varbinary(767) DEFAULT NULL,
1047
  `genus` varbinary(767) DEFAULT NULL,
1048
  `specific_epithet` varbinary(767) DEFAULT NULL,
1049
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1050
  PRIMARY KEY (`id`),
1051
  CONSTRAINT `fk_taxon_path_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1052
) 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)';
1053
/*!40101 SET character_set_client = @saved_cs_client */;
1054

    
1055
--
1056
-- Dumping data for table `taxon_path`
1057
--
1058

    
1059
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1060
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1061

    
1062
--
1063
-- Table structure for table `taxon_presence`
1064
--
1065

    
1066
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1067
/*!40101 SET character_set_client = utf8 */;
1068
CREATE TABLE `taxon_presence` (
1069
  `id` varbinary(767) NOT NULL,
1070
  `taxon_concept` varbinary(767) NOT NULL,
1071
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1072
  PRIMARY KEY (`id`),
1073
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
1074
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1075
  CONSTRAINT `fk_taxon_presence_taxon_name1` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1076
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_';
1077
/*!40101 SET character_set_client = @saved_cs_client */;
1078

    
1079
--
1080
-- Dumping data for table `taxon_presence`
1081
--
1082

    
1083
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1084
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1085

    
1086
--
1087
-- Table structure for table `taxon_string`
1088
--
1089

    
1090
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1091
/*!40101 SET character_set_client = utf8 */;
1092
CREATE TABLE `taxon_string` (
1093
  `string` varbinary(767) NOT NULL,
1094
  PRIMARY KEY (`string`)
1095
) 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)';
1096
/*!40101 SET character_set_client = @saved_cs_client */;
1097

    
1098
--
1099
-- Dumping data for table `taxon_string`
1100
--
1101

    
1102
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1103
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1104

    
1105
--
1106
-- Table structure for table `validatable_place`
1107
--
1108

    
1109
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1110
/*!40101 SET character_set_client = utf8 */;
1111
CREATE TABLE `validatable_place` (
1112
  `id` varbinary(767) NOT NULL,
1113
  `coordinates` varbinary(767) NOT NULL,
1114
  `path` varbinary(767) NOT NULL,
1115
  PRIMARY KEY (`id`),
1116
  UNIQUE KEY `validatable_place_unique` (`path`,`coordinates`),
1117
  KEY `fk_geovalidation_place_path1_idx` (`path`),
1118
  KEY `fk_geovalidation_coordinates1_idx` (`coordinates`),
1119
  CONSTRAINT `fk_geovalidation_place_path1` FOREIGN KEY (`path`) REFERENCES `place_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1120
  CONSTRAINT `fk_geovalidation_coordinates1` FOREIGN KEY (`coordinates`) REFERENCES `coordinates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1121
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1122
/*!40101 SET character_set_client = @saved_cs_client */;
1123

    
1124
--
1125
-- Dumping data for table `validatable_place`
1126
--
1127

    
1128
/*!40000 ALTER TABLE `validatable_place` DISABLE KEYS */;
1129
/*!40000 ALTER TABLE `validatable_place` ENABLE KEYS */;
1130
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1131

    
1132
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1133
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1134
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1135
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1136
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1137
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1138
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1139

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