Project

General

Profile

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

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

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

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

    
32
--
33
-- Dumping data for table `aggregate_observation`
34
--
35

    
36
/*!40000 ALTER TABLE `aggregate_observation` DISABLE KEYS */;
37
/*!40000 ALTER TABLE `aggregate_observation` ENABLE KEYS */;
38

    
39
--
40
-- Table structure for table `base_class`
41
--
42

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

    
54
--
55
-- Dumping data for table `base_class`
56
--
57

    
58
/*!40000 ALTER TABLE `base_class` DISABLE KEYS */;
59
/*!40000 ALTER TABLE `base_class` ENABLE KEYS */;
60

    
61
--
62
-- Table structure for table `collection`
63
--
64

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

    
80
--
81
-- Dumping data for table `collection`
82
--
83

    
84
/*!40000 ALTER TABLE `collection` DISABLE KEYS */;
85
/*!40000 ALTER TABLE `collection` ENABLE KEYS */;
86

    
87
--
88
-- Table structure for table `community`
89
--
90

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

    
102
--
103
-- Dumping data for table `community`
104
--
105

    
106
/*!40000 ALTER TABLE `community` DISABLE KEYS */;
107
/*!40000 ALTER TABLE `community` ENABLE KEYS */;
108

    
109
--
110
-- Table structure for table `derived_class`
111
--
112

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

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

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

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

    
133
/*!40101 SET @saved_cs_client     = @@character_set_client */;
134
/*!40101 SET character_set_client = utf8 */;
135
CREATE TABLE `event` (
136
  `id` varbinary(767) NOT NULL,
137
  `parent` varbinary(767) NOT NULL,
138
  `name` varbinary(767) DEFAULT NULL,
139
  `date_range` varbinary(767) DEFAULT NULL,
140
  `place` varbinary(767) DEFAULT NULL,
141
  `participants` varbinary(767) DEFAULT NULL,
142
  PRIMARY KEY (`id`),
143
  KEY `fk_event_place1_idx` (`place`),
144
  KEY `fk_event1_idx` (`parent`),
145
  KEY `fk_event_party_list1_idx` (`participants`),
146
  CONSTRAINT `fk_event_party_list1` FOREIGN KEY (`participants`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
147
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
148
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
149
  CONSTRAINT `fk_event_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
150
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"an action that occurs at a place and during a period of time" ("DwC":http://rs.tdwg.org/dwc/terms/#Event)';
151
/*!40101 SET character_set_client = @saved_cs_client */;
152

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

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

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

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

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

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

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

    
186
/*!40101 SET @saved_cs_client     = @@character_set_client */;
187
/*!40101 SET character_set_client = utf8 */;
188
CREATE TABLE `geological_context` (
189
  `id` varbinary(767) NOT NULL,
190
  `name` varbinary(767) NOT NULL,
191
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
192
  PRIMARY KEY (`id`),
193
  CONSTRAINT `fk_geological_context_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
194
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"information pertaining to a location within a geological context, such as stratigraphy" ("DwC":http://rs.tdwg.org/dwc/terms/#GeologicalContext)';
195
/*!40101 SET character_set_client = @saved_cs_client */;
196

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

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

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

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

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

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

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

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

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

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

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

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

    
277
--
278
-- Dumping data for table `geovalidation`
279
--
280

    
281
/*!40000 ALTER TABLE `geovalidation` DISABLE KEYS */;
282
/*!40000 ALTER TABLE `geovalidation` ENABLE KEYS */;
283

    
284
--
285
-- Table structure for table `individual`
286
--
287

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

    
299
--
300
-- Dumping data for table `individual`
301
--
302

    
303
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
304
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
305

    
306
--
307
-- Table structure for table `individual_observation`
308
--
309

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

    
324
--
325
-- Dumping data for table `individual_observation`
326
--
327

    
328
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
329
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
330

    
331
--
332
-- Table structure for table `method`
333
--
334

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

    
348
--
349
-- Dumping data for table `method`
350
--
351

    
352
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
353
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
354

    
355
--
356
-- Table structure for table `organization`
357
--
358

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

    
369
--
370
-- Dumping data for table `organization`
371
--
372

    
373
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
374
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
375

    
376
--
377
-- Table structure for table `party`
378
--
379

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

    
393
--
394
-- Dumping data for table `party`
395
--
396

    
397
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
398
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
399

    
400
--
401
-- Table structure for table `party_list`
402
--
403

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

    
414
--
415
-- Dumping data for table `party_list`
416
--
417

    
418
/*!40000 ALTER TABLE `party_list` DISABLE KEYS */;
419
/*!40000 ALTER TABLE `party_list` ENABLE KEYS */;
420

    
421
--
422
-- Table structure for table `party_list_entry`
423
--
424

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

    
439
--
440
-- Dumping data for table `party_list_entry`
441
--
442

    
443
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
444
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
445

    
446
--
447
-- Table structure for table `place`
448
--
449

    
450
/*!40101 SET @saved_cs_client     = @@character_set_client */;
451
/*!40101 SET character_set_client = utf8 */;
452
CREATE TABLE `place` (
453
  `id` varbinary(767) NOT NULL,
454
  `parent` varbinary(767) NOT NULL,
455
  `geocoords` varbinary(767) DEFAULT NULL,
456
  `geopath` varbinary(767) DEFAULT NULL,
457
  `locality` varbinary(767) DEFAULT NULL,
458
  `coords` set('hstore') COLLATE utf8_bin DEFAULT NULL COMMENT 'for verbatim coordinates, etc.',
459
  PRIMARY KEY (`id`),
460
  KEY `fk_place_coordinates1_idx` (`geocoords`),
461
  KEY `fk_place1_idx` (`parent`),
462
  KEY `fk_place_place_path1_idx` (`geopath`),
463
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
464
  CONSTRAINT `fk_place_coordinates1` FOREIGN KEY (`geocoords`) REFERENCES `geocoords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
465
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
466
  CONSTRAINT `fk_place_place_path1` FOREIGN KEY (`geopath`) REFERENCES `geopath` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
467
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
468
/*!40101 SET character_set_client = @saved_cs_client */;
469

    
470
--
471
-- Dumping data for table `place`
472
--
473

    
474
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
475
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
476

    
477
--
478
-- Table structure for table `place_observation`
479
--
480

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

    
503
--
504
-- Dumping data for table `place_observation`
505
--
506

    
507
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
508
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
509

    
510
--
511
-- Table structure for table `plot`
512
--
513

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

    
529
--
530
-- Dumping data for table `plot`
531
--
532

    
533
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
534
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
535

    
536
--
537
-- Table structure for table `project`
538
--
539

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

    
551
--
552
-- Dumping data for table `project`
553
--
554

    
555
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
556
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
557

    
558
--
559
-- Table structure for table `record`
560
--
561

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

    
577
--
578
-- Dumping data for table `record`
579
--
580

    
581
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
582
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
583

    
584
--
585
-- Table structure for table `referenced_class`
586
--
587

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

    
597
--
598
-- Dumping data for table `referenced_class`
599
--
600

    
601
/*!40000 ALTER TABLE `referenced_class` DISABLE KEYS */;
602
/*!40000 ALTER TABLE `referenced_class` ENABLE KEYS */;
603

    
604
--
605
-- Table structure for table `relationship`
606
--
607

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

    
624
--
625
-- Dumping data for table `relationship`
626
--
627

    
628
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
629
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
630

    
631
--
632
-- Table structure for table `sampling_event`
633
--
634

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

    
647
--
648
-- Dumping data for table `sampling_event`
649
--
650

    
651
/*!40000 ALTER TABLE `sampling_event` DISABLE KEYS */;
652
/*!40000 ALTER TABLE `sampling_event` ENABLE KEYS */;
653

    
654
--
655
-- Table structure for table `soil_observation`
656
--
657

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

    
668
--
669
-- Dumping data for table `soil_observation`
670
--
671

    
672
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
673
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
674

    
675
--
676
-- Table structure for table `source`
677
--
678

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

    
699
--
700
-- Dumping data for table `source`
701
--
702

    
703
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
704
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
705

    
706
--
707
-- Table structure for table `specimen`
708
--
709

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

    
744
--
745
-- Dumping data for table `specimen`
746
--
747

    
748
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
749
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
750

    
751
--
752
-- Table structure for table `specimen_observation`
753
--
754

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

    
768
--
769
-- Dumping data for table `specimen_observation`
770
--
771

    
772
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
773
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
774

    
775
--
776
-- Table structure for table `stem`
777
--
778

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

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

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

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

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

    
819
--
820
-- Dumping data for table `stem_observation`
821
--
822

    
823
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
824
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
825

    
826
--
827
-- Table structure for table `stratum`
828
--
829

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

    
841
--
842
-- Dumping data for table `stratum`
843
--
844

    
845
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
846
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
847

    
848
--
849
-- Table structure for table `subplot`
850
--
851

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

    
864
--
865
-- Dumping data for table `subplot`
866
--
867

    
868
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
869
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
870

    
871
--
872
-- Table structure for table `taxon_absence`
873
--
874

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

    
887
--
888
-- Dumping data for table `taxon_absence`
889
--
890

    
891
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
892
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
893

    
894
--
895
-- Table structure for table `taxon_assertion`
896
--
897

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

    
915
--
916
-- Dumping data for table `taxon_assertion`
917
--
918

    
919
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
920
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
921

    
922
--
923
-- Table structure for table `taxon_concept`
924
--
925

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

    
945
--
946
-- Dumping data for table `taxon_concept`
947
--
948

    
949
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
950
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
951

    
952
--
953
-- Table structure for table `taxon_determination`
954
--
955

    
956
/*!40101 SET @saved_cs_client     = @@character_set_client */;
957
/*!40101 SET character_set_client = utf8 */;
958
CREATE TABLE `taxon_determination` (
959
  `id` varbinary(767) NOT NULL,
960
  `taxon_observation` varbinary(767) NOT NULL,
961
  `identified_by` varbinary(767) DEFAULT NULL,
962
  `taxon_assertion` varbinary(767) NOT NULL,
963
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
964
  PRIMARY KEY (`id`),
965
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
966
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
967
  KEY `fk_taxon_determination_party_list1_idx` (`identified_by`),
968
  KEY `fk_taxon_determination_taxon_observation1_idx` (`taxon_observation`),
969
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
970
  CONSTRAINT `fk_taxon_determination_party_list1` FOREIGN KEY (`identified_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
971
  CONSTRAINT `fk_taxon_determination_taxon_observation1` FOREIGN KEY (`taxon_observation`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
972
  CONSTRAINT `fk_taxon_determination_sampling_event1` FOREIGN KEY (`id`) REFERENCES `sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
973
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
974
/*!40101 SET character_set_client = @saved_cs_client */;
975

    
976
--
977
-- Dumping data for table `taxon_determination`
978
--
979

    
980
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
981
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
982

    
983
--
984
-- Table structure for table `taxon_name`
985
--
986

    
987
/*!40101 SET @saved_cs_client     = @@character_set_client */;
988
/*!40101 SET character_set_client = utf8 */;
989
CREATE TABLE `taxon_name` (
990
  `id` varbinary(767) NOT NULL,
991
  `unique_name` varbinary(767) NOT NULL,
992
  `formal_name` varbinary(767) DEFAULT NULL,
993
  `taxon_name` varbinary(767) DEFAULT NULL,
994
  `author` varbinary(767) DEFAULT NULL,
995
  `common_name` varbinary(767) DEFAULT NULL,
996
  `rank` varbinary(767) DEFAULT NULL,
997
  PRIMARY KEY (`id`),
998
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
999
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1000
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
1001
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1002
/*!40101 SET character_set_client = @saved_cs_client */;
1003

    
1004
--
1005
-- Dumping data for table `taxon_name`
1006
--
1007

    
1008
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
1009
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
1010

    
1011
--
1012
-- Table structure for table `taxon_observation`
1013
--
1014

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

    
1037
--
1038
-- Dumping data for table `taxon_observation`
1039
--
1040

    
1041
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1042
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1043

    
1044
--
1045
-- Table structure for table `taxon_occurrence`
1046
--
1047

    
1048
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1049
/*!40101 SET character_set_client = utf8 */;
1050
CREATE TABLE `taxon_occurrence` (
1051
  `id` varbinary(767) NOT NULL,
1052
  `current_determination` varbinary(767) DEFAULT NULL,
1053
  `original_determination` varbinary(767) DEFAULT NULL,
1054
  PRIMARY KEY (`id`),
1055
  KEY `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination`),
1056
  KEY `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination`),
1057
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1` FOREIGN KEY (`original_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1058
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2` FOREIGN KEY (`current_determination`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1059
  CONSTRAINT `fk_taxon_occurrence_event1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1060
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
1061
/*!40101 SET character_set_client = @saved_cs_client */;
1062

    
1063
--
1064
-- Dumping data for table `taxon_occurrence`
1065
--
1066

    
1067
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1068
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1069

    
1070
--
1071
-- Table structure for table `taxon_path`
1072
--
1073

    
1074
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1075
/*!40101 SET character_set_client = utf8 */;
1076
CREATE TABLE `taxon_path` (
1077
  `id` varbinary(767) NOT NULL,
1078
  `family` varbinary(767) DEFAULT NULL,
1079
  `genus` varbinary(767) DEFAULT NULL,
1080
  `specific_epithet` varbinary(767) DEFAULT NULL,
1081
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1082
  PRIMARY KEY (`id`),
1083
  CONSTRAINT `fk_taxon_path_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1084
) 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)';
1085
/*!40101 SET character_set_client = @saved_cs_client */;
1086

    
1087
--
1088
-- Dumping data for table `taxon_path`
1089
--
1090

    
1091
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1092
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1093

    
1094
--
1095
-- Table structure for table `taxon_presence`
1096
--
1097

    
1098
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1099
/*!40101 SET character_set_client = utf8 */;
1100
CREATE TABLE `taxon_presence` (
1101
  `id` varbinary(767) NOT NULL,
1102
  `taxon_concept` varbinary(767) NOT NULL,
1103
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1104
  PRIMARY KEY (`id`),
1105
  KEY `fk_taxon_presence_taxon_name1_idx` (`taxon_concept`),
1106
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1107
  CONSTRAINT `fk_taxon_presence_taxon_name1` FOREIGN KEY (`taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1108
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_';
1109
/*!40101 SET character_set_client = @saved_cs_client */;
1110

    
1111
--
1112
-- Dumping data for table `taxon_presence`
1113
--
1114

    
1115
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1116
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1117

    
1118
--
1119
-- Table structure for table `taxon_scrub`
1120
--
1121

    
1122
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1123
/*!40101 SET character_set_client = utf8 */;
1124
CREATE TABLE `taxon_scrub` (
1125
  `id` varbinary(767) NOT NULL,
1126
  `input_string` varbinary(767) NOT NULL,
1127
  `parsed_taxon_assertion` varbinary(767) NOT NULL,
1128
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
1129
  `match_score` float DEFAULT NULL,
1130
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1131
  PRIMARY KEY (`id`),
1132
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
1133
  KEY `fk_taxon_scrub_taxon_assertion1_idx` (`parsed_taxon_assertion`),
1134
  KEY `fk_taxon_scrub_taxon_string1_idx` (`input_string`),
1135
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1136
  CONSTRAINT `fk_taxon_scrub_taxon_assertion1` FOREIGN KEY (`parsed_taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1137
  CONSTRAINT `fk_taxon_scrub_taxon_string1` FOREIGN KEY (`input_string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
1138
  CONSTRAINT `fk_taxon_scrub_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1139
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1140
/*!40101 SET character_set_client = @saved_cs_client */;
1141

    
1142
--
1143
-- Dumping data for table `taxon_scrub`
1144
--
1145

    
1146
/*!40000 ALTER TABLE `taxon_scrub` DISABLE KEYS */;
1147
/*!40000 ALTER TABLE `taxon_scrub` ENABLE KEYS */;
1148

    
1149
--
1150
-- Table structure for table `taxon_string`
1151
--
1152

    
1153
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1154
/*!40101 SET character_set_client = utf8 */;
1155
CREATE TABLE `taxon_string` (
1156
  `string` varbinary(767) NOT NULL,
1157
  PRIMARY KEY (`string`)
1158
) 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)';
1159
/*!40101 SET character_set_client = @saved_cs_client */;
1160

    
1161
--
1162
-- Dumping data for table `taxon_string`
1163
--
1164

    
1165
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1166
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1167
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1168

    
1169
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1170
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1171
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1172
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1173
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1174
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1175
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1176

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