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_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
26
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("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
  CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
50
);
51
/*!40101 SET character_set_client = @saved_cs_client */;
52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
836
/*!40101 SET @saved_cs_client     = @@character_set_client */;
837
/*!40101 SET character_set_client = utf8 */;
838
CREATE TABLE "taxon_assertion" (
839
  "id" varbinary(767) NOT NULL,
840
  "string" varbinary(767) NOT NULL,
841
  "taxon" varbinary(767) DEFAULT NULL,
842
  "cf_aff" varbinary(767) DEFAULT NULL,
843
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
844
  PRIMARY KEY ("id"),
845
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
846
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
847
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") 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
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
850
);
851
/*!40101 SET character_set_client = @saved_cs_client */;
852

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

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

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

    
864
/*!40101 SET @saved_cs_client     = @@character_set_client */;
865
/*!40101 SET character_set_client = utf8 */;
866
CREATE TABLE "taxon_concept" (
867
  "id" varbinary(767) NOT NULL,
868
  "according_to" varbinary(767) NOT NULL,
869
  "parent" varbinary(767) NOT NULL,
870
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
871
  PRIMARY KEY ("id"),
872
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
873
  KEY "fk_taxon_taxon1_idx" ("parent"),
874
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
875
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
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
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
880
);
881
/*!40101 SET character_set_client = @saved_cs_client */;
882

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1057
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1058
/*!40101 SET character_set_client = utf8 */;
1059
CREATE TABLE "taxon_string" (
1060
  "string" varbinary(767) NOT NULL,
1061
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
1062
  PRIMARY KEY ("string"),
1063
  KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion"),
1064
  CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
1065
);
1066
/*!40101 SET character_set_client = @saved_cs_client */;
1067

    
1068
--
1069
-- Dumping data for table "taxon_string"
1070
--
1071

    
1072
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1073
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1074

    
1075
--
1076
-- Table structure for table "validatable_place"
1077
--
1078

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

    
1094
--
1095
-- Dumping data for table "validatable_place"
1096
--
1097

    
1098
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
1099
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
1100
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1101

    
1102
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1103
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1104
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1105
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1106

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