Project

General

Profile

1
-- MySQL dump 10.11
2
--
3
-- Host: vegbiendev.nceas.ucsb.edu    Database: VegCore
4
-- ------------------------------------------------------
5
-- Server version	5.5.31-0ubuntu0.12.04.1
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
DROP TABLE IF EXISTS "aggregate_observation";
18
CREATE TABLE "aggregate_observation" (
19
  "id" varbinary(767) NOT NULL,
20
  "taxon_concept" varbinary(767) NOT NULL,
21
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
22
  PRIMARY KEY ("id"),
23
  KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept"),
24
  CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
25
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
26
);
27

    
28
--
29
-- Dumping data for table "aggregate_observation"
30
--
31

    
32
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
33
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
34

    
35
--
36
-- Table structure for table "base_class"
37
--
38

    
39
DROP TABLE IF EXISTS "base_class";
40
CREATE TABLE "base_class" (
41
  "id" varbinary(767) NOT NULL,
42
  "referenced_class" varbinary(767) NOT NULL,
43
  PRIMARY KEY ("id"),
44
  KEY "fk_base_class_referenced_class1_idx" ("referenced_class"),
45
  CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
46
  CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
47
);
48

    
49
--
50
-- Dumping data for table "base_class"
51
--
52

    
53
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
54
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
55

    
56
--
57
-- Table structure for table "collection"
58
--
59

    
60
DROP TABLE IF EXISTS "collection";
61
CREATE TABLE "collection" (
62
  "id" varbinary(767) NOT NULL,
63
  "institution" varbinary(767) NOT NULL,
64
  "name" varbinary(767) NOT NULL,
65
  PRIMARY KEY ("id"),
66
  UNIQUE KEY "collection_unique" ("institution","name"),
67
  KEY "fk_collection_organization1_idx" ("institution"),
68
  KEY "fk_collection_source1_idx" ("id"),
69
  CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
70
  CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
71
);
72

    
73
--
74
-- Dumping data for table "collection"
75
--
76

    
77
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
78
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
79

    
80
--
81
-- Table structure for table "community"
82
--
83

    
84
DROP TABLE IF EXISTS "community";
85
CREATE TABLE "community" (
86
  "id" varbinary(767) NOT NULL,
87
  "name" varbinary(767) NOT NULL,
88
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
89
  PRIMARY KEY ("id"),
90
  CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
91
);
92

    
93
--
94
-- Dumping data for table "community"
95
--
96

    
97
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
98
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
99

    
100
--
101
-- Table structure for table "coordinates"
102
--
103

    
104
DROP TABLE IF EXISTS "coordinates";
105
CREATE TABLE "coordinates" (
106
  "id" varbinary(767) NOT NULL,
107
  "latitude_deg" varbinary(767) DEFAULT NULL,
108
  "longitude_deg" varbinary(767) DEFAULT NULL,
109
  PRIMARY KEY ("id")
110
);
111

    
112
--
113
-- Dumping data for table "coordinates"
114
--
115

    
116
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
117
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
118

    
119
--
120
-- Table structure for table "derived_class"
121
--
122

    
123
DROP TABLE IF EXISTS "derived_class";
124
CREATE TABLE "derived_class" (
125
  "id" varbinary(767) NOT NULL,
126
  PRIMARY KEY ("id"),
127
  CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
128
);
129

    
130
--
131
-- Dumping data for table "derived_class"
132
--
133

    
134
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
135
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
136

    
137
--
138
-- Table structure for table "event"
139
--
140

    
141
DROP TABLE IF EXISTS "event";
142
CREATE TABLE "event" (
143
  "id" varbinary(767) NOT NULL,
144
  "parent" varbinary(767) NOT NULL,
145
  "name" varbinary(767) DEFAULT NULL,
146
  "date_range" varbinary(767) DEFAULT NULL,
147
  "place" varbinary(767) DEFAULT NULL,
148
  "method" varbinary(767) DEFAULT NULL,
149
  PRIMARY KEY ("id"),
150
  KEY "fk_event_place1_idx" ("place"),
151
  KEY "fk_event1_idx" ("parent"),
152
  KEY "fk_event_method1_idx" ("method"),
153
  CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
154
  CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
155
  CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
156
  CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
157
);
158

    
159
--
160
-- Dumping data for table "event"
161
--
162

    
163
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
164
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
165

    
166
--
167
-- Table structure for table "event_participant"
168
--
169

    
170
DROP TABLE IF EXISTS "event_participant";
171
CREATE TABLE "event_participant" (
172
  "event" varbinary(767) NOT NULL,
173
  "party" varbinary(767) NOT NULL,
174
  "sort_order" int(11) DEFAULT NULL,
175
  PRIMARY KEY ("event","party"),
176
  KEY "fk_event_has_party_party1_idx" ("party"),
177
  KEY "fk_event_has_party_event1_idx" ("event"),
178
  CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
179
  CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
180
);
181

    
182
--
183
-- Dumping data for table "event_participant"
184
--
185

    
186
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
187
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
188

    
189
--
190
-- Table structure for table "geological_context"
191
--
192

    
193
DROP TABLE IF EXISTS "geological_context";
194
CREATE TABLE "geological_context" (
195
  "id" varbinary(767) NOT NULL,
196
  "name" varbinary(767) NOT NULL,
197
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
198
  PRIMARY KEY ("id"),
199
  CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
200
);
201

    
202
--
203
-- Dumping data for table "geological_context"
204
--
205

    
206
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
207
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
208

    
209
--
210
-- Table structure for table "geovalidation"
211
--
212

    
213
DROP TABLE IF EXISTS "geovalidation";
214
CREATE TABLE "geovalidation" (
215
  "id" varbinary(767) NOT NULL,
216
  "geovalid" tinyint(1) NOT NULL,
217
  "lat_long_domain_valid" tinyint(1) NOT NULL,
218
  "lat_long_in_ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
219
  PRIMARY KEY ("id"),
220
  CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
221
);
222

    
223
--
224
-- Dumping data for table "geovalidation"
225
--
226

    
227
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
228
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
229

    
230
--
231
-- Table structure for table "individual"
232
--
233

    
234
DROP TABLE IF EXISTS "individual";
235
CREATE TABLE "individual" (
236
  "id" varbinary(767) NOT NULL,
237
  "tag" varbinary(767) DEFAULT NULL,
238
  PRIMARY KEY ("id"),
239
  CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
240
);
241

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

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

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

    
253
DROP TABLE IF EXISTS "individual_observation";
254
CREATE TABLE "individual_observation" (
255
  "id" varbinary(767) NOT NULL,
256
  "individual" varbinary(767) DEFAULT NULL,
257
  "code" varbinary(767) DEFAULT NULL,
258
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
259
  PRIMARY KEY ("id"),
260
  KEY "fk_individual_observation_individual1_idx" ("individual"),
261
  CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
262
  CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
263
);
264

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

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

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

    
276
DROP TABLE IF EXISTS "method";
277
CREATE TABLE "method" (
278
  "id" varbinary(767) NOT NULL,
279
  "parent" varbinary(767) NOT NULL,
280
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
281
  PRIMARY KEY ("id"),
282
  KEY "fk_method_method1_idx" ("parent"),
283
  CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
284
  CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
285
);
286

    
287
--
288
-- Dumping data for table "method"
289
--
290

    
291
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
292
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
293

    
294
--
295
-- Table structure for table "organization"
296
--
297

    
298
DROP TABLE IF EXISTS "organization";
299
CREATE TABLE "organization" (
300
  "id" varbinary(767) NOT NULL,
301
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
302
  PRIMARY KEY ("id"),
303
  CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
304
);
305

    
306
--
307
-- Dumping data for table "organization"
308
--
309

    
310
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
311
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
312

    
313
--
314
-- Table structure for table "parsed_taxon_assertion"
315
--
316

    
317
DROP TABLE IF EXISTS "parsed_taxon_assertion";
318
CREATE TABLE "parsed_taxon_assertion" (
319
  "id" varbinary(767) NOT NULL,
320
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
321
  "match_score" float DEFAULT NULL,
322
  "match_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
323
  PRIMARY KEY ("id"),
324
  KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept"),
325
  CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
326
  CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
327
);
328

    
329
--
330
-- Dumping data for table "parsed_taxon_assertion"
331
--
332

    
333
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
334
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
335

    
336
--
337
-- Table structure for table "party"
338
--
339

    
340
DROP TABLE IF EXISTS "party";
341
CREATE TABLE "party" (
342
  "id" varbinary(767) NOT NULL,
343
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
344
  PRIMARY KEY ("id"),
345
  CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
346
);
347

    
348
--
349
-- Dumping data for table "party"
350
--
351

    
352
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
353
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
354

    
355
--
356
-- Table structure for table "place"
357
--
358

    
359
DROP TABLE IF EXISTS "place";
360
CREATE TABLE "place" (
361
  "id" varbinary(767) NOT NULL,
362
  "parent" varbinary(767) NOT NULL,
363
  "coordinates" varbinary(767) DEFAULT NULL,
364
  "path" varbinary(767) DEFAULT NULL,
365
  "locality" varbinary(767) DEFAULT NULL,
366
  PRIMARY KEY ("id"),
367
  KEY "fk_place_coordinates1_idx" ("coordinates"),
368
  KEY "fk_place1_idx" ("parent"),
369
  KEY "fk_place_place_path1_idx" ("path"),
370
  CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
371
  CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
372
  CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
373
  CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
374
);
375

    
376
--
377
-- Dumping data for table "place"
378
--
379

    
380
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
381
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
382

    
383
--
384
-- Table structure for table "place_observation"
385
--
386

    
387
DROP TABLE IF EXISTS "place_observation";
388
CREATE TABLE "place_observation" (
389
  "id" varbinary(767) NOT NULL,
390
  "place" varbinary(767) NOT NULL,
391
  "elevation_m" double DEFAULT NULL,
392
  "slope_incline_deg" double DEFAULT NULL,
393
  "slope_direction_deg_N" double DEFAULT NULL,
394
  "geological_context" varbinary(767) DEFAULT NULL,
395
  "community" varbinary(767) DEFAULT NULL,
396
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
397
  PRIMARY KEY ("id"),
398
  KEY "fk_place_observation_place1_idx" ("place"),
399
  KEY "fk_place_observation_geological_context1_idx" ("geological_context"),
400
  KEY "fk_place_observation_community1_idx" ("community"),
401
  KEY "fk_place_observation_event1_idx" ("id"),
402
  CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
403
  CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
404
  CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
405
  CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
406
);
407

    
408
--
409
-- Dumping data for table "place_observation"
410
--
411

    
412
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
413
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
414

    
415
--
416
-- Table structure for table "place_path"
417
--
418

    
419
DROP TABLE IF EXISTS "place_path";
420
CREATE TABLE "place_path" (
421
  "id" varbinary(767) NOT NULL,
422
  "continent" varbinary(767) DEFAULT NULL,
423
  "country" varbinary(767) DEFAULT NULL,
424
  "state_province" varbinary(767) DEFAULT NULL,
425
  "county" varbinary(767) DEFAULT NULL,
426
  "municipality" varbinary(767) DEFAULT NULL,
427
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
428
  PRIMARY KEY ("id")
429
);
430

    
431
--
432
-- Dumping data for table "place_path"
433
--
434

    
435
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
436
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
437

    
438
--
439
-- Table structure for table "plot"
440
--
441

    
442
DROP TABLE IF EXISTS "plot";
443
CREATE TABLE "plot" (
444
  "id" varbinary(767) NOT NULL,
445
  "name" varbinary(767) DEFAULT NULL,
446
  "area_m2" double DEFAULT NULL,
447
  "bounding_box" varbinary(767) DEFAULT NULL,
448
  PRIMARY KEY ("id"),
449
  CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
450
);
451

    
452
--
453
-- Dumping data for table "plot"
454
--
455

    
456
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
457
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
458

    
459
--
460
-- Table structure for table "project"
461
--
462

    
463
DROP TABLE IF EXISTS "project";
464
CREATE TABLE "project" (
465
  "id" varbinary(767) NOT NULL,
466
  "name" varbinary(767) NOT NULL,
467
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
468
  PRIMARY KEY ("id"),
469
  CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
470
);
471

    
472
--
473
-- Dumping data for table "project"
474
--
475

    
476
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
477
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
478

    
479
--
480
-- Table structure for table "record"
481
--
482

    
483
DROP TABLE IF EXISTS "record";
484
CREATE TABLE "record" (
485
  "id" varbinary(767) NOT NULL,
486
  "source" varbinary(767) NOT NULL,
487
  "source_id_scope" varbinary(767) DEFAULT NULL,
488
  "source_record_id" varbinary(767) DEFAULT NULL,
489
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
490
  PRIMARY KEY ("id"),
491
  UNIQUE KEY "record_unique" ("source","source_id_scope","source_record_id"),
492
  KEY "fk_record_source1_idx" ("source"),
493
  CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE
494
);
495

    
496
--
497
-- Dumping data for table "record"
498
--
499

    
500
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
501
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
502

    
503
--
504
-- Table structure for table "referenced_class"
505
--
506

    
507
DROP TABLE IF EXISTS "referenced_class";
508
CREATE TABLE "referenced_class" (
509
  "id" varbinary(767) NOT NULL,
510
  PRIMARY KEY ("id"),
511
  CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
512
);
513

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

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

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

    
525
DROP TABLE IF EXISTS "relationship";
526
CREATE TABLE "relationship" (
527
  "id" varbinary(767) NOT NULL,
528
  "record" varbinary(767) NOT NULL,
529
  "related_record" varbinary(767) NOT NULL,
530
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
531
  PRIMARY KEY ("id"),
532
  KEY "fk_relationship_record1_idx" ("record"),
533
  KEY "fk_relationship_related_record_idx" ("related_record"),
534
  CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
535
  CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
536
  CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
537
);
538

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

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

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

    
550
DROP TABLE IF EXISTS "soil_observation";
551
CREATE TABLE "soil_observation" (
552
  "id" varbinary(767) NOT NULL,
553
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
554
  PRIMARY KEY ("id"),
555
  CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
556
);
557

    
558
--
559
-- Dumping data for table "soil_observation"
560
--
561

    
562
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
563
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
564

    
565
--
566
-- Table structure for table "source"
567
--
568

    
569
DROP TABLE IF EXISTS "source";
570
CREATE TABLE "source" (
571
  "id" varbinary(767) NOT NULL,
572
  "parent" varbinary(767) NOT NULL,
573
  "name" varbinary(767) NOT NULL,
574
  "first_publisher" varbinary(767) DEFAULT NULL,
575
  "owner" varbinary(767) DEFAULT NULL,
576
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
577
  PRIMARY KEY ("id"),
578
  UNIQUE KEY "source_unique" ("parent","name"),
579
  KEY "fk_source1_idx" ("parent"),
580
  KEY "fk_source_party2_idx" ("first_publisher"),
581
  KEY "fk_source_party1_idx" ("owner"),
582
  CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
583
  CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
584
  CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
585
);
586

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

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

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

    
598
DROP TABLE IF EXISTS "specimen";
599
CREATE TABLE "specimen" (
600
  "id" varbinary(767) NOT NULL,
601
  "individual" varbinary(767) DEFAULT NULL,
602
  "code_in_individual" varbinary(767) DEFAULT NULL,
603
  "collection_event" varbinary(767) DEFAULT NULL,
604
  "orig_collection" varbinary(767) DEFAULT NULL,
605
  "barcode" varbinary(767) DEFAULT NULL,
606
  "accession_number" varbinary(767) DEFAULT NULL,
607
  "current_collection" varbinary(767) DEFAULT NULL,
608
  "owner_collection" varbinary(767) DEFAULT NULL,
609
  PRIMARY KEY ("id"),
610
  UNIQUE KEY "specimen_unique_in_individual" ("individual","code_in_individual"),
611
  UNIQUE KEY "specimen_unique_by_collection_event" ("collection_event"),
612
  UNIQUE KEY "specimen_unique_in_collection_by_barcode" ("orig_collection","barcode"),
613
  UNIQUE KEY "specimen_unique_in_collection_by_accession_number" ("orig_collection","accession_number"),
614
  KEY "fk_specimen_collection1_idx" ("orig_collection"),
615
  KEY "fk_specimen_taxon_observation1_idx" ("collection_event"),
616
  KEY "fk_specimen_individual1_idx" ("individual"),
617
  KEY "fk_specimen_collection2_idx" ("current_collection"),
618
  KEY "fk_specimen_organization3_idx" ("owner_collection"),
619
  CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
620
  CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
621
  CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
622
  CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
623
  CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
624
  CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
625
);
626

    
627
--
628
-- Dumping data for table "specimen"
629
--
630

    
631
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
632
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
633

    
634
--
635
-- Table structure for table "specimen_observation"
636
--
637

    
638
DROP TABLE IF EXISTS "specimen_observation";
639
CREATE TABLE "specimen_observation" (
640
  "id" varbinary(767) NOT NULL,
641
  "specimen" varbinary(767) NOT NULL,
642
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
643
  PRIMARY KEY ("id"),
644
  KEY "fk_specimen_observation_specimen1_idx" ("specimen"),
645
  CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
646
  CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
647
);
648

    
649
--
650
-- Dumping data for table "specimen_observation"
651
--
652

    
653
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
654
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
655

    
656
--
657
-- Table structure for table "stem"
658
--
659

    
660
DROP TABLE IF EXISTS "stem";
661
CREATE TABLE "stem" (
662
  "id" varbinary(767) NOT NULL,
663
  "individual" varbinary(767) NOT NULL,
664
  PRIMARY KEY ("id"),
665
  KEY "fk_stem_individual1_idx" ("individual"),
666
  CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
667
  CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
668
);
669

    
670
--
671
-- Dumping data for table "stem"
672
--
673

    
674
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
675
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
676

    
677
--
678
-- Table structure for table "stem_observation"
679
--
680

    
681
DROP TABLE IF EXISTS "stem_observation";
682
CREATE TABLE "stem_observation" (
683
  "id" varbinary(767) NOT NULL,
684
  "individual_observation" varbinary(767) NOT NULL,
685
  "stem" varbinary(767) DEFAULT NULL,
686
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
687
  PRIMARY KEY ("id"),
688
  UNIQUE KEY "stem_observation_unique" ("individual_observation","stem"),
689
  KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation"),
690
  KEY "fk_stem_observation_stem1_idx" ("stem"),
691
  CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
692
  CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
693
  CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE
694
);
695

    
696
--
697
-- Dumping data for table "stem_observation"
698
--
699

    
700
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
701
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
702

    
703
--
704
-- Table structure for table "stratum"
705
--
706

    
707
DROP TABLE IF EXISTS "stratum";
708
CREATE TABLE "stratum" (
709
  "id" varbinary(767) NOT NULL,
710
  "name" varbinary(767) NOT NULL,
711
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
712
  PRIMARY KEY ("id"),
713
  CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
714
);
715

    
716
--
717
-- Dumping data for table "stratum"
718
--
719

    
720
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
721
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
722

    
723
--
724
-- Table structure for table "subplot"
725
--
726

    
727
DROP TABLE IF EXISTS "subplot";
728
CREATE TABLE "subplot" (
729
  "id" varbinary(767) NOT NULL,
730
  "x_m" double DEFAULT NULL,
731
  "y_m" double DEFAULT NULL,
732
  PRIMARY KEY ("id"),
733
  CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE
734
);
735

    
736
--
737
-- Dumping data for table "subplot"
738
--
739

    
740
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
741
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
742

    
743
--
744
-- Table structure for table "taxon_assertion"
745
--
746

    
747
DROP TABLE IF EXISTS "taxon_assertion";
748
CREATE TABLE "taxon_assertion" (
749
  "id" varbinary(767) NOT NULL,
750
  "string" varbinary(767) NOT NULL,
751
  "taxon" varbinary(767) DEFAULT NULL,
752
  "cf_aff" varbinary(767) DEFAULT NULL,
753
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
754
  PRIMARY KEY ("id"),
755
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
756
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
757
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
758
  CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
759
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
760
);
761

    
762
--
763
-- Dumping data for table "taxon_assertion"
764
--
765

    
766
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
767
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
768

    
769
--
770
-- Table structure for table "taxon_concept"
771
--
772

    
773
DROP TABLE IF EXISTS "taxon_concept";
774
CREATE TABLE "taxon_concept" (
775
  "id" varbinary(767) NOT NULL,
776
  "according_to" varbinary(767) NOT NULL,
777
  "parent" varbinary(767) NOT NULL,
778
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
779
  PRIMARY KEY ("id"),
780
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
781
  KEY "fk_taxon_taxon1_idx" ("parent"),
782
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
783
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
784
  CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
785
  CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
786
  CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
787
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
788
);
789

    
790
--
791
-- Dumping data for table "taxon_concept"
792
--
793

    
794
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
795
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
796

    
797
--
798
-- Table structure for table "taxon_determination"
799
--
800

    
801
DROP TABLE IF EXISTS "taxon_determination";
802
CREATE TABLE "taxon_determination" (
803
  "id" varbinary(767) NOT NULL,
804
  "taxon_assertion" varbinary(767) NOT NULL,
805
  "identified_by" varbinary(767) DEFAULT NULL,
806
  "fit_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
807
  PRIMARY KEY ("id"),
808
  UNIQUE KEY "taxon_determination_unique" ("taxon_assertion","identified_by"),
809
  KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion"),
810
  KEY "fk_taxon_determination_party1_idx" ("identified_by"),
811
  CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
812
  CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
813
  CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
814
);
815

    
816
--
817
-- Dumping data for table "taxon_determination"
818
--
819

    
820
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
821
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
822

    
823
--
824
-- Table structure for table "taxon_name"
825
--
826

    
827
DROP TABLE IF EXISTS "taxon_name";
828
CREATE TABLE "taxon_name" (
829
  "id" varbinary(767) NOT NULL,
830
  "unique_name" varbinary(767) NOT NULL,
831
  "formal_name" varbinary(767) DEFAULT NULL,
832
  "taxon_name" varbinary(767) DEFAULT NULL,
833
  "author" varbinary(767) DEFAULT NULL,
834
  "common_name" varbinary(767) DEFAULT NULL,
835
  "rank" varbinary(767) DEFAULT NULL,
836
  PRIMARY KEY ("id"),
837
  KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name"),
838
  CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE,
839
  CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
840
);
841

    
842
--
843
-- Dumping data for table "taxon_name"
844
--
845

    
846
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
847
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
848

    
849
--
850
-- Table structure for table "taxon_observation"
851
--
852

    
853
DROP TABLE IF EXISTS "taxon_observation";
854
CREATE TABLE "taxon_observation" (
855
  "id" varbinary(767) NOT NULL,
856
  "taxon_occurrence" varbinary(767) NOT NULL,
857
  "collector" varbinary(767) DEFAULT NULL,
858
  "collector_number" varbinary(767) DEFAULT NULL,
859
  "voucher" varbinary(767) DEFAULT NULL,
860
  "growth_form" varbinary(767) DEFAULT NULL,
861
  "cultivated" tinyint(1) DEFAULT NULL,
862
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
863
  PRIMARY KEY ("id"),
864
  KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence"),
865
  KEY "fk_taxon_observation_specimen1_idx" ("voucher"),
866
  KEY "fk_taxon_observation_party1_idx" ("collector"),
867
  CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
868
  CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
869
  CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
870
  CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
871
);
872

    
873
--
874
-- Dumping data for table "taxon_observation"
875
--
876

    
877
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
878
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
879

    
880
--
881
-- Table structure for table "taxon_occurrence"
882
--
883

    
884
DROP TABLE IF EXISTS "taxon_occurrence";
885
CREATE TABLE "taxon_occurrence" (
886
  "id" varbinary(767) NOT NULL,
887
  "current_determination" varbinary(767) DEFAULT NULL,
888
  "original_determination" varbinary(767) DEFAULT NULL,
889
  PRIMARY KEY ("id"),
890
  KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination"),
891
  KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination"),
892
  CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
893
  CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
894
  CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE
895
);
896

    
897
--
898
-- Dumping data for table "taxon_occurrence"
899
--
900

    
901
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
902
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
903

    
904
--
905
-- Table structure for table "taxon_path"
906
--
907

    
908
DROP TABLE IF EXISTS "taxon_path";
909
CREATE TABLE "taxon_path" (
910
  "id" varbinary(767) NOT NULL,
911
  "family" varbinary(767) DEFAULT NULL,
912
  "genus" varbinary(767) DEFAULT NULL,
913
  "specific_epithet" varbinary(767) DEFAULT NULL,
914
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
915
  PRIMARY KEY ("id"),
916
  CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
917
);
918

    
919
--
920
-- Dumping data for table "taxon_path"
921
--
922

    
923
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
924
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
925

    
926
--
927
-- Table structure for table "taxon_presence"
928
--
929

    
930
DROP TABLE IF EXISTS "taxon_presence";
931
CREATE TABLE "taxon_presence" (
932
  "id" varbinary(767) NOT NULL,
933
  "taxon_concept" varbinary(767) NOT NULL,
934
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
935
  PRIMARY KEY ("id"),
936
  KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept"),
937
  CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
938
  CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
939
);
940

    
941
--
942
-- Dumping data for table "taxon_presence"
943
--
944

    
945
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
946
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
947

    
948
--
949
-- Table structure for table "taxon_string"
950
--
951

    
952
DROP TABLE IF EXISTS "taxon_string";
953
CREATE TABLE "taxon_string" (
954
  "string" varbinary(767) NOT NULL,
955
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
956
  PRIMARY KEY ("string"),
957
  KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion"),
958
  CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
959
);
960

    
961
--
962
-- Dumping data for table "taxon_string"
963
--
964

    
965
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
966
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
967

    
968
--
969
-- Table structure for table "validatable_place"
970
--
971

    
972
DROP TABLE IF EXISTS "validatable_place";
973
CREATE TABLE "validatable_place" (
974
  "id" varbinary(767) NOT NULL,
975
  "coordinates" varbinary(767) NOT NULL,
976
  "path" varbinary(767) NOT NULL,
977
  PRIMARY KEY ("id"),
978
  UNIQUE KEY "validatable_place_unique" ("path","coordinates"),
979
  KEY "fk_geovalidation_place_path1_idx" ("path"),
980
  KEY "fk_geovalidation_coordinates1_idx" ("coordinates"),
981
  CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
982
  CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE
983
);
984

    
985
--
986
-- Dumping data for table "validatable_place"
987
--
988

    
989
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
990
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
991
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
992

    
993
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
994
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
995
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
996
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
997

    
998
-- Dump completed
(8-8/13)