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_geoplace1` FOREIGN KEY (`input_geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
272
  CONSTRAINT `fk_geovalidation_geoplace2` FOREIGN KEY (`scrubbed_geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
273
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
274
/*!40101 SET character_set_client = @saved_cs_client */;
275

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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