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
-- Current Database: `VegCore`
20
--
21

    
22
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `VegCore` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
23

    
24
USE `VegCore`;
25

    
26
--
27
-- Table structure for table `aggregate_observation`
28
--
29

    
30
/*!40101 SET @saved_cs_client     = @@character_set_client */;
31
/*!40101 SET character_set_client = utf8 */;
32
CREATE TABLE `aggregate_observation` (
33
  `id` varbinary(767) NOT NULL,
34
  `sampling_event` varbinary(767) NOT NULL,
35
  `occurrence_status` varbinary(767) DEFAULT NULL,
36
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
37
  PRIMARY KEY (`id`),
38
  KEY `fk_aggregate_observation_taxa_sampling_event1_idx` (`sampling_event`),
39
  CONSTRAINT `fk_aggregate_observation_taxa_sampling_event1` FOREIGN KEY (`sampling_event`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
40
  CONSTRAINT `fk_taxon_presence_taxon_determination10` FOREIGN KEY (`id`) REFERENCES `taxon_determination` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
41
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
42
/*!40101 SET character_set_client = @saved_cs_client */;
43

    
44
--
45
-- Dumping data for table `aggregate_observation`
46
--
47

    
48
/*!40000 ALTER TABLE `aggregate_observation` DISABLE KEYS */;
49
/*!40000 ALTER TABLE `aggregate_observation` ENABLE KEYS */;
50

    
51
--
52
-- Table structure for table `base_class`
53
--
54

    
55
/*!40101 SET @saved_cs_client     = @@character_set_client */;
56
/*!40101 SET character_set_client = utf8 */;
57
CREATE TABLE `base_class` (
58
  `id` varbinary(767) NOT NULL,
59
  `referenced_class` varbinary(767) NOT NULL,
60
  PRIMARY KEY (`id`),
61
  KEY `fk_base_class_referenced_class1_idx` (`referenced_class`),
62
  CONSTRAINT `fk_base_class_referenced_class1` FOREIGN KEY (`referenced_class`) REFERENCES `referenced_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
63
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
64
/*!40101 SET character_set_client = @saved_cs_client */;
65

    
66
--
67
-- Dumping data for table `base_class`
68
--
69

    
70
/*!40000 ALTER TABLE `base_class` DISABLE KEYS */;
71
/*!40000 ALTER TABLE `base_class` ENABLE KEYS */;
72

    
73
--
74
-- Table structure for table `collection`
75
--
76

    
77
/*!40101 SET @saved_cs_client     = @@character_set_client */;
78
/*!40101 SET character_set_client = utf8 */;
79
CREATE TABLE `collection` (
80
  `id` varbinary(767) NOT NULL,
81
  `institution` varbinary(767) NOT NULL,
82
  `name` varbinary(767) NOT NULL,
83
  PRIMARY KEY (`id`),
84
  UNIQUE KEY `collection_unique` (`institution`,`name`),
85
  KEY `fk_collection_organization1_idx` (`institution`),
86
  KEY `fk_collection_source1_idx` (`id`),
87
  CONSTRAINT `fk_collection_organization1` FOREIGN KEY (`institution`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
88
  CONSTRAINT `fk_collection_source1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
89
) 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)';
90
/*!40101 SET character_set_client = @saved_cs_client */;
91

    
92
--
93
-- Dumping data for table `collection`
94
--
95

    
96
/*!40000 ALTER TABLE `collection` DISABLE KEYS */;
97
/*!40000 ALTER TABLE `collection` ENABLE KEYS */;
98

    
99
--
100
-- Table structure for table `community`
101
--
102

    
103
/*!40101 SET @saved_cs_client     = @@character_set_client */;
104
/*!40101 SET character_set_client = utf8 */;
105
CREATE TABLE `community` (
106
  `id` varbinary(767) NOT NULL,
107
  `name` varbinary(767) NOT NULL,
108
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
109
  PRIMARY KEY (`id`),
110
  CONSTRAINT `fk_community_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
111
) 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]])';
112
/*!40101 SET character_set_client = @saved_cs_client */;
113

    
114
--
115
-- Dumping data for table `community`
116
--
117

    
118
/*!40000 ALTER TABLE `community` DISABLE KEYS */;
119
/*!40000 ALTER TABLE `community` ENABLE KEYS */;
120

    
121
--
122
-- Table structure for table `derived_class`
123
--
124

    
125
/*!40101 SET @saved_cs_client     = @@character_set_client */;
126
/*!40101 SET character_set_client = utf8 */;
127
CREATE TABLE `derived_class` (
128
  `id` varbinary(767) NOT NULL,
129
  PRIMARY KEY (`id`),
130
  CONSTRAINT `fk_derived_class_base_class1` FOREIGN KEY (`id`) REFERENCES `base_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
131
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
132
/*!40101 SET character_set_client = @saved_cs_client */;
133

    
134
--
135
-- Dumping data for table `derived_class`
136
--
137

    
138
/*!40000 ALTER TABLE `derived_class` DISABLE KEYS */;
139
/*!40000 ALTER TABLE `derived_class` ENABLE KEYS */;
140

    
141
--
142
-- Table structure for table `event`
143
--
144

    
145
/*!40101 SET @saved_cs_client     = @@character_set_client */;
146
/*!40101 SET character_set_client = utf8 */;
147
CREATE TABLE `event` (
148
  `id` varbinary(767) NOT NULL,
149
  `parent` varbinary(767) DEFAULT NULL,
150
  `name` varbinary(767) DEFAULT NULL,
151
  `date_range` varbinary(767) DEFAULT NULL,
152
  `place` varbinary(767) DEFAULT NULL,
153
  `participants` varbinary(767) DEFAULT NULL,
154
  PRIMARY KEY (`id`),
155
  KEY `fk_event_place1_idx` (`place`),
156
  KEY `fk_event1_idx` (`parent`),
157
  KEY `fk_event_party_list1_idx` (`participants`),
158
  CONSTRAINT `fk_event1` FOREIGN KEY (`parent`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
159
  CONSTRAINT `fk_event_party_list1` FOREIGN KEY (`participants`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
160
  CONSTRAINT `fk_event_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
161
  CONSTRAINT `fk_event_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
162
) 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)';
163
/*!40101 SET character_set_client = @saved_cs_client */;
164

    
165
--
166
-- Dumping data for table `event`
167
--
168

    
169
/*!40000 ALTER TABLE `event` DISABLE KEYS */;
170
/*!40000 ALTER TABLE `event` ENABLE KEYS */;
171

    
172
--
173
-- Table structure for table `geological_context`
174
--
175

    
176
/*!40101 SET @saved_cs_client     = @@character_set_client */;
177
/*!40101 SET character_set_client = utf8 */;
178
CREATE TABLE `geological_context` (
179
  `id` varbinary(767) NOT NULL,
180
  `name` varbinary(767) NOT NULL,
181
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
182
  PRIMARY KEY (`id`),
183
  CONSTRAINT `fk_geological_context_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
184
) 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)';
185
/*!40101 SET character_set_client = @saved_cs_client */;
186

    
187
--
188
-- Dumping data for table `geological_context`
189
--
190

    
191
/*!40000 ALTER TABLE `geological_context` DISABLE KEYS */;
192
/*!40000 ALTER TABLE `geological_context` ENABLE KEYS */;
193

    
194
--
195
-- Table structure for table `geopath`
196
--
197

    
198
/*!40101 SET @saved_cs_client     = @@character_set_client */;
199
/*!40101 SET character_set_client = utf8 */;
200
CREATE TABLE `geopath` (
201
  `id` varbinary(767) NOT NULL,
202
  `continent` varbinary(767) DEFAULT NULL,
203
  `country` varbinary(767) DEFAULT NULL,
204
  `state_province` varbinary(767) DEFAULT NULL,
205
  `county` varbinary(767) DEFAULT NULL,
206
  `municipality` varbinary(767) DEFAULT NULL,
207
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
208
  PRIMARY KEY (`id`)
209
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region';
210
/*!40101 SET character_set_client = @saved_cs_client */;
211

    
212
--
213
-- Dumping data for table `geopath`
214
--
215

    
216
/*!40000 ALTER TABLE `geopath` DISABLE KEYS */;
217
/*!40000 ALTER TABLE `geopath` ENABLE KEYS */;
218

    
219
--
220
-- Table structure for table `geoplace`
221
--
222

    
223
/*!40101 SET @saved_cs_client     = @@character_set_client */;
224
/*!40101 SET character_set_client = utf8 */;
225
CREATE TABLE `geoplace` (
226
  `id` varbinary(767) NOT NULL,
227
  `latitude_deg` varbinary(767) NOT NULL,
228
  `longitude_deg` varbinary(767) NOT NULL,
229
  `boundary_WKT` varbinary(767) NOT NULL DEFAULT 'point',
230
  `official_name` varbinary(767) DEFAULT NULL,
231
  PRIMARY KEY (`id`),
232
  CONSTRAINT `fk_geoplace_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
233
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point';
234
/*!40101 SET character_set_client = @saved_cs_client */;
235

    
236
--
237
-- Dumping data for table `geoplace`
238
--
239

    
240
/*!40000 ALTER TABLE `geoplace` DISABLE KEYS */;
241
/*!40000 ALTER TABLE `geoplace` ENABLE KEYS */;
242

    
243
--
244
-- Table structure for table `georeferencing`
245
--
246

    
247
/*!40101 SET @saved_cs_client     = @@character_set_client */;
248
/*!40101 SET character_set_client = utf8 */;
249
CREATE TABLE `georeferencing` (
250
  `id` varbinary(767) NOT NULL,
251
  `input_place` varbinary(767) NOT NULL,
252
  `geoplace` varbinary(767) DEFAULT NULL,
253
  `georeferenced_by` varbinary(767) DEFAULT NULL,
254
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
255
  PRIMARY KEY (`id`),
256
  KEY `fk_georef_place1_idx` (`input_place`),
257
  KEY `fk_georeferencing_party_list1_idx` (`georeferenced_by`),
258
  KEY `fk_georeferencing_geoplace1_idx` (`geoplace`),
259
  CONSTRAINT `fk_georeferencing_geoplace1` FOREIGN KEY (`geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
260
  CONSTRAINT `fk_georeferencing_party_list1` FOREIGN KEY (`georeferenced_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
261
  CONSTRAINT `fk_georef_place1` FOREIGN KEY (`input_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
262
  CONSTRAINT `fk_geovalidation_record100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
263
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='also stored GNRS results';
264
/*!40101 SET character_set_client = @saved_cs_client */;
265

    
266
--
267
-- Dumping data for table `georeferencing`
268
--
269

    
270
/*!40000 ALTER TABLE `georeferencing` DISABLE KEYS */;
271
/*!40000 ALTER TABLE `georeferencing` ENABLE KEYS */;
272

    
273
--
274
-- Table structure for table `geovalidatable_place`
275
--
276

    
277
/*!40101 SET @saved_cs_client     = @@character_set_client */;
278
/*!40101 SET character_set_client = utf8 */;
279
CREATE TABLE `geovalidatable_place` (
280
  `id` varbinary(767) NOT NULL,
281
  `parent_geoplace` varbinary(767) NOT NULL,
282
  PRIMARY KEY (`id`),
283
  KEY `fk_geovalidatable_place_geoplace1_idx` (`parent_geoplace`),
284
  CONSTRAINT `fk_geovalidatable_place_geoplace1` FOREIGN KEY (`parent_geoplace`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
285
  CONSTRAINT `fk_nested_geoplace_geoplace1` FOREIGN KEY (`id`) REFERENCES `geoplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
286
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores only scrubbed geoplaces (GADM places, and distinct point coordinates that GNRS says should be located within them)';
287
/*!40101 SET character_set_client = @saved_cs_client */;
288

    
289
--
290
-- Dumping data for table `geovalidatable_place`
291
--
292

    
293
/*!40000 ALTER TABLE `geovalidatable_place` DISABLE KEYS */;
294
/*!40000 ALTER TABLE `geovalidatable_place` ENABLE KEYS */;
295

    
296
--
297
-- Table structure for table `geovalidation`
298
--
299

    
300
/*!40101 SET @saved_cs_client     = @@character_set_client */;
301
/*!40101 SET character_set_client = utf8 */;
302
CREATE TABLE `geovalidation` (
303
  `id` varbinary(767) NOT NULL,
304
  `input_geoplace` varbinary(767) NOT NULL,
305
  `geovalid` tinyint(1) NOT NULL,
306
  `lat_long_domain_valid` tinyint(1) NOT NULL,
307
  `lat_long_in_place_ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
308
  `corrected_geoplace` varbinary(767) DEFAULT NULL,
309
  PRIMARY KEY (`id`),
310
  KEY `fk_geovalidation_geoplace1_idx` (`input_geoplace`),
311
  KEY `fk_geovalidation_geoplace2_idx` (`corrected_geoplace`),
312
  CONSTRAINT `fk_geovalidation_geoplace1` FOREIGN KEY (`input_geoplace`) REFERENCES `geovalidatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
313
  CONSTRAINT `fk_geovalidation_geoplace2` FOREIGN KEY (`corrected_geoplace`) REFERENCES `geovalidatable_place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
314
  CONSTRAINT `fk_geovalidation_georeferencing1` FOREIGN KEY (`id`) REFERENCES `georeferencing` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
315
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]';
316
/*!40101 SET character_set_client = @saved_cs_client */;
317

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

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

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

    
329
/*!40101 SET @saved_cs_client     = @@character_set_client */;
330
/*!40101 SET character_set_client = utf8 */;
331
CREATE TABLE `individual` (
332
  `id` varbinary(767) NOT NULL,
333
  `identifying_place` varbinary(767) DEFAULT NULL COMMENT 'subplace within plot. not specified for specimens since their coordinates are usually not precise enough to identify an individual.',
334
  `tag` varbinary(767) DEFAULT NULL,
335
  `tag_history` set('hstore') COLLATE utf8_bin DEFAULT NULL,
336
  PRIMARY KEY (`id`),
337
  KEY `fk_individual_subplace1_idx` (`identifying_place`),
338
  CONSTRAINT `fk_individual_record1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
339
  CONSTRAINT `fk_individual_subplace1` FOREIGN KEY (`identifying_place`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
340
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism';
341
/*!40101 SET character_set_client = @saved_cs_client */;
342

    
343
--
344
-- Dumping data for table `individual`
345
--
346

    
347
/*!40000 ALTER TABLE `individual` DISABLE KEYS */;
348
/*!40000 ALTER TABLE `individual` ENABLE KEYS */;
349

    
350
--
351
-- Table structure for table `individual_count`
352
--
353

    
354
/*!40101 SET @saved_cs_client     = @@character_set_client */;
355
/*!40101 SET character_set_client = utf8 */;
356
CREATE TABLE `individual_count` (
357
  `id` varbinary(767) NOT NULL,
358
  `taxon` varbinary(767) NOT NULL,
359
  `size_class` varbinary(767) DEFAULT NULL,
360
  `aggregating_traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
361
  `count` int(11) DEFAULT NULL,
362
  PRIMARY KEY (`id`),
363
  KEY `fk_aggregate_observation_taxon_presence1_idx` (`taxon`),
364
  KEY `fk_aggregate_observation_size_class1_idx` (`size_class`),
365
  CONSTRAINT `fk_individual_count_taxon_presence1` FOREIGN KEY (`id`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
366
  CONSTRAINT `fk_aggregate_observation_size_class1` FOREIGN KEY (`size_class`) REFERENCES `size_class` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
367
  CONSTRAINT `fk_aggregate_observation_taxon_presence1` FOREIGN KEY (`taxon`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
368
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stemCount.VegBank.vegpath.org';
369
/*!40101 SET character_set_client = @saved_cs_client */;
370

    
371
--
372
-- Dumping data for table `individual_count`
373
--
374

    
375
/*!40000 ALTER TABLE `individual_count` DISABLE KEYS */;
376
/*!40000 ALTER TABLE `individual_count` ENABLE KEYS */;
377

    
378
--
379
-- Table structure for table `individual_observation`
380
--
381

    
382
/*!40101 SET @saved_cs_client     = @@character_set_client */;
383
/*!40101 SET character_set_client = utf8 */;
384
CREATE TABLE `individual_observation` (
385
  `id` varbinary(767) NOT NULL,
386
  `place_observed_at` varbinary(767) DEFAULT NULL,
387
  `individual` varbinary(767) DEFAULT NULL COMMENT 'optional because an individual_observation cannot have an associated individual unless the individual is traceable to a specific plant',
388
  `code` varbinary(767) DEFAULT NULL,
389
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
390
  PRIMARY KEY (`id`),
391
  KEY `fk_individual_observation_individual1_idx` (`individual`),
392
  KEY `fk_individual_observation_place1_idx` (`place_observed_at`),
393
  CONSTRAINT `fk_individual_observation_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
394
  CONSTRAINT `fk_individual_observation_place1` FOREIGN KEY (`place_observed_at`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
395
  CONSTRAINT `fk_individual_observation_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
396
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]';
397
/*!40101 SET character_set_client = @saved_cs_client */;
398

    
399
--
400
-- Dumping data for table `individual_observation`
401
--
402

    
403
/*!40000 ALTER TABLE `individual_observation` DISABLE KEYS */;
404
/*!40000 ALTER TABLE `individual_observation` ENABLE KEYS */;
405

    
406
--
407
-- Table structure for table `layer`
408
--
409

    
410
/*!40101 SET @saved_cs_client     = @@character_set_client */;
411
/*!40101 SET character_set_client = utf8 */;
412
CREATE TABLE `layer` (
413
  `id` varbinary(767) NOT NULL,
414
  `name` varbinary(767) NOT NULL,
415
  `height_min_m` varbinary(767) DEFAULT NULL,
416
  `height_max_m` varbinary(767) DEFAULT NULL,
417
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
418
  PRIMARY KEY (`id`),
419
  CONSTRAINT `fk_layer_stratum1` FOREIGN KEY (`id`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
420
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratumType.VegBank.vegpath.org';
421
/*!40101 SET character_set_client = @saved_cs_client */;
422

    
423
--
424
-- Dumping data for table `layer`
425
--
426

    
427
/*!40000 ALTER TABLE `layer` DISABLE KEYS */;
428
/*!40000 ALTER TABLE `layer` ENABLE KEYS */;
429

    
430
--
431
-- Table structure for table `method`
432
--
433

    
434
/*!40101 SET @saved_cs_client     = @@character_set_client */;
435
/*!40101 SET character_set_client = utf8 */;
436
CREATE TABLE `method` (
437
  `id` varbinary(767) NOT NULL,
438
  `parent` varbinary(767) DEFAULT NULL,
439
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
440
  PRIMARY KEY (`id`),
441
  KEY `fk_method_method1_idx` (`parent`),
442
  CONSTRAINT `fk_method_method1` FOREIGN KEY (`parent`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
443
  CONSTRAINT `fk_method_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
444
) 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)';
445
/*!40101 SET character_set_client = @saved_cs_client */;
446

    
447
--
448
-- Dumping data for table `method`
449
--
450

    
451
/*!40000 ALTER TABLE `method` DISABLE KEYS */;
452
/*!40000 ALTER TABLE `method` ENABLE KEYS */;
453

    
454
--
455
-- Table structure for table `organization`
456
--
457

    
458
/*!40101 SET @saved_cs_client     = @@character_set_client */;
459
/*!40101 SET character_set_client = utf8 */;
460
CREATE TABLE `organization` (
461
  `id` varbinary(767) NOT NULL,
462
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
463
  PRIMARY KEY (`id`),
464
  CONSTRAINT `fk_organization_party1` FOREIGN KEY (`id`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
465
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
466
/*!40101 SET character_set_client = @saved_cs_client */;
467

    
468
--
469
-- Dumping data for table `organization`
470
--
471

    
472
/*!40000 ALTER TABLE `organization` DISABLE KEYS */;
473
/*!40000 ALTER TABLE `organization` ENABLE KEYS */;
474

    
475
--
476
-- Table structure for table `party`
477
--
478

    
479
/*!40101 SET @saved_cs_client     = @@character_set_client */;
480
/*!40101 SET character_set_client = utf8 */;
481
CREATE TABLE `party` (
482
  `id` varbinary(767) NOT NULL,
483
  `organization` varbinary(767) DEFAULT NULL,
484
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
485
  PRIMARY KEY (`id`),
486
  KEY `fk_party_organization1_idx` (`organization`),
487
  CONSTRAINT `fk_collection_source10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
488
  CONSTRAINT `fk_party_organization1` FOREIGN KEY (`organization`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
489
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
490
/*!40101 SET character_set_client = @saved_cs_client */;
491

    
492
--
493
-- Dumping data for table `party`
494
--
495

    
496
/*!40000 ALTER TABLE `party` DISABLE KEYS */;
497
/*!40000 ALTER TABLE `party` ENABLE KEYS */;
498

    
499
--
500
-- Table structure for table `party_list`
501
--
502

    
503
/*!40101 SET @saved_cs_client     = @@character_set_client */;
504
/*!40101 SET character_set_client = utf8 */;
505
CREATE TABLE `party_list` (
506
  `id` varbinary(767) NOT NULL,
507
  `count` int(11) NOT NULL,
508
  PRIMARY KEY (`id`),
509
  CONSTRAINT `fk_collection_source100` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
510
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
511
/*!40101 SET character_set_client = @saved_cs_client */;
512

    
513
--
514
-- Dumping data for table `party_list`
515
--
516

    
517
/*!40000 ALTER TABLE `party_list` DISABLE KEYS */;
518
/*!40000 ALTER TABLE `party_list` ENABLE KEYS */;
519

    
520
--
521
-- Table structure for table `party_list_entry`
522
--
523

    
524
/*!40101 SET @saved_cs_client     = @@character_set_client */;
525
/*!40101 SET character_set_client = utf8 */;
526
CREATE TABLE `party_list_entry` (
527
  `id` varbinary(767) NOT NULL,
528
  `entry` varbinary(767) NOT NULL,
529
  `role` varbinary(767) DEFAULT NULL,
530
  `sort_order` int(11) DEFAULT NULL,
531
  PRIMARY KEY (`id`,`entry`),
532
  KEY `fk_party_list_has_party_party1_idx` (`entry`),
533
  KEY `fk_party_list_has_party_party_list1_idx` (`id`),
534
  CONSTRAINT `fk_party_list_has_party_party_list1` FOREIGN KEY (`id`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
535
  CONSTRAINT `fk_party_list_has_party_party1` FOREIGN KEY (`entry`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
536
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
537
/*!40101 SET character_set_client = @saved_cs_client */;
538

    
539
--
540
-- Dumping data for table `party_list_entry`
541
--
542

    
543
/*!40000 ALTER TABLE `party_list_entry` DISABLE KEYS */;
544
/*!40000 ALTER TABLE `party_list_entry` ENABLE KEYS */;
545

    
546
--
547
-- Table structure for table `place`
548
--
549

    
550
/*!40101 SET @saved_cs_client     = @@character_set_client */;
551
/*!40101 SET character_set_client = utf8 */;
552
CREATE TABLE `place` (
553
  `id` varbinary(767) NOT NULL,
554
  `parent` varbinary(767) DEFAULT NULL,
555
  `rank` varbinary(767) DEFAULT NULL,
556
  `name` varbinary(767) DEFAULT NULL,
557
  `geopath` varbinary(767) DEFAULT NULL,
558
  `locality` varbinary(767) DEFAULT NULL,
559
  `verbatim` set('hstore') COLLATE utf8_bin DEFAULT NULL COMMENT 'for verbatim coordinates, etc.',
560
  PRIMARY KEY (`id`),
561
  KEY `fk_place1_idx` (`parent`),
562
  KEY `fk_place_geopath1_idx` (`geopath`),
563
  CONSTRAINT `fk_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
564
  CONSTRAINT `fk_place_geopath1` FOREIGN KEY (`geopath`) REFERENCES `geopath` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
565
  CONSTRAINT `fk_place_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
566
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point';
567
/*!40101 SET character_set_client = @saved_cs_client */;
568

    
569
--
570
-- Dumping data for table `place`
571
--
572

    
573
/*!40000 ALTER TABLE `place` DISABLE KEYS */;
574
/*!40000 ALTER TABLE `place` ENABLE KEYS */;
575

    
576
--
577
-- Table structure for table `place_observation`
578
--
579

    
580
/*!40101 SET @saved_cs_client     = @@character_set_client */;
581
/*!40101 SET character_set_client = utf8 */;
582
CREATE TABLE `place_observation` (
583
  `id` varbinary(767) NOT NULL,
584
  `place` varbinary(767) NOT NULL,
585
  `elevation_m` double DEFAULT NULL,
586
  `slope_incline_deg` double DEFAULT NULL,
587
  `slope_direction_deg_N` double DEFAULT NULL,
588
  `geological_context` varbinary(767) DEFAULT NULL,
589
  `community` varbinary(767) DEFAULT NULL,
590
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
591
  PRIMARY KEY (`id`),
592
  KEY `fk_place_observation_place1_idx` (`place`),
593
  KEY `fk_place_observation_geological_context1_idx` (`geological_context`),
594
  KEY `fk_place_observation_community1_idx` (`community`),
595
  CONSTRAINT `fk_place_observation_community1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
596
  CONSTRAINT `fk_place_observation_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
597
  CONSTRAINT `fk_place_observation_geological_context1` FOREIGN KEY (`geological_context`) REFERENCES `geological_context` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
598
  CONSTRAINT `fk_place_observation_place1` FOREIGN KEY (`place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
599
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]';
600
/*!40101 SET character_set_client = @saved_cs_client */;
601

    
602
--
603
-- Dumping data for table `place_observation`
604
--
605

    
606
/*!40000 ALTER TABLE `place_observation` DISABLE KEYS */;
607
/*!40000 ALTER TABLE `place_observation` ENABLE KEYS */;
608

    
609
--
610
-- Table structure for table `plot`
611
--
612

    
613
/*!40101 SET @saved_cs_client     = @@character_set_client */;
614
/*!40101 SET character_set_client = utf8 */;
615
CREATE TABLE `plot` (
616
  `id` varbinary(767) NOT NULL,
617
  `name` varbinary(767) DEFAULT NULL,
618
  `area_m2` double DEFAULT NULL,
619
  `shape` varbinary(767) DEFAULT NULL,
620
  `length_m` varbinary(767) DEFAULT NULL,
621
  `width_m` varbinary(767) DEFAULT NULL,
622
  `azimuth_deg_N` varbinary(767) DEFAULT NULL,
623
  `boundary_WKT` varbinary(767) DEFAULT NULL,
624
  `dimensions` set('hstore') COLLATE utf8_bin DEFAULT NULL,
625
  PRIMARY KEY (`id`),
626
  CONSTRAINT `fk_subplot_place1` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
627
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
628
/*!40101 SET character_set_client = @saved_cs_client */;
629

    
630
--
631
-- Dumping data for table `plot`
632
--
633

    
634
/*!40000 ALTER TABLE `plot` DISABLE KEYS */;
635
/*!40000 ALTER TABLE `plot` ENABLE KEYS */;
636

    
637
--
638
-- Table structure for table `project`
639
--
640

    
641
/*!40101 SET @saved_cs_client     = @@character_set_client */;
642
/*!40101 SET character_set_client = utf8 */;
643
CREATE TABLE `project` (
644
  `id` varbinary(767) NOT NULL,
645
  `name` varbinary(767) NOT NULL,
646
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
647
  PRIMARY KEY (`id`),
648
  CONSTRAINT `fk_project_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
649
) 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)';
650
/*!40101 SET character_set_client = @saved_cs_client */;
651

    
652
--
653
-- Dumping data for table `project`
654
--
655

    
656
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
657
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
658

    
659
--
660
-- Table structure for table `record`
661
--
662

    
663
/*!40101 SET @saved_cs_client     = @@character_set_client */;
664
/*!40101 SET character_set_client = utf8 */;
665
CREATE TABLE `record` (
666
  `id` varbinary(767) NOT NULL,
667
  `source` varbinary(767) NOT NULL,
668
  `source_id_scope` varbinary(767) DEFAULT NULL,
669
  `source_record_id` varbinary(767) DEFAULT NULL,
670
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
671
  PRIMARY KEY (`id`),
672
  UNIQUE KEY `record_unique` (`source`,`source_id_scope`,`source_record_id`),
673
  KEY `fk_record_source1_idx` (`source`),
674
  CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
675
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
676
/*!40101 SET character_set_client = @saved_cs_client */;
677

    
678
--
679
-- Dumping data for table `record`
680
--
681

    
682
/*!40000 ALTER TABLE `record` DISABLE KEYS */;
683
/*!40000 ALTER TABLE `record` ENABLE KEYS */;
684

    
685
--
686
-- Table structure for table `referenced_class`
687
--
688

    
689
/*!40101 SET @saved_cs_client     = @@character_set_client */;
690
/*!40101 SET character_set_client = utf8 */;
691
CREATE TABLE `referenced_class` (
692
  `id` varbinary(767) NOT NULL,
693
  PRIMARY KEY (`id`),
694
  CONSTRAINT `fk_example_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
695
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
696
/*!40101 SET character_set_client = @saved_cs_client */;
697

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

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

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

    
709
/*!40101 SET @saved_cs_client     = @@character_set_client */;
710
/*!40101 SET character_set_client = utf8 */;
711
CREATE TABLE `relationship` (
712
  `id` varbinary(767) NOT NULL,
713
  `record` varbinary(767) NOT NULL,
714
  `related_record` varbinary(767) NOT NULL,
715
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
716
  PRIMARY KEY (`id`),
717
  KEY `fk_relationship_record1_idx` (`record`),
718
  KEY `fk_relationship_related_record_idx` (`related_record`),
719
  CONSTRAINT `fk_relationship_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
720
  CONSTRAINT `fk_relationship_record2` FOREIGN KEY (`record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
721
  CONSTRAINT `fk_relationship_related_record` FOREIGN KEY (`related_record`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
722
) 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)';
723
/*!40101 SET character_set_client = @saved_cs_client */;
724

    
725
--
726
-- Dumping data for table `relationship`
727
--
728

    
729
/*!40000 ALTER TABLE `relationship` DISABLE KEYS */;
730
/*!40000 ALTER TABLE `relationship` ENABLE KEYS */;
731

    
732
--
733
-- Table structure for table `reobservable`
734
--
735

    
736
/*!40101 SET @saved_cs_client     = @@character_set_client */;
737
/*!40101 SET character_set_client = utf8 */;
738
CREATE TABLE `reobservable` (
739
  `id` varbinary(767) NOT NULL,
740
  `original_observation` varbinary(767) DEFAULT NULL,
741
  PRIMARY KEY (`id`),
742
  KEY `fk_reobservable_taxon_determination1_idx` (`original_observation`),
743
  CONSTRAINT `fk_reobservable_taxon_determination1` FOREIGN KEY (`original_observation`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
744
  CONSTRAINT `fk_reobservable_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
745
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made';
746
/*!40101 SET character_set_client = @saved_cs_client */;
747

    
748
--
749
-- Dumping data for table `reobservable`
750
--
751

    
752
/*!40000 ALTER TABLE `reobservable` DISABLE KEYS */;
753
/*!40000 ALTER TABLE `reobservable` ENABLE KEYS */;
754

    
755
--
756
-- Table structure for table `reobservable_presence`
757
--
758

    
759
/*!40101 SET @saved_cs_client     = @@character_set_client */;
760
/*!40101 SET character_set_client = utf8 */;
761
CREATE TABLE `reobservable_presence` (
762
  `id` varbinary(767) NOT NULL,
763
  `voucher` varbinary(767) NOT NULL,
764
  PRIMARY KEY (`id`),
765
  KEY `fk_reobservable_presence_reobservable2_idx` (`voucher`),
766
  CONSTRAINT `fk_reobservable_presence_taxon_presence1` FOREIGN KEY (`id`) REFERENCES `taxon_presence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
767
  CONSTRAINT `fk_reobservable_presence_reobservable1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
768
  CONSTRAINT `fk_reobservable_presence_reobservable2` FOREIGN KEY (`voucher`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
769
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
770
/*!40101 SET character_set_client = @saved_cs_client */;
771

    
772
--
773
-- Dumping data for table `reobservable_presence`
774
--
775

    
776
/*!40000 ALTER TABLE `reobservable_presence` DISABLE KEYS */;
777
/*!40000 ALTER TABLE `reobservable_presence` ENABLE KEYS */;
778

    
779
--
780
-- Table structure for table `size_class`
781
--
782

    
783
/*!40101 SET @saved_cs_client     = @@character_set_client */;
784
/*!40101 SET character_set_client = utf8 */;
785
CREATE TABLE `size_class` (
786
  `id` varbinary(767) NOT NULL,
787
  `diameter_min_m` double NOT NULL,
788
  `diameter_max_m` double NOT NULL,
789
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
790
  PRIMARY KEY (`id`),
791
  CONSTRAINT `fk_layer_stratum10` FOREIGN KEY (`id`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
792
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
793
/*!40101 SET character_set_client = @saved_cs_client */;
794

    
795
--
796
-- Dumping data for table `size_class`
797
--
798

    
799
/*!40000 ALTER TABLE `size_class` DISABLE KEYS */;
800
/*!40000 ALTER TABLE `size_class` ENABLE KEYS */;
801

    
802
--
803
-- Table structure for table `soil_observation`
804
--
805

    
806
/*!40101 SET @saved_cs_client     = @@character_set_client */;
807
/*!40101 SET character_set_client = utf8 */;
808
CREATE TABLE `soil_observation` (
809
  `id` varbinary(767) NOT NULL,
810
  `place_observation` varbinary(767) NOT NULL,
811
  `measurement_spot` varbinary(767) DEFAULT NULL,
812
  `observations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
813
  PRIMARY KEY (`id`),
814
  KEY `fk_soil_observation_place_observation1_idx` (`place_observation`),
815
  KEY `fk_soil_observation_subplace1_idx` (`measurement_spot`),
816
  CONSTRAINT `fk_soil_observation_place_observation1` FOREIGN KEY (`place_observation`) REFERENCES `place_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
817
  CONSTRAINT `fk_soil_observation_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
818
  CONSTRAINT `fk_soil_observation_subplace1` FOREIGN KEY (`measurement_spot`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
819
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil';
820
/*!40101 SET character_set_client = @saved_cs_client */;
821

    
822
--
823
-- Dumping data for table `soil_observation`
824
--
825

    
826
/*!40000 ALTER TABLE `soil_observation` DISABLE KEYS */;
827
/*!40000 ALTER TABLE `soil_observation` ENABLE KEYS */;
828

    
829
--
830
-- Table structure for table `source`
831
--
832

    
833
/*!40101 SET @saved_cs_client     = @@character_set_client */;
834
/*!40101 SET character_set_client = utf8 */;
835
CREATE TABLE `source` (
836
  `id` varbinary(767) NOT NULL,
837
  `parent` varbinary(767) DEFAULT NULL,
838
  `name` varbinary(767) NOT NULL,
839
  `first_publisher` varbinary(767) DEFAULT NULL,
840
  `owner` varbinary(767) DEFAULT NULL,
841
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
842
  PRIMARY KEY (`id`),
843
  UNIQUE KEY `source_unique` (`parent`,`name`),
844
  KEY `fk_source1_idx` (`parent`),
845
  KEY `fk_source_party1_idx` (`owner`),
846
  KEY `fk_source_party2_idx` (`first_publisher`),
847
  CONSTRAINT `fk_source1` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
848
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`owner`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
849
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
850
) 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)';
851
/*!40101 SET character_set_client = @saved_cs_client */;
852

    
853
--
854
-- Dumping data for table `source`
855
--
856

    
857
/*!40000 ALTER TABLE `source` DISABLE KEYS */;
858
/*!40000 ALTER TABLE `source` ENABLE KEYS */;
859

    
860
--
861
-- Table structure for table `specimen`
862
--
863

    
864
/*!40101 SET @saved_cs_client     = @@character_set_client */;
865
/*!40101 SET character_set_client = utf8 */;
866
CREATE TABLE `specimen` (
867
  `id` varbinary(767) NOT NULL,
868
  `individual` varbinary(767) DEFAULT NULL,
869
  `individual_observation` varbinary(767) DEFAULT NULL COMMENT 'stores observations about the plant the specimen was collected from. some specimens may not be traceable to a reobservable individual, but will still have these plant observations. the collection_event should be set to this field when provided.',
870
  `code_in_individual` varbinary(767) DEFAULT NULL COMMENT 'can also be within the individual_observation if no reobservable individual is available',
871
  `collection_event` varbinary(767) DEFAULT NULL,
872
  `orig_collection` varbinary(767) DEFAULT NULL,
873
  `barcode` varbinary(767) DEFAULT NULL,
874
  `accession_number` varbinary(767) DEFAULT NULL,
875
  `defining_data` set('hstore') COLLATE utf8_bin DEFAULT NULL COMMENT 'of the observations made about the specimen in individual_observation.traits, this stores the subset that can be used to make a taxonomic redetermination. for a digital-only specimen, this would be the information that comprises the specimen (e.g. a photo, a sketch, or a description that is detailed enough to be able to make a redetermination). note that a taxon_presence without a physical voucher can still qualify as reobservable if a detailed description of it is provided here.',
876
  `specimenholder_institutions` varbinary(767) DEFAULT NULL,
877
  `current_collection` varbinary(767) DEFAULT NULL,
878
  `owner_collection` varbinary(767) DEFAULT NULL,
879
  PRIMARY KEY (`id`),
880
  UNIQUE KEY `specimen_unique_in_individual` (`individual`,`code_in_individual`),
881
  UNIQUE KEY `specimen_unique_by_collection_event` (`collection_event`),
882
  UNIQUE KEY `specimen_unique_in_collection_by_barcode` (`orig_collection`,`barcode`),
883
  UNIQUE KEY `specimen_unique_in_collection_by_accession_number` (`orig_collection`,`accession_number`),
884
  UNIQUE KEY `specimen_unique_in_individual_observation` (`individual_observation`,`code_in_individual`),
885
  KEY `fk_specimen_collection1_idx` (`orig_collection`),
886
  KEY `fk_specimen_taxon_observation1_idx` (`collection_event`),
887
  KEY `fk_specimen_individual1_idx` (`individual`),
888
  KEY `fk_specimen_collection2_idx` (`current_collection`),
889
  KEY `fk_specimen_organization3_idx` (`owner_collection`),
890
  KEY `fk_specimen_party_list1_idx` (`specimenholder_institutions`),
891
  KEY `fk_specimen_individual_observation1_idx` (`individual_observation`),
892
  CONSTRAINT `fk_specimen_collection1` FOREIGN KEY (`orig_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
893
  CONSTRAINT `fk_specimen_collection2` FOREIGN KEY (`current_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
894
  CONSTRAINT `fk_specimen_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
895
  CONSTRAINT `fk_specimen_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
896
  CONSTRAINT `fk_specimen_organization3` FOREIGN KEY (`owner_collection`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
897
  CONSTRAINT `fk_specimen_party_list1` FOREIGN KEY (`specimenholder_institutions`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
898
  CONSTRAINT `fk_specimen_taxon_observation1` FOREIGN KEY (`collection_event`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
899
  CONSTRAINT `fk_specimen_taxon_occurrence1` FOREIGN KEY (`id`) REFERENCES `reobservable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
900
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='something collected from a plant. this can be a physical "part of a plant" ("Wikipedia":http://en.wikipedia.org/wiki/Specimen), or a picture or description of the plant. when there are multiple specimen replicates (copies) of a specimen, each gets its own specimen_observation pointing to the same specimen.';
901
/*!40101 SET character_set_client = @saved_cs_client */;
902

    
903
--
904
-- Dumping data for table `specimen`
905
--
906

    
907
/*!40000 ALTER TABLE `specimen` DISABLE KEYS */;
908
/*!40000 ALTER TABLE `specimen` ENABLE KEYS */;
909

    
910
--
911
-- Table structure for table `specimen_observation`
912
--
913

    
914
/*!40101 SET @saved_cs_client     = @@character_set_client */;
915
/*!40101 SET character_set_client = utf8 */;
916
CREATE TABLE `specimen_observation` (
917
  `id` varbinary(767) NOT NULL,
918
  `specimen` varbinary(767) NOT NULL,
919
  `description` varbinary(767) DEFAULT NULL,
920
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
921
  PRIMARY KEY (`id`),
922
  KEY `fk_specimen_observation_specimen1_idx` (`specimen`),
923
  CONSTRAINT `fk_specimen_observation_specimen1` FOREIGN KEY (`specimen`) REFERENCES `specimen` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
924
  CONSTRAINT `fk_specimen_taxon_occurrence10` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
925
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
926
/*!40101 SET character_set_client = @saved_cs_client */;
927

    
928
--
929
-- Dumping data for table `specimen_observation`
930
--
931

    
932
/*!40000 ALTER TABLE `specimen_observation` DISABLE KEYS */;
933
/*!40000 ALTER TABLE `specimen_observation` ENABLE KEYS */;
934

    
935
--
936
-- Table structure for table `stem`
937
--
938

    
939
/*!40101 SET @saved_cs_client     = @@character_set_client */;
940
/*!40101 SET character_set_client = utf8 */;
941
CREATE TABLE `stem` (
942
  `id` varbinary(767) NOT NULL,
943
  `individual` varbinary(767) DEFAULT NULL,
944
  PRIMARY KEY (`id`),
945
  KEY `fk_stem_individual1_idx` (`individual`),
946
  CONSTRAINT `fk_stem_individual1` FOREIGN KEY (`individual`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
947
  CONSTRAINT `fk_stem_individual2` FOREIGN KEY (`id`) REFERENCES `individual` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
948
) 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)';
949
/*!40101 SET character_set_client = @saved_cs_client */;
950

    
951
--
952
-- Dumping data for table `stem`
953
--
954

    
955
/*!40000 ALTER TABLE `stem` DISABLE KEYS */;
956
/*!40000 ALTER TABLE `stem` ENABLE KEYS */;
957

    
958
--
959
-- Table structure for table `stem_observation`
960
--
961

    
962
/*!40101 SET @saved_cs_client     = @@character_set_client */;
963
/*!40101 SET character_set_client = utf8 */;
964
CREATE TABLE `stem_observation` (
965
  `id` varbinary(767) NOT NULL,
966
  `individual_observation` varbinary(767) DEFAULT NULL,
967
  `stem` varbinary(767) DEFAULT NULL,
968
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
969
  PRIMARY KEY (`id`),
970
  UNIQUE KEY `stem_observation_unique` (`individual_observation`,`stem`),
971
  KEY `fk_stem_observation_individual_observation1_idx` (`individual_observation`),
972
  KEY `fk_stem_observation_stem1_idx` (`stem`),
973
  CONSTRAINT `fk_stem_observation_individual_observation1` FOREIGN KEY (`individual_observation`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
974
  CONSTRAINT `fk_stem_observation_individual_observation2` FOREIGN KEY (`id`) REFERENCES `individual_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
975
  CONSTRAINT `fk_stem_observation_stem1` FOREIGN KEY (`stem`) REFERENCES `stem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
976
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]';
977
/*!40101 SET character_set_client = @saved_cs_client */;
978

    
979
--
980
-- Dumping data for table `stem_observation`
981
--
982

    
983
/*!40000 ALTER TABLE `stem_observation` DISABLE KEYS */;
984
/*!40000 ALTER TABLE `stem_observation` ENABLE KEYS */;
985

    
986
--
987
-- Table structure for table `stratum`
988
--
989

    
990
/*!40101 SET @saved_cs_client     = @@character_set_client */;
991
/*!40101 SET character_set_client = utf8 */;
992
CREATE TABLE `stratum` (
993
  `id` varbinary(767) NOT NULL,
994
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
995
  PRIMARY KEY (`id`),
996
  CONSTRAINT `fk_place_path_record10` FOREIGN KEY (`id`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
997
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratumType.VegBank.vegpath.org';
998
/*!40101 SET character_set_client = @saved_cs_client */;
999

    
1000
--
1001
-- Dumping data for table `stratum`
1002
--
1003

    
1004
/*!40000 ALTER TABLE `stratum` DISABLE KEYS */;
1005
/*!40000 ALTER TABLE `stratum` ENABLE KEYS */;
1006

    
1007
--
1008
-- Table structure for table `stratum_event`
1009
--
1010

    
1011
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1012
/*!40101 SET character_set_client = utf8 */;
1013
CREATE TABLE `stratum_event` (
1014
  `id` varbinary(767) NOT NULL,
1015
  `parent_event` varbinary(767) NOT NULL,
1016
  `stratum` varbinary(767) NOT NULL,
1017
  PRIMARY KEY (`id`),
1018
  KEY `fk_stratum_event_stratum1_idx` (`stratum`),
1019
  KEY `fk_stratum_event_sampling_event2_idx` (`parent_event`),
1020
  CONSTRAINT `fk_stratum_event_sampling_event1` FOREIGN KEY (`id`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1021
  CONSTRAINT `fk_stratum_event_sampling_event2` FOREIGN KEY (`parent_event`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1022
  CONSTRAINT `fk_stratum_event_stratum1` FOREIGN KEY (`stratum`) REFERENCES `stratum` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1023
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= stratum.VegBank.vegpath.org (which was confusingly named)';
1024
/*!40101 SET character_set_client = @saved_cs_client */;
1025

    
1026
--
1027
-- Dumping data for table `stratum_event`
1028
--
1029

    
1030
/*!40000 ALTER TABLE `stratum_event` DISABLE KEYS */;
1031
/*!40000 ALTER TABLE `stratum_event` ENABLE KEYS */;
1032

    
1033
--
1034
-- Table structure for table `subplace`
1035
--
1036

    
1037
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1038
/*!40101 SET character_set_client = utf8 */;
1039
CREATE TABLE `subplace` (
1040
  `id` varbinary(767) NOT NULL,
1041
  `parent` varbinary(767) NOT NULL,
1042
  `x_m` double DEFAULT NULL,
1043
  `y_m` double DEFAULT NULL,
1044
  `coords` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1045
  PRIMARY KEY (`id`),
1046
  KEY `fk_rel_place_place1_idx` (`parent`),
1047
  CONSTRAINT `fk_rel_place_place1` FOREIGN KEY (`parent`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1048
  CONSTRAINT `fk_subplot_place2` FOREIGN KEY (`id`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1049
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores plot elements such as subplots ("subplot, line, or any other subsample  or subdivision of plot" ("SALVIAS":http://salvias.net/Documents/salvias_data_dictionary.html#Plot_data/subplot))';
1050
/*!40101 SET character_set_client = @saved_cs_client */;
1051

    
1052
--
1053
-- Dumping data for table `subplace`
1054
--
1055

    
1056
/*!40000 ALTER TABLE `subplace` DISABLE KEYS */;
1057
/*!40000 ALTER TABLE `subplace` ENABLE KEYS */;
1058

    
1059
--
1060
-- Table structure for table `subplot`
1061
--
1062

    
1063
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1064
/*!40101 SET character_set_client = utf8 */;
1065
CREATE TABLE `subplot` (
1066
  `id` varbinary(767) NOT NULL,
1067
  `parent_plot` varbinary(767) NOT NULL,
1068
  PRIMARY KEY (`id`),
1069
  KEY `fk_subplot_plot2_idx` (`parent_plot`),
1070
  CONSTRAINT `fk_subplot_plot1` FOREIGN KEY (`id`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1071
  CONSTRAINT `fk_subplot_plot2` FOREIGN KEY (`parent_plot`) REFERENCES `plot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1072
  CONSTRAINT `fk_subplot_rel_place1` FOREIGN KEY (`id`) REFERENCES `subplace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1073
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1074
/*!40101 SET character_set_client = @saved_cs_client */;
1075

    
1076
--
1077
-- Dumping data for table `subplot`
1078
--
1079

    
1080
/*!40000 ALTER TABLE `subplot` DISABLE KEYS */;
1081
/*!40000 ALTER TABLE `subplot` ENABLE KEYS */;
1082

    
1083
--
1084
-- Table structure for table `taxa_sampling_event`
1085
--
1086

    
1087
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1088
/*!40101 SET character_set_client = utf8 */;
1089
CREATE TABLE `taxa_sampling_event` (
1090
  `id` varbinary(767) NOT NULL,
1091
  `within_place` varbinary(767) NOT NULL,
1092
  `project` varbinary(767) DEFAULT NULL,
1093
  `method` varbinary(767) DEFAULT NULL,
1094
  PRIMARY KEY (`id`),
1095
  KEY `fk_sampling_event_method1_idx` (`method`),
1096
  KEY `fk_taxa_sampling_event_place1_idx` (`within_place`),
1097
  KEY `fk_taxa_sampling_event_project1_idx` (`project`),
1098
  CONSTRAINT `fk_taxa_sampling_event_project1` FOREIGN KEY (`project`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1099
  CONSTRAINT `fk_project_event10` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1100
  CONSTRAINT `fk_sampling_event_method1` FOREIGN KEY (`method`) REFERENCES `method` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1101
  CONSTRAINT `fk_taxa_sampling_event_place1` FOREIGN KEY (`within_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1102
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='for plots and aggregate_observations within them';
1103
/*!40101 SET character_set_client = @saved_cs_client */;
1104

    
1105
--
1106
-- Dumping data for table `taxa_sampling_event`
1107
--
1108

    
1109
/*!40000 ALTER TABLE `taxa_sampling_event` DISABLE KEYS */;
1110
/*!40000 ALTER TABLE `taxa_sampling_event` ENABLE KEYS */;
1111

    
1112
--
1113
-- Table structure for table `taxon_absence`
1114
--
1115

    
1116
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1117
/*!40101 SET character_set_client = utf8 */;
1118
CREATE TABLE `taxon_absence` (
1119
  `id` varbinary(767) NOT NULL,
1120
  PRIMARY KEY (`id`),
1121
  CONSTRAINT `fk_taxon_absence_taxa_sampling_event1` FOREIGN KEY (`id`) REFERENCES `aggregate_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1122
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place';
1123
/*!40101 SET character_set_client = @saved_cs_client */;
1124

    
1125
--
1126
-- Dumping data for table `taxon_absence`
1127
--
1128

    
1129
/*!40000 ALTER TABLE `taxon_absence` DISABLE KEYS */;
1130
/*!40000 ALTER TABLE `taxon_absence` ENABLE KEYS */;
1131

    
1132
--
1133
-- Table structure for table `taxon_assertion`
1134
--
1135

    
1136
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1137
/*!40101 SET character_set_client = utf8 */;
1138
CREATE TABLE `taxon_assertion` (
1139
  `id` varbinary(767) NOT NULL,
1140
  `string` varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
1141
  `taxon` varbinary(767) DEFAULT NULL,
1142
  `cf_aff` varbinary(767) DEFAULT NULL,
1143
  `annotations` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1144
  PRIMARY KEY (`id`),
1145
  KEY `fk_taxon_assertion_taxon_string1_idx` (`string`),
1146
  KEY `fk_taxon_assertion_taxon_name1_idx` (`taxon`),
1147
  CONSTRAINT `fk_qualified_taxon_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1148
  CONSTRAINT `fk_taxon_assertion_taxon_name1` FOREIGN KEY (`taxon`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1149
  CONSTRAINT `fk_taxon_assertion_taxon_string1` FOREIGN KEY (`string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
1150
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1151
/*!40101 SET character_set_client = @saved_cs_client */;
1152

    
1153
--
1154
-- Dumping data for table `taxon_assertion`
1155
--
1156

    
1157
/*!40000 ALTER TABLE `taxon_assertion` DISABLE KEYS */;
1158
/*!40000 ALTER TABLE `taxon_assertion` ENABLE KEYS */;
1159

    
1160
--
1161
-- Table structure for table `taxon_concept`
1162
--
1163

    
1164
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1165
/*!40101 SET character_set_client = utf8 */;
1166
CREATE TABLE `taxon_concept` (
1167
  `id` varbinary(767) NOT NULL,
1168
  `according_to` varbinary(767) NOT NULL,
1169
  `parent` varbinary(767) DEFAULT NULL,
1170
  `accepted_taxon_concept` varbinary(767) DEFAULT NULL,
1171
  PRIMARY KEY (`id`),
1172
  UNIQUE KEY `taxon_concept_unique_name` (`according_to`),
1173
  KEY `fk_taxon_taxon1_idx` (`parent`),
1174
  KEY `fk_taxon_concept_source1_idx` (`according_to`),
1175
  KEY `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon_concept`),
1176
  CONSTRAINT `fk_taxon_concept_source1` FOREIGN KEY (`according_to`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1177
  CONSTRAINT `fk_taxon_concept_taxon_concept1` FOREIGN KEY (`accepted_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1178
  CONSTRAINT `fk_taxon_concept_taxon_name1` FOREIGN KEY (`id`) REFERENCES `taxon_name` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1179
  CONSTRAINT `fk_taxon_taxon1` FOREIGN KEY (`parent`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1180
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]';
1181
/*!40101 SET character_set_client = @saved_cs_client */;
1182

    
1183
--
1184
-- Dumping data for table `taxon_concept`
1185
--
1186

    
1187
/*!40000 ALTER TABLE `taxon_concept` DISABLE KEYS */;
1188
/*!40000 ALTER TABLE `taxon_concept` ENABLE KEYS */;
1189

    
1190
--
1191
-- Table structure for table `taxon_determination`
1192
--
1193

    
1194
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1195
/*!40101 SET character_set_client = utf8 */;
1196
CREATE TABLE `taxon_determination` (
1197
  `id` varbinary(767) NOT NULL,
1198
  `taxon_assertion` varbinary(767) NOT NULL,
1199
  `identified_by` varbinary(767) DEFAULT NULL,
1200
  `fit_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1201
  PRIMARY KEY (`id`),
1202
  UNIQUE KEY `taxon_determination_unique` (`taxon_assertion`,`identified_by`),
1203
  KEY `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion`),
1204
  KEY `fk_taxon_determination_party_list1_idx` (`identified_by`),
1205
  CONSTRAINT `fk_taxon_determination_party_list1` FOREIGN KEY (`identified_by`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1206
  CONSTRAINT `fk_taxon_determination_taxon_observation1` FOREIGN KEY (`id`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1207
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1` FOREIGN KEY (`taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1208
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]';
1209
/*!40101 SET character_set_client = @saved_cs_client */;
1210

    
1211
--
1212
-- Dumping data for table `taxon_determination`
1213
--
1214

    
1215
/*!40000 ALTER TABLE `taxon_determination` DISABLE KEYS */;
1216
/*!40000 ALTER TABLE `taxon_determination` ENABLE KEYS */;
1217

    
1218
--
1219
-- Table structure for table `taxon_name`
1220
--
1221

    
1222
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1223
/*!40101 SET character_set_client = utf8 */;
1224
CREATE TABLE `taxon_name` (
1225
  `id` varbinary(767) NOT NULL,
1226
  `unique_name` varbinary(767) NOT NULL,
1227
  `formal_name` varbinary(767) DEFAULT NULL,
1228
  `taxon_name` varbinary(767) DEFAULT NULL,
1229
  `author` varbinary(767) DEFAULT NULL,
1230
  `common_name` varbinary(767) DEFAULT NULL,
1231
  `rank` varbinary(767) DEFAULT NULL,
1232
  `taxon_path` varbinary(767) DEFAULT NULL,
1233
  PRIMARY KEY (`id`),
1234
  KEY `fk_taxon_concept_taxon_string10_idx` (`unique_name`),
1235
  KEY `fk_taxon_name_taxon_path1_idx` (`taxon_path`),
1236
  CONSTRAINT `fk_taxon_concept_taxon_string10` FOREIGN KEY (`unique_name`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE,
1237
  CONSTRAINT `fk_taxon_name_taxon_path1` FOREIGN KEY (`taxon_path`) REFERENCES `taxon_path` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1238
  CONSTRAINT `fk_taxon_record10` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1239
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1240
/*!40101 SET character_set_client = @saved_cs_client */;
1241

    
1242
--
1243
-- Dumping data for table `taxon_name`
1244
--
1245

    
1246
/*!40000 ALTER TABLE `taxon_name` DISABLE KEYS */;
1247
/*!40000 ALTER TABLE `taxon_name` ENABLE KEYS */;
1248

    
1249
--
1250
-- Table structure for table `taxon_observation`
1251
--
1252

    
1253
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1254
/*!40101 SET character_set_client = utf8 */;
1255
CREATE TABLE `taxon_observation` (
1256
  `id` varbinary(767) NOT NULL,
1257
  `taxon_occurrence` varbinary(767) NOT NULL,
1258
  `sampling_event` varbinary(767) DEFAULT NULL,
1259
  `observation_in_parent_place` varbinary(767) DEFAULT NULL COMMENT 'points to the observation of the same taxon/individual in the parent place; = VegBank.vegpath.org?taxonImportance.taxonObservation_ID',
1260
  `collectors` varbinary(767) DEFAULT NULL,
1261
  `collector_number` varbinary(767) DEFAULT NULL,
1262
  `growth_form` varbinary(767) DEFAULT NULL,
1263
  `cultivated` tinyint(1) DEFAULT NULL,
1264
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1265
  PRIMARY KEY (`id`),
1266
  KEY `fk_taxon_observation_party_list1_idx` (`collectors`),
1267
  KEY `fk_taxon_observation_taxon_occurrence1_idx` (`taxon_occurrence`),
1268
  KEY `fk_taxon_observation_taxa_sampling_event1_idx` (`sampling_event`),
1269
  KEY `fk_taxon_observation_taxon_observation1_idx` (`observation_in_parent_place`),
1270
  CONSTRAINT `fk_taxon_observation_taxon_observation1` FOREIGN KEY (`observation_in_parent_place`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1271
  CONSTRAINT `fk_taxon_observation_party_list1` FOREIGN KEY (`collectors`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1272
  CONSTRAINT `fk_taxon_observation_sampling_event1` FOREIGN KEY (`id`) REFERENCES `event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1273
  CONSTRAINT `fk_taxon_observation_taxa_sampling_event1` FOREIGN KEY (`sampling_event`) REFERENCES `taxa_sampling_event` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1274
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1` FOREIGN KEY (`taxon_occurrence`) REFERENCES `taxon_occurrence` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1275
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1276
/*!40101 SET character_set_client = @saved_cs_client */;
1277

    
1278
--
1279
-- Dumping data for table `taxon_observation`
1280
--
1281

    
1282
/*!40000 ALTER TABLE `taxon_observation` DISABLE KEYS */;
1283
/*!40000 ALTER TABLE `taxon_observation` ENABLE KEYS */;
1284

    
1285
--
1286
-- Table structure for table `taxon_occurrence`
1287
--
1288

    
1289
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1290
/*!40101 SET character_set_client = utf8 */;
1291
CREATE TABLE `taxon_occurrence` (
1292
  `id` varbinary(767) NOT NULL,
1293
  `within_place` varbinary(767) NOT NULL,
1294
  `current_observation` varbinary(767) DEFAULT NULL,
1295
  PRIMARY KEY (`id`),
1296
  KEY `fk_taxon_occurrence_taxon_determination3_idx` (`current_observation`),
1297
  KEY `fk_taxon_occurrence_place1_idx` (`within_place`),
1298
  CONSTRAINT `fk_taxon_occurrence_place1` FOREIGN KEY (`within_place`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1299
  CONSTRAINT `fk_taxon_occurrence_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1300
  CONSTRAINT `fk_taxon_occurrence_taxon_determination3` FOREIGN KEY (`current_observation`) REFERENCES `taxon_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1301
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1302
/*!40101 SET character_set_client = @saved_cs_client */;
1303

    
1304
--
1305
-- Dumping data for table `taxon_occurrence`
1306
--
1307

    
1308
/*!40000 ALTER TABLE `taxon_occurrence` DISABLE KEYS */;
1309
/*!40000 ALTER TABLE `taxon_occurrence` ENABLE KEYS */;
1310

    
1311
--
1312
-- Table structure for table `taxon_path`
1313
--
1314

    
1315
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1316
/*!40101 SET character_set_client = utf8 */;
1317
CREATE TABLE `taxon_path` (
1318
  `id` varbinary(767) NOT NULL,
1319
  `family` varbinary(767) DEFAULT NULL,
1320
  `genus` varbinary(767) DEFAULT NULL,
1321
  `specific_epithet` varbinary(767) DEFAULT NULL,
1322
  `ranks` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1323
  PRIMARY KEY (`id`)
1324
) 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)';
1325
/*!40101 SET character_set_client = @saved_cs_client */;
1326

    
1327
--
1328
-- Dumping data for table `taxon_path`
1329
--
1330

    
1331
/*!40000 ALTER TABLE `taxon_path` DISABLE KEYS */;
1332
/*!40000 ALTER TABLE `taxon_path` ENABLE KEYS */;
1333

    
1334
--
1335
-- Table structure for table `taxon_presence`
1336
--
1337

    
1338
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1339
/*!40101 SET character_set_client = utf8 */;
1340
CREATE TABLE `taxon_presence` (
1341
  `id` varbinary(767) NOT NULL,
1342
  `cover_percent` double DEFAULT NULL,
1343
  `traits` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1344
  PRIMARY KEY (`id`),
1345
  CONSTRAINT `fk_taxon_presence_taxon_determination1` FOREIGN KEY (`id`) REFERENCES `aggregate_observation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1346
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= aggregateOrganismObservation.VegX.vegpath.org, taxonImportance.VegBank.vegpath.org; "An observation applying to all occurrences of an organism" ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/aggregateOrganismObservations/aggregateOrganismObservation).';
1347
/*!40101 SET character_set_client = @saved_cs_client */;
1348

    
1349
--
1350
-- Dumping data for table `taxon_presence`
1351
--
1352

    
1353
/*!40000 ALTER TABLE `taxon_presence` DISABLE KEYS */;
1354
/*!40000 ALTER TABLE `taxon_presence` ENABLE KEYS */;
1355

    
1356
--
1357
-- Table structure for table `taxon_scrub`
1358
--
1359

    
1360
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1361
/*!40101 SET character_set_client = utf8 */;
1362
CREATE TABLE `taxon_scrub` (
1363
  `id` varbinary(767) NOT NULL,
1364
  `input_string` varbinary(767) NOT NULL,
1365
  `parsed_taxon_assertion` varbinary(767) NOT NULL,
1366
  `matched_taxon_concept` varbinary(767) DEFAULT NULL,
1367
  `match_score` float DEFAULT NULL,
1368
  `match_info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
1369
  PRIMARY KEY (`id`),
1370
  KEY `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon_concept`),
1371
  KEY `fk_taxon_scrub_taxon_assertion1_idx` (`parsed_taxon_assertion`),
1372
  KEY `fk_taxon_scrub_taxon_string1_idx` (`input_string`),
1373
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_name1` FOREIGN KEY (`matched_taxon_concept`) REFERENCES `taxon_concept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1374
  CONSTRAINT `fk_taxon_scrub_record1` FOREIGN KEY (`id`) REFERENCES `record` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1375
  CONSTRAINT `fk_taxon_scrub_taxon_assertion1` FOREIGN KEY (`parsed_taxon_assertion`) REFERENCES `taxon_assertion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1376
  CONSTRAINT `fk_taxon_scrub_taxon_string1` FOREIGN KEY (`input_string`) REFERENCES `taxon_string` (`string`) ON DELETE CASCADE ON UPDATE CASCADE
1377
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1378
/*!40101 SET character_set_client = @saved_cs_client */;
1379

    
1380
--
1381
-- Dumping data for table `taxon_scrub`
1382
--
1383

    
1384
/*!40000 ALTER TABLE `taxon_scrub` DISABLE KEYS */;
1385
/*!40000 ALTER TABLE `taxon_scrub` ENABLE KEYS */;
1386

    
1387
--
1388
-- Table structure for table `taxon_string`
1389
--
1390

    
1391
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1392
/*!40101 SET character_set_client = utf8 */;
1393
CREATE TABLE `taxon_string` (
1394
  `string` varbinary(767) NOT NULL,
1395
  PRIMARY KEY (`string`)
1396
) 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)';
1397
/*!40101 SET character_set_client = @saved_cs_client */;
1398

    
1399
--
1400
-- Dumping data for table `taxon_string`
1401
--
1402

    
1403
/*!40000 ALTER TABLE `taxon_string` DISABLE KEYS */;
1404
/*!40000 ALTER TABLE `taxon_string` ENABLE KEYS */;
1405
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1406

    
1407
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1408
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1409
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1410
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1411
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1412
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1413
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1414

    
1415
-- Dump completed
(9-9/15)