Project

General

Profile

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

    
15
--
16
-- Table structure for table "aggregate_observation"
17
--
18

    
19
/*!40101 SET @saved_cs_client     = @@character_set_client */;
20
/*!40101 SET character_set_client = utf8 */;
21
CREATE TABLE "aggregate_observation" (
22
  "id" text NOT NULL,
23
  "taxon_concept" text NOT NULL,
24
  "traits" hstore DEFAULT NULL,
25
  PRIMARY KEY ("id"),
26
  /*KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
27
  /*CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
28
  /*CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
29
);
30
/*!40101 SET character_set_client = @saved_cs_client */;
31

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
232
/*!40101 SET @saved_cs_client     = @@character_set_client */;
233
/*!40101 SET character_set_client = utf8 */;
234
CREATE TABLE "geovalidation" (
235
  "id" text NOT NULL,
236
  "geovalid" integer NOT NULL,
237
  "lat_long_domain_valid" integer NOT NULL,
238
  "lat_long_in_ranks" hstore DEFAULT NULL,
239
  PRIMARY KEY ("id"),
240
  /*CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
241
);
242
/*!40101 SET character_set_client = @saved_cs_client */;
243

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
837
/*!40101 SET @saved_cs_client     = @@character_set_client */;
838
/*!40101 SET character_set_client = utf8 */;
839
CREATE TABLE "taxon_assertion" (
840
  "id" text NOT NULL,
841
  "string" text NOT NULL,
842
  "taxon" text DEFAULT NULL,
843
  "cf_aff" text DEFAULT NULL,
844
  "annotations" hstore DEFAULT NULL,
845
  PRIMARY KEY ("id"),
846
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
847
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
848
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
849
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
850
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
851
);
852
/*!40101 SET character_set_client = @saved_cs_client */;
853

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1066
--
1067
-- Dumping data for table "taxon_string"
1068
--
1069

    
1070
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1071
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1072

    
1073
--
1074
-- Table structure for table "validatable_place"
1075
--
1076

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

    
1092
--
1093
-- Dumping data for table "validatable_place"
1094
--
1095

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

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

    
1105
-- Dump completed
(9-9/14)