Project

General

Profile

1
-- MySQL dump 10.13  Distrib 5.5.31, for debian-linux-gnu (x86_64)
2
--
3
-- Host: localhost    Database: VegCore
4
-- ------------------------------------------------------
5
-- Server version	5.5.31-0ubuntu0.12.04.2
6
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
7
/*!40103 SET TIME_ZONE='+00:00' */;
8
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
9
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
10
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,POSTGRESQL' */;
11
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
12

    
13
--
14
-- Table structure for table "aggregate_observation"
15
--
16

    
17
/*!40101 SET @saved_cs_client     = @@character_set_client */;
18
/*!40101 SET character_set_client = utf8 */;
19
CREATE TABLE "aggregate_observation" (
20
  "id" varbinary(767) NOT NULL,
21
  "taxon_concept" varbinary(767) NOT NULL,
22
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
23
  PRIMARY KEY ("id"),
24
  KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept"),
25
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
26
  CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
27
);
28
/*!40101 SET character_set_client = @saved_cs_client */;
29

    
30
--
31
-- Dumping data for table "aggregate_observation"
32
--
33

    
34
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
35
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
36

    
37
--
38
-- Table structure for table "base_class"
39
--
40

    
41
/*!40101 SET @saved_cs_client     = @@character_set_client */;
42
/*!40101 SET character_set_client = utf8 */;
43
CREATE TABLE "base_class" (
44
  "id" varbinary(767) NOT NULL,
45
  "referenced_class" varbinary(767) NOT NULL,
46
  PRIMARY KEY ("id"),
47
  KEY "fk_base_class_referenced_class1_idx" ("referenced_class"),
48
  CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
49
);
50
/*!40101 SET character_set_client = @saved_cs_client */;
51

    
52
--
53
-- Dumping data for table "base_class"
54
--
55

    
56
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
57
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
58

    
59
--
60
-- Table structure for table "collection"
61
--
62

    
63
/*!40101 SET @saved_cs_client     = @@character_set_client */;
64
/*!40101 SET character_set_client = utf8 */;
65
CREATE TABLE "collection" (
66
  "id" varbinary(767) NOT NULL,
67
  "institution" varbinary(767) NOT NULL,
68
  "name" varbinary(767) NOT NULL,
69
  PRIMARY KEY ("id"),
70
  UNIQUE KEY "collection_unique" ("institution","name"),
71
  KEY "fk_collection_organization1_idx" ("institution"),
72
  KEY "fk_collection_source1_idx" ("id"),
73
  CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
74
  CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
75
);
76
/*!40101 SET character_set_client = @saved_cs_client */;
77

    
78
--
79
-- Dumping data for table "collection"
80
--
81

    
82
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
83
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
84

    
85
--
86
-- Table structure for table "community"
87
--
88

    
89
/*!40101 SET @saved_cs_client     = @@character_set_client */;
90
/*!40101 SET character_set_client = utf8 */;
91
CREATE TABLE "community" (
92
  "id" varbinary(767) NOT NULL,
93
  "name" varbinary(767) NOT NULL,
94
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
95
  PRIMARY KEY ("id"),
96
  CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
97
);
98
/*!40101 SET character_set_client = @saved_cs_client */;
99

    
100
--
101
-- Dumping data for table "community"
102
--
103

    
104
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
105
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
106

    
107
--
108
-- Table structure for table "coordinates"
109
--
110

    
111
/*!40101 SET @saved_cs_client     = @@character_set_client */;
112
/*!40101 SET character_set_client = utf8 */;
113
CREATE TABLE "coordinates" (
114
  "id" varbinary(767) NOT NULL,
115
  "latitude_deg" varbinary(767) DEFAULT NULL,
116
  "longitude_deg" varbinary(767) DEFAULT NULL,
117
  PRIMARY KEY ("id")
118
);
119
/*!40101 SET character_set_client = @saved_cs_client */;
120

    
121
--
122
-- Dumping data for table "coordinates"
123
--
124

    
125
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
126
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
127

    
128
--
129
-- Table structure for table "derived_class"
130
--
131

    
132
/*!40101 SET @saved_cs_client     = @@character_set_client */;
133
/*!40101 SET character_set_client = utf8 */;
134
CREATE TABLE "derived_class" (
135
  "id" varbinary(767) NOT NULL,
136
  PRIMARY KEY ("id"),
137
  CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
138
);
139
/*!40101 SET character_set_client = @saved_cs_client */;
140

    
141
--
142
-- Dumping data for table "derived_class"
143
--
144

    
145
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
146
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
147

    
148
--
149
-- Table structure for table "event"
150
--
151

    
152
/*!40101 SET @saved_cs_client     = @@character_set_client */;
153
/*!40101 SET character_set_client = utf8 */;
154
CREATE TABLE "event" (
155
  "id" varbinary(767) NOT NULL,
156
  "parent" varbinary(767) NOT NULL,
157
  "name" varbinary(767) DEFAULT NULL,
158
  "date_range" varbinary(767) DEFAULT NULL,
159
  "place" varbinary(767) DEFAULT NULL,
160
  "method" varbinary(767) DEFAULT NULL,
161
  PRIMARY KEY ("id"),
162
  KEY "fk_event_place1_idx" ("place"),
163
  KEY "fk_event1_idx" ("parent"),
164
  KEY "fk_event_method1_idx" ("method"),
165
  CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
166
  CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
167
  CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
168
  CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
169
);
170
/*!40101 SET character_set_client = @saved_cs_client */;
171

    
172
--
173
-- Dumping data for table "event"
174
--
175

    
176
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
177
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
178

    
179
--
180
-- Table structure for table "event_participant"
181
--
182

    
183
/*!40101 SET @saved_cs_client     = @@character_set_client */;
184
/*!40101 SET character_set_client = utf8 */;
185
CREATE TABLE "event_participant" (
186
  "event" varbinary(767) NOT NULL,
187
  "party" varbinary(767) NOT NULL,
188
  "sort_order" int(11) DEFAULT NULL,
189
  PRIMARY KEY ("event","party"),
190
  KEY "fk_event_has_party_party1_idx" ("party"),
191
  KEY "fk_event_has_party_event1_idx" ("event"),
192
  CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
193
  CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
194
);
195
/*!40101 SET character_set_client = @saved_cs_client */;
196

    
197
--
198
-- Dumping data for table "event_participant"
199
--
200

    
201
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
202
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
203

    
204
--
205
-- Table structure for table "geological_context"
206
--
207

    
208
/*!40101 SET @saved_cs_client     = @@character_set_client */;
209
/*!40101 SET character_set_client = utf8 */;
210
CREATE TABLE "geological_context" (
211
  "id" varbinary(767) NOT NULL,
212
  "name" varbinary(767) NOT NULL,
213
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
214
  PRIMARY KEY ("id"),
215
  CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
216
);
217
/*!40101 SET character_set_client = @saved_cs_client */;
218

    
219
--
220
-- Dumping data for table "geological_context"
221
--
222

    
223
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
224
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
225

    
226
--
227
-- Table structure for table "geovalidation"
228
--
229

    
230
/*!40101 SET @saved_cs_client     = @@character_set_client */;
231
/*!40101 SET character_set_client = utf8 */;
232
CREATE TABLE "geovalidation" (
233
  "id" varbinary(767) NOT NULL,
234
  "geovalid" tinyint(1) NOT NULL,
235
  "lat_long_domain_valid" tinyint(1) NOT NULL,
236
  "lat_long_in_ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
237
  PRIMARY KEY ("id"),
238
  CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
239
);
240
/*!40101 SET character_set_client = @saved_cs_client */;
241

    
242
--
243
-- Dumping data for table "geovalidation"
244
--
245

    
246
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
247
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
248

    
249
--
250
-- Table structure for table "individual"
251
--
252

    
253
/*!40101 SET @saved_cs_client     = @@character_set_client */;
254
/*!40101 SET character_set_client = utf8 */;
255
CREATE TABLE "individual" (
256
  "id" varbinary(767) NOT NULL,
257
  "tag" varbinary(767) DEFAULT NULL,
258
  PRIMARY KEY ("id"),
259
  CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
260
);
261
/*!40101 SET character_set_client = @saved_cs_client */;
262

    
263
--
264
-- Dumping data for table "individual"
265
--
266

    
267
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
268
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
269

    
270
--
271
-- Table structure for table "individual_observation"
272
--
273

    
274
/*!40101 SET @saved_cs_client     = @@character_set_client */;
275
/*!40101 SET character_set_client = utf8 */;
276
CREATE TABLE "individual_observation" (
277
  "id" varbinary(767) NOT NULL,
278
  "individual" varbinary(767) DEFAULT NULL,
279
  "code" varbinary(767) DEFAULT NULL,
280
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
281
  PRIMARY KEY ("id"),
282
  KEY "fk_individual_observation_individual1_idx" ("individual"),
283
  CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
284
  CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
285
);
286
/*!40101 SET character_set_client = @saved_cs_client */;
287

    
288
--
289
-- Dumping data for table "individual_observation"
290
--
291

    
292
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
293
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
294

    
295
--
296
-- Table structure for table "method"
297
--
298

    
299
/*!40101 SET @saved_cs_client     = @@character_set_client */;
300
/*!40101 SET character_set_client = utf8 */;
301
CREATE TABLE "method" (
302
  "id" varbinary(767) NOT NULL,
303
  "parent" varbinary(767) NOT NULL,
304
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
305
  PRIMARY KEY ("id"),
306
  KEY "fk_method_method1_idx" ("parent"),
307
  CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
308
  CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
309
);
310
/*!40101 SET character_set_client = @saved_cs_client */;
311

    
312
--
313
-- Dumping data for table "method"
314
--
315

    
316
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
317
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
318

    
319
--
320
-- Table structure for table "organization"
321
--
322

    
323
/*!40101 SET @saved_cs_client     = @@character_set_client */;
324
/*!40101 SET character_set_client = utf8 */;
325
CREATE TABLE "organization" (
326
  "id" varbinary(767) NOT NULL,
327
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
328
  PRIMARY KEY ("id"),
329
  CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
330
);
331
/*!40101 SET character_set_client = @saved_cs_client */;
332

    
333
--
334
-- Dumping data for table "organization"
335
--
336

    
337
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
338
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
339

    
340
--
341
-- Table structure for table "parsed_taxon_assertion"
342
--
343

    
344
/*!40101 SET @saved_cs_client     = @@character_set_client */;
345
/*!40101 SET character_set_client = utf8 */;
346
CREATE TABLE "parsed_taxon_assertion" (
347
  "id" varbinary(767) NOT NULL,
348
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
349
  "match_score" float DEFAULT NULL,
350
  "match_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
351
  PRIMARY KEY ("id"),
352
  KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept"),
353
  CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
354
  CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
355
);
356
/*!40101 SET character_set_client = @saved_cs_client */;
357

    
358
--
359
-- Dumping data for table "parsed_taxon_assertion"
360
--
361

    
362
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
363
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
364

    
365
--
366
-- Table structure for table "party"
367
--
368

    
369
/*!40101 SET @saved_cs_client     = @@character_set_client */;
370
/*!40101 SET character_set_client = utf8 */;
371
CREATE TABLE "party" (
372
  "id" varbinary(767) NOT NULL,
373
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
374
  PRIMARY KEY ("id"),
375
  CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
376
);
377
/*!40101 SET character_set_client = @saved_cs_client */;
378

    
379
--
380
-- Dumping data for table "party"
381
--
382

    
383
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
384
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
385

    
386
--
387
-- Table structure for table "place"
388
--
389

    
390
/*!40101 SET @saved_cs_client     = @@character_set_client */;
391
/*!40101 SET character_set_client = utf8 */;
392
CREATE TABLE "place" (
393
  "id" varbinary(767) NOT NULL,
394
  "parent" varbinary(767) NOT NULL,
395
  "coordinates" varbinary(767) DEFAULT NULL,
396
  "path" varbinary(767) DEFAULT NULL,
397
  "locality" varbinary(767) DEFAULT NULL,
398
  PRIMARY KEY ("id"),
399
  KEY "fk_place_coordinates1_idx" ("coordinates"),
400
  KEY "fk_place1_idx" ("parent"),
401
  KEY "fk_place_place_path1_idx" ("path"),
402
  CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
403
  CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
404
  CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
405
  CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE
406
);
407
/*!40101 SET character_set_client = @saved_cs_client */;
408

    
409
--
410
-- Dumping data for table "place"
411
--
412

    
413
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
414
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
415

    
416
--
417
-- Table structure for table "place_observation"
418
--
419

    
420
/*!40101 SET @saved_cs_client     = @@character_set_client */;
421
/*!40101 SET character_set_client = utf8 */;
422
CREATE TABLE "place_observation" (
423
  "id" varbinary(767) NOT NULL,
424
  "place" varbinary(767) NOT NULL,
425
  "elevation_m" double DEFAULT NULL,
426
  "slope_incline_deg" double DEFAULT NULL,
427
  "slope_direction_deg_N" double DEFAULT NULL,
428
  "geological_context" varbinary(767) DEFAULT NULL,
429
  "community" varbinary(767) DEFAULT NULL,
430
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
431
  PRIMARY KEY ("id"),
432
  KEY "fk_place_observation_place1_idx" ("place"),
433
  KEY "fk_place_observation_geological_context1_idx" ("geological_context"),
434
  KEY "fk_place_observation_community1_idx" ("community"),
435
  KEY "fk_place_observation_event1_idx" ("id"),
436
  CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
437
  CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
438
  CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
439
  CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
440
);
441
/*!40101 SET character_set_client = @saved_cs_client */;
442

    
443
--
444
-- Dumping data for table "place_observation"
445
--
446

    
447
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
448
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
449

    
450
--
451
-- Table structure for table "place_path"
452
--
453

    
454
/*!40101 SET @saved_cs_client     = @@character_set_client */;
455
/*!40101 SET character_set_client = utf8 */;
456
CREATE TABLE "place_path" (
457
  "id" varbinary(767) NOT NULL,
458
  "continent" varbinary(767) DEFAULT NULL,
459
  "country" varbinary(767) DEFAULT NULL,
460
  "state_province" varbinary(767) DEFAULT NULL,
461
  "county" varbinary(767) DEFAULT NULL,
462
  "municipality" varbinary(767) DEFAULT NULL,
463
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
464
  PRIMARY KEY ("id")
465
);
466
/*!40101 SET character_set_client = @saved_cs_client */;
467

    
468
--
469
-- Dumping data for table "place_path"
470
--
471

    
472
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
473
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
474

    
475
--
476
-- Table structure for table "plot"
477
--
478

    
479
/*!40101 SET @saved_cs_client     = @@character_set_client */;
480
/*!40101 SET character_set_client = utf8 */;
481
CREATE TABLE "plot" (
482
  "id" varbinary(767) NOT NULL,
483
  "name" varbinary(767) DEFAULT NULL,
484
  "area_m2" double DEFAULT NULL,
485
  "bounding_box" varbinary(767) DEFAULT NULL,
486
  PRIMARY KEY ("id"),
487
  CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
488
);
489
/*!40101 SET character_set_client = @saved_cs_client */;
490

    
491
--
492
-- Dumping data for table "plot"
493
--
494

    
495
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
496
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
497

    
498
--
499
-- Table structure for table "project"
500
--
501

    
502
/*!40101 SET @saved_cs_client     = @@character_set_client */;
503
/*!40101 SET character_set_client = utf8 */;
504
CREATE TABLE "project" (
505
  "id" varbinary(767) NOT NULL,
506
  "name" varbinary(767) NOT NULL,
507
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
508
  PRIMARY KEY ("id"),
509
  CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
510
);
511
/*!40101 SET character_set_client = @saved_cs_client */;
512

    
513
--
514
-- Dumping data for table "project"
515
--
516

    
517
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
518
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
519

    
520
--
521
-- Table structure for table "record"
522
--
523

    
524
/*!40101 SET @saved_cs_client     = @@character_set_client */;
525
/*!40101 SET character_set_client = utf8 */;
526
CREATE TABLE "record" (
527
  "id" varbinary(767) NOT NULL,
528
  "source" varbinary(767) NOT NULL,
529
  "source_id_scope" varbinary(767) DEFAULT NULL,
530
  "source_record_id" varbinary(767) DEFAULT NULL,
531
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
532
  PRIMARY KEY ("id"),
533
  UNIQUE KEY "record_unique" ("source","source_id_scope","source_record_id"),
534
  KEY "fk_record_source1_idx" ("source"),
535
  CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE
536
);
537
/*!40101 SET character_set_client = @saved_cs_client */;
538

    
539
--
540
-- Dumping data for table "record"
541
--
542

    
543
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
544
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
545

    
546
--
547
-- Table structure for table "referenced_class"
548
--
549

    
550
/*!40101 SET @saved_cs_client     = @@character_set_client */;
551
/*!40101 SET character_set_client = utf8 */;
552
CREATE TABLE "referenced_class" (
553
  "id" varbinary(767) NOT NULL,
554
  PRIMARY KEY ("id"),
555
  CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
556
);
557
/*!40101 SET character_set_client = @saved_cs_client */;
558

    
559
--
560
-- Dumping data for table "referenced_class"
561
--
562

    
563
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
564
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
565

    
566
--
567
-- Table structure for table "relationship"
568
--
569

    
570
/*!40101 SET @saved_cs_client     = @@character_set_client */;
571
/*!40101 SET character_set_client = utf8 */;
572
CREATE TABLE "relationship" (
573
  "id" varbinary(767) NOT NULL,
574
  "record" varbinary(767) NOT NULL,
575
  "related_record" varbinary(767) NOT NULL,
576
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
577
  PRIMARY KEY ("id"),
578
  KEY "fk_relationship_record1_idx" ("record"),
579
  KEY "fk_relationship_related_record_idx" ("related_record"),
580
  CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
581
  CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
582
  CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
583
);
584
/*!40101 SET character_set_client = @saved_cs_client */;
585

    
586
--
587
-- Dumping data for table "relationship"
588
--
589

    
590
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
591
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
592

    
593
--
594
-- Table structure for table "soil_observation"
595
--
596

    
597
/*!40101 SET @saved_cs_client     = @@character_set_client */;
598
/*!40101 SET character_set_client = utf8 */;
599
CREATE TABLE "soil_observation" (
600
  "id" varbinary(767) NOT NULL,
601
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
602
  PRIMARY KEY ("id"),
603
  CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
604
);
605
/*!40101 SET character_set_client = @saved_cs_client */;
606

    
607
--
608
-- Dumping data for table "soil_observation"
609
--
610

    
611
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
612
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
613

    
614
--
615
-- Table structure for table "source"
616
--
617

    
618
/*!40101 SET @saved_cs_client     = @@character_set_client */;
619
/*!40101 SET character_set_client = utf8 */;
620
CREATE TABLE "source" (
621
  "id" varbinary(767) NOT NULL,
622
  "parent" varbinary(767) NOT NULL,
623
  "name" varbinary(767) NOT NULL,
624
  "first_publisher" varbinary(767) DEFAULT NULL,
625
  "owner" varbinary(767) DEFAULT NULL,
626
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
627
  PRIMARY KEY ("id"),
628
  UNIQUE KEY "source_unique" ("parent","name"),
629
  KEY "fk_source1_idx" ("parent"),
630
  KEY "fk_source_party1_idx" ("owner"),
631
  KEY "fk_source_party2_idx" ("first_publisher"),
632
  CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
633
  CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
634
  CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
635
);
636
/*!40101 SET character_set_client = @saved_cs_client */;
637

    
638
--
639
-- Dumping data for table "source"
640
--
641

    
642
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
643
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
644

    
645
--
646
-- Table structure for table "specimen"
647
--
648

    
649
/*!40101 SET @saved_cs_client     = @@character_set_client */;
650
/*!40101 SET character_set_client = utf8 */;
651
CREATE TABLE "specimen" (
652
  "id" varbinary(767) NOT NULL,
653
  "individual" varbinary(767) DEFAULT NULL,
654
  "code_in_individual" varbinary(767) DEFAULT NULL,
655
  "collection_event" varbinary(767) DEFAULT NULL,
656
  "orig_collection" varbinary(767) DEFAULT NULL,
657
  "barcode" varbinary(767) DEFAULT NULL,
658
  "accession_number" varbinary(767) DEFAULT NULL,
659
  "current_collection" varbinary(767) DEFAULT NULL,
660
  "owner_collection" varbinary(767) DEFAULT NULL,
661
  PRIMARY KEY ("id"),
662
  UNIQUE KEY "specimen_unique_in_individual" ("individual","code_in_individual"),
663
  UNIQUE KEY "specimen_unique_by_collection_event" ("collection_event"),
664
  UNIQUE KEY "specimen_unique_in_collection_by_barcode" ("orig_collection","barcode"),
665
  UNIQUE KEY "specimen_unique_in_collection_by_accession_number" ("orig_collection","accession_number"),
666
  KEY "fk_specimen_collection1_idx" ("orig_collection"),
667
  KEY "fk_specimen_taxon_observation1_idx" ("collection_event"),
668
  KEY "fk_specimen_individual1_idx" ("individual"),
669
  KEY "fk_specimen_collection2_idx" ("current_collection"),
670
  KEY "fk_specimen_organization3_idx" ("owner_collection"),
671
  CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
672
  CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
673
  CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
674
  CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
675
  CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
676
  CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE
677
);
678
/*!40101 SET character_set_client = @saved_cs_client */;
679

    
680
--
681
-- Dumping data for table "specimen"
682
--
683

    
684
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
685
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
686

    
687
--
688
-- Table structure for table "specimen_observation"
689
--
690

    
691
/*!40101 SET @saved_cs_client     = @@character_set_client */;
692
/*!40101 SET character_set_client = utf8 */;
693
CREATE TABLE "specimen_observation" (
694
  "id" varbinary(767) NOT NULL,
695
  "specimen" varbinary(767) NOT NULL,
696
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
697
  PRIMARY KEY ("id"),
698
  KEY "fk_specimen_observation_specimen1_idx" ("specimen"),
699
  CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
700
  CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE
701
);
702
/*!40101 SET character_set_client = @saved_cs_client */;
703

    
704
--
705
-- Dumping data for table "specimen_observation"
706
--
707

    
708
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
709
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
710

    
711
--
712
-- Table structure for table "specimenholder_institution"
713
--
714

    
715
/*!40101 SET @saved_cs_client     = @@character_set_client */;
716
/*!40101 SET character_set_client = utf8 */;
717
CREATE TABLE "specimenholder_institution" (
718
  "specimen" varbinary(767) NOT NULL,
719
  "institution" varbinary(767) NOT NULL,
720
  "sort_order" int(11) DEFAULT NULL,
721
  PRIMARY KEY ("specimen","institution"),
722
  KEY "fk_specimen_has_organization_organization1_idx" ("institution"),
723
  KEY "fk_specimen_has_organization_specimen1_idx" ("specimen"),
724
  CONSTRAINT "fk_specimen_has_organization_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
725
  CONSTRAINT "fk_specimen_has_organization_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
726
);
727
/*!40101 SET character_set_client = @saved_cs_client */;
728

    
729
--
730
-- Dumping data for table "specimenholder_institution"
731
--
732

    
733
/*!40000 ALTER TABLE "specimenholder_institution" DISABLE KEYS */;
734
/*!40000 ALTER TABLE "specimenholder_institution" ENABLE KEYS */;
735

    
736
--
737
-- Table structure for table "stem"
738
--
739

    
740
/*!40101 SET @saved_cs_client     = @@character_set_client */;
741
/*!40101 SET character_set_client = utf8 */;
742
CREATE TABLE "stem" (
743
  "id" varbinary(767) NOT NULL,
744
  "individual" varbinary(767) NOT NULL,
745
  PRIMARY KEY ("id"),
746
  KEY "fk_stem_individual1_idx" ("individual"),
747
  CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
748
  CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
749
);
750
/*!40101 SET character_set_client = @saved_cs_client */;
751

    
752
--
753
-- Dumping data for table "stem"
754
--
755

    
756
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
757
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
758

    
759
--
760
-- Table structure for table "stem_observation"
761
--
762

    
763
/*!40101 SET @saved_cs_client     = @@character_set_client */;
764
/*!40101 SET character_set_client = utf8 */;
765
CREATE TABLE "stem_observation" (
766
  "id" varbinary(767) NOT NULL,
767
  "individual_observation" varbinary(767) NOT NULL,
768
  "stem" varbinary(767) DEFAULT NULL,
769
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
770
  PRIMARY KEY ("id"),
771
  UNIQUE KEY "stem_observation_unique" ("individual_observation","stem"),
772
  KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation"),
773
  KEY "fk_stem_observation_stem1_idx" ("stem"),
774
  CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
775
  CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
776
  CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
777
);
778
/*!40101 SET character_set_client = @saved_cs_client */;
779

    
780
--
781
-- Dumping data for table "stem_observation"
782
--
783

    
784
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
785
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
786

    
787
--
788
-- Table structure for table "stratum"
789
--
790

    
791
/*!40101 SET @saved_cs_client     = @@character_set_client */;
792
/*!40101 SET character_set_client = utf8 */;
793
CREATE TABLE "stratum" (
794
  "id" varbinary(767) NOT NULL,
795
  "name" varbinary(767) NOT NULL,
796
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
797
  PRIMARY KEY ("id"),
798
  CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
799
);
800
/*!40101 SET character_set_client = @saved_cs_client */;
801

    
802
--
803
-- Dumping data for table "stratum"
804
--
805

    
806
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
807
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
808

    
809
--
810
-- Table structure for table "subplot"
811
--
812

    
813
/*!40101 SET @saved_cs_client     = @@character_set_client */;
814
/*!40101 SET character_set_client = utf8 */;
815
CREATE TABLE "subplot" (
816
  "id" varbinary(767) NOT NULL,
817
  "x_m" double DEFAULT NULL,
818
  "y_m" double DEFAULT NULL,
819
  PRIMARY KEY ("id"),
820
  CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE
821
);
822
/*!40101 SET character_set_client = @saved_cs_client */;
823

    
824
--
825
-- Dumping data for table "subplot"
826
--
827

    
828
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
829
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
830

    
831
--
832
-- Table structure for table "taxon_assertion"
833
--
834

    
835
/*!40101 SET @saved_cs_client     = @@character_set_client */;
836
/*!40101 SET character_set_client = utf8 */;
837
CREATE TABLE "taxon_assertion" (
838
  "id" varbinary(767) NOT NULL,
839
  "string" varbinary(767) NOT NULL COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name',
840
  "taxon" varbinary(767) DEFAULT NULL,
841
  "cf_aff" varbinary(767) DEFAULT NULL,
842
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
843
  PRIMARY KEY ("id"),
844
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
845
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
846
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
847
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE,
848
  CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
849
);
850
/*!40101 SET character_set_client = @saved_cs_client */;
851

    
852
--
853
-- Dumping data for table "taxon_assertion"
854
--
855

    
856
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
857
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
858

    
859
--
860
-- Table structure for table "taxon_concept"
861
--
862

    
863
/*!40101 SET @saved_cs_client     = @@character_set_client */;
864
/*!40101 SET character_set_client = utf8 */;
865
CREATE TABLE "taxon_concept" (
866
  "id" varbinary(767) NOT NULL,
867
  "according_to" varbinary(767) NOT NULL,
868
  "parent" varbinary(767) NOT NULL,
869
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
870
  PRIMARY KEY ("id"),
871
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
872
  KEY "fk_taxon_taxon1_idx" ("parent"),
873
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
874
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
875
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
876
  CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
877
  CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
878
  CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
879
);
880
/*!40101 SET character_set_client = @saved_cs_client */;
881

    
882
--
883
-- Dumping data for table "taxon_concept"
884
--
885

    
886
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
887
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
888

    
889
--
890
-- Table structure for table "taxon_determination"
891
--
892

    
893
/*!40101 SET @saved_cs_client     = @@character_set_client */;
894
/*!40101 SET character_set_client = utf8 */;
895
CREATE TABLE "taxon_determination" (
896
  "id" varbinary(767) NOT NULL,
897
  "taxon_assertion" varbinary(767) NOT NULL,
898
  "identified_by" varbinary(767) DEFAULT NULL,
899
  "fit_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
900
  PRIMARY KEY ("id"),
901
  UNIQUE KEY "taxon_determination_unique" ("taxon_assertion","identified_by"),
902
  KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion"),
903
  KEY "fk_taxon_determination_party1_idx" ("identified_by"),
904
  CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
905
  CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
906
  CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
907
);
908
/*!40101 SET character_set_client = @saved_cs_client */;
909

    
910
--
911
-- Dumping data for table "taxon_determination"
912
--
913

    
914
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
915
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
916

    
917
--
918
-- Table structure for table "taxon_name"
919
--
920

    
921
/*!40101 SET @saved_cs_client     = @@character_set_client */;
922
/*!40101 SET character_set_client = utf8 */;
923
CREATE TABLE "taxon_name" (
924
  "id" varbinary(767) NOT NULL,
925
  "unique_name" varbinary(767) NOT NULL,
926
  "formal_name" varbinary(767) DEFAULT NULL,
927
  "taxon_name" varbinary(767) DEFAULT NULL,
928
  "author" varbinary(767) DEFAULT NULL,
929
  "common_name" varbinary(767) DEFAULT NULL,
930
  "rank" varbinary(767) DEFAULT NULL,
931
  PRIMARY KEY ("id"),
932
  KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name"),
933
  CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
934
  CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
935
);
936
/*!40101 SET character_set_client = @saved_cs_client */;
937

    
938
--
939
-- Dumping data for table "taxon_name"
940
--
941

    
942
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
943
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
944

    
945
--
946
-- Table structure for table "taxon_observation"
947
--
948

    
949
/*!40101 SET @saved_cs_client     = @@character_set_client */;
950
/*!40101 SET character_set_client = utf8 */;
951
CREATE TABLE "taxon_observation" (
952
  "id" varbinary(767) NOT NULL,
953
  "taxon_occurrence" varbinary(767) NOT NULL,
954
  "collector" varbinary(767) DEFAULT NULL,
955
  "collector_number" varbinary(767) DEFAULT NULL,
956
  "voucher" varbinary(767) DEFAULT NULL,
957
  "growth_form" varbinary(767) DEFAULT NULL,
958
  "cultivated" tinyint(1) DEFAULT NULL,
959
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
960
  PRIMARY KEY ("id"),
961
  KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence"),
962
  KEY "fk_taxon_observation_specimen1_idx" ("voucher"),
963
  KEY "fk_taxon_observation_party1_idx" ("collector"),
964
  CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
965
  CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
966
  CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
967
  CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
968
);
969
/*!40101 SET character_set_client = @saved_cs_client */;
970

    
971
--
972
-- Dumping data for table "taxon_observation"
973
--
974

    
975
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
976
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
977

    
978
--
979
-- Table structure for table "taxon_occurrence"
980
--
981

    
982
/*!40101 SET @saved_cs_client     = @@character_set_client */;
983
/*!40101 SET character_set_client = utf8 */;
984
CREATE TABLE "taxon_occurrence" (
985
  "id" varbinary(767) NOT NULL,
986
  "current_determination" varbinary(767) DEFAULT NULL,
987
  "original_determination" varbinary(767) DEFAULT NULL,
988
  PRIMARY KEY ("id"),
989
  KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination"),
990
  KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination"),
991
  CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
992
  CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
993
  CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
994
);
995
/*!40101 SET character_set_client = @saved_cs_client */;
996

    
997
--
998
-- Dumping data for table "taxon_occurrence"
999
--
1000

    
1001
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
1002
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
1003

    
1004
--
1005
-- Table structure for table "taxon_path"
1006
--
1007

    
1008
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1009
/*!40101 SET character_set_client = utf8 */;
1010
CREATE TABLE "taxon_path" (
1011
  "id" varbinary(767) NOT NULL,
1012
  "family" varbinary(767) DEFAULT NULL,
1013
  "genus" varbinary(767) DEFAULT NULL,
1014
  "specific_epithet" varbinary(767) DEFAULT NULL,
1015
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
1016
  PRIMARY KEY ("id"),
1017
  CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
1018
);
1019
/*!40101 SET character_set_client = @saved_cs_client */;
1020

    
1021
--
1022
-- Dumping data for table "taxon_path"
1023
--
1024

    
1025
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
1026
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
1027

    
1028
--
1029
-- Table structure for table "taxon_presence"
1030
--
1031

    
1032
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1033
/*!40101 SET character_set_client = utf8 */;
1034
CREATE TABLE "taxon_presence" (
1035
  "id" varbinary(767) NOT NULL,
1036
  "taxon_concept" varbinary(767) NOT NULL,
1037
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
1038
  PRIMARY KEY ("id"),
1039
  KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept"),
1040
  CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
1041
  CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
1042
);
1043
/*!40101 SET character_set_client = @saved_cs_client */;
1044

    
1045
--
1046
-- Dumping data for table "taxon_presence"
1047
--
1048

    
1049
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
1050
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
1051

    
1052
--
1053
-- Table structure for table "taxon_string"
1054
--
1055

    
1056
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1057
/*!40101 SET character_set_client = utf8 */;
1058
CREATE TABLE "taxon_string" (
1059
  "string" varbinary(767) NOT NULL,
1060
  PRIMARY KEY ("string")
1061
);
1062
/*!40101 SET character_set_client = @saved_cs_client */;
1063

    
1064
--
1065
-- Dumping data for table "taxon_string"
1066
--
1067

    
1068
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1069
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1070

    
1071
--
1072
-- Table structure for table "validatable_place"
1073
--
1074

    
1075
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1076
/*!40101 SET character_set_client = utf8 */;
1077
CREATE TABLE "validatable_place" (
1078
  "id" varbinary(767) NOT NULL,
1079
  "coordinates" varbinary(767) NOT NULL,
1080
  "path" varbinary(767) NOT NULL,
1081
  PRIMARY KEY ("id"),
1082
  UNIQUE KEY "validatable_place_unique" ("path","coordinates"),
1083
  KEY "fk_geovalidation_place_path1_idx" ("path"),
1084
  KEY "fk_geovalidation_coordinates1_idx" ("coordinates"),
1085
  CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
1086
  CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE
1087
);
1088
/*!40101 SET character_set_client = @saved_cs_client */;
1089

    
1090
--
1091
-- Dumping data for table "validatable_place"
1092
--
1093

    
1094
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
1095
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
1096
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1097

    
1098
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1099
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1100
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1101
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1102

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