Project

General

Profile

1 8928 aaronmk
-- 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 8336 aaronmk
13 8928 aaronmk
--
14
-- Table structure for table "aggregate_observation"
15
--
16 8336 aaronmk
17 8928 aaronmk
CREATE TABLE "aggregate_observation" (
18
  "id" varbinary(767) NOT NULL,
19
  "taxon_concept" varbinary(767) NOT NULL,
20
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
21
  PRIMARY KEY ("id"),
22
  KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept"),
23
  CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
24
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
25
);
26 8632 aaronmk
27 8928 aaronmk
--
28
-- Dumping data for table "aggregate_observation"
29
--
30 8336 aaronmk
31 8928 aaronmk
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
32
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
33 8336 aaronmk
34 8928 aaronmk
--
35
-- Table structure for table "base_class"
36
--
37 8632 aaronmk
38 8928 aaronmk
CREATE TABLE "base_class" (
39
  "id" varbinary(767) NOT NULL,
40
  "referenced_class" varbinary(767) NOT NULL,
41
  PRIMARY KEY ("id"),
42
  KEY "fk_base_class_referenced_class1_idx" ("referenced_class"),
43
  CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
44
  CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
45
);
46 8336 aaronmk
47 8928 aaronmk
--
48
-- Dumping data for table "base_class"
49
--
50 8336 aaronmk
51 8928 aaronmk
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
52
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
53 8632 aaronmk
54 8928 aaronmk
--
55
-- Table structure for table "collection"
56
--
57 8623 aaronmk
58 8928 aaronmk
CREATE TABLE "collection" (
59
  "id" varbinary(767) NOT NULL,
60
  "institution" varbinary(767) NOT NULL,
61
  "name" varbinary(767) NOT NULL,
62
  PRIMARY KEY ("id"),
63
  UNIQUE KEY "collection_unique" ("institution","name"),
64
  KEY "fk_collection_organization1_idx" ("institution"),
65
  KEY "fk_collection_source1_idx" ("id"),
66
  CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
67
  CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
68
);
69 8623 aaronmk
70 8928 aaronmk
--
71
-- Dumping data for table "collection"
72
--
73 8632 aaronmk
74 8928 aaronmk
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
75
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
76 8336 aaronmk
77 8928 aaronmk
--
78
-- Table structure for table "community"
79
--
80 8336 aaronmk
81 8928 aaronmk
CREATE TABLE "community" (
82
  "id" varbinary(767) NOT NULL,
83
  "name" varbinary(767) NOT NULL,
84
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
85
  PRIMARY KEY ("id"),
86
  CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
87
);
88 8677 aaronmk
89 8928 aaronmk
--
90
-- Dumping data for table "community"
91
--
92 8677 aaronmk
93 8928 aaronmk
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
94
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
95 8677 aaronmk
96 8928 aaronmk
--
97
-- Table structure for table "coordinates"
98
--
99 8632 aaronmk
100 8928 aaronmk
CREATE TABLE "coordinates" (
101
  "id" varbinary(767) NOT NULL,
102
  "latitude_deg" varbinary(767) DEFAULT NULL,
103
  "longitude_deg" varbinary(767) DEFAULT NULL,
104
  PRIMARY KEY ("id")
105
);
106 8623 aaronmk
107 8928 aaronmk
--
108
-- Dumping data for table "coordinates"
109
--
110 8623 aaronmk
111 8928 aaronmk
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
112
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
113 8632 aaronmk
114 8928 aaronmk
--
115
-- Table structure for table "derived_class"
116
--
117 8554 aaronmk
118 8928 aaronmk
CREATE TABLE "derived_class" (
119
  "id" varbinary(767) NOT NULL,
120
  PRIMARY KEY ("id"),
121
  CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
122
);
123 8554 aaronmk
124 8928 aaronmk
--
125
-- Dumping data for table "derived_class"
126
--
127 8676 aaronmk
128 8928 aaronmk
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
129
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
130 8676 aaronmk
131 8928 aaronmk
--
132
-- Table structure for table "event"
133
--
134 8676 aaronmk
135 8928 aaronmk
CREATE TABLE "event" (
136
  "id" varbinary(767) NOT NULL,
137
  "parent" varbinary(767) NOT NULL,
138
  "name" varbinary(767) DEFAULT NULL,
139
  "date_range" varbinary(767) DEFAULT NULL,
140
  "place" varbinary(767) DEFAULT NULL,
141
  "method" varbinary(767) DEFAULT NULL,
142
  PRIMARY KEY ("id"),
143
  KEY "fk_event_place1_idx" ("place"),
144
  KEY "fk_event1_idx" ("parent"),
145
  KEY "fk_event_method1_idx" ("method"),
146
  CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
147
  CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
148
  CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
149
  CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
150
);
151 8632 aaronmk
152 8928 aaronmk
--
153
-- Dumping data for table "event"
154
--
155 8554 aaronmk
156 8928 aaronmk
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
157
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
158 8554 aaronmk
159 8928 aaronmk
--
160
-- Table structure for table "event_participant"
161
--
162 8632 aaronmk
163 8928 aaronmk
CREATE TABLE "event_participant" (
164
  "event" varbinary(767) NOT NULL,
165
  "party" varbinary(767) NOT NULL,
166
  "sort_order" int(11) DEFAULT NULL,
167
  PRIMARY KEY ("event","party"),
168
  KEY "fk_event_has_party_party1_idx" ("party"),
169
  KEY "fk_event_has_party_event1_idx" ("event"),
170
  CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
171
  CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
172
);
173 8552 aaronmk
174 8928 aaronmk
--
175
-- Dumping data for table "event_participant"
176
--
177 8552 aaronmk
178 8928 aaronmk
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
179
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
180 8632 aaronmk
181 8928 aaronmk
--
182
-- Table structure for table "geological_context"
183
--
184 8521 aaronmk
185 8928 aaronmk
CREATE TABLE "geological_context" (
186
  "id" varbinary(767) NOT NULL,
187
  "name" varbinary(767) NOT NULL,
188
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
189
  PRIMARY KEY ("id"),
190
  CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
191
);
192 8521 aaronmk
193 8928 aaronmk
--
194
-- Dumping data for table "geological_context"
195
--
196 8632 aaronmk
197 8928 aaronmk
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
198
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
199 8336 aaronmk
200 8928 aaronmk
--
201
-- Table structure for table "geovalidation"
202
--
203 8336 aaronmk
204 8928 aaronmk
CREATE TABLE "geovalidation" (
205
  "id" varbinary(767) NOT NULL,
206
  "geovalid" tinyint(1) NOT NULL,
207
  "lat_long_domain_valid" tinyint(1) NOT NULL,
208
  "lat_long_in_ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
209
  PRIMARY KEY ("id"),
210
  CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
211
);
212 8632 aaronmk
213 8928 aaronmk
--
214
-- Dumping data for table "geovalidation"
215
--
216 8567 aaronmk
217 8928 aaronmk
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
218
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
219 8567 aaronmk
220 8928 aaronmk
--
221
-- Table structure for table "individual"
222
--
223 8632 aaronmk
224 8928 aaronmk
CREATE TABLE "individual" (
225
  "id" varbinary(767) NOT NULL,
226
  "tag" varbinary(767) DEFAULT NULL,
227
  PRIMARY KEY ("id"),
228
  CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
229
);
230 8336 aaronmk
231 8928 aaronmk
--
232
-- Dumping data for table "individual"
233
--
234 8336 aaronmk
235 8928 aaronmk
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
236
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
237 8632 aaronmk
238 8928 aaronmk
--
239
-- Table structure for table "individual_observation"
240
--
241 8336 aaronmk
242 8928 aaronmk
CREATE TABLE "individual_observation" (
243
  "id" varbinary(767) NOT NULL,
244
  "individual" varbinary(767) DEFAULT NULL,
245
  "code" varbinary(767) DEFAULT NULL,
246
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
247
  PRIMARY KEY ("id"),
248
  KEY "fk_individual_observation_individual1_idx" ("individual"),
249
  CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
250
  CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
251
);
252 8336 aaronmk
253 8928 aaronmk
--
254
-- Dumping data for table "individual_observation"
255
--
256 8632 aaronmk
257 8928 aaronmk
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
258
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
259 8336 aaronmk
260 8928 aaronmk
--
261
-- Table structure for table "method"
262
--
263 8336 aaronmk
264 8928 aaronmk
CREATE TABLE "method" (
265
  "id" varbinary(767) NOT NULL,
266
  "parent" varbinary(767) NOT NULL,
267
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
268
  PRIMARY KEY ("id"),
269
  KEY "fk_method_method1_idx" ("parent"),
270
  CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
271
  CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
272
);
273 8632 aaronmk
274 8928 aaronmk
--
275
-- Dumping data for table "method"
276
--
277 8623 aaronmk
278 8928 aaronmk
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
279
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
280 8623 aaronmk
281 8928 aaronmk
--
282
-- Table structure for table "organization"
283
--
284 8632 aaronmk
285 8928 aaronmk
CREATE TABLE "organization" (
286
  "id" varbinary(767) NOT NULL,
287
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
288
  PRIMARY KEY ("id"),
289
  CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
290
);
291 8581 aaronmk
292 8928 aaronmk
--
293
-- Dumping data for table "organization"
294
--
295 8581 aaronmk
296 8928 aaronmk
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
297
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
298 8632 aaronmk
299 8928 aaronmk
--
300
-- Table structure for table "parsed_taxon_assertion"
301
--
302 8581 aaronmk
303 8928 aaronmk
CREATE TABLE "parsed_taxon_assertion" (
304
  "id" varbinary(767) NOT NULL,
305
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
306
  "match_score" float DEFAULT NULL,
307
  "match_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
308
  PRIMARY KEY ("id"),
309
  KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept"),
310
  CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
311
  CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
312
);
313 8581 aaronmk
314 8928 aaronmk
--
315
-- Dumping data for table "parsed_taxon_assertion"
316
--
317 8632 aaronmk
318 8928 aaronmk
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
319
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
320 8336 aaronmk
321 8928 aaronmk
--
322
-- Table structure for table "party"
323
--
324 8336 aaronmk
325 8928 aaronmk
CREATE TABLE "party" (
326
  "id" varbinary(767) NOT NULL,
327
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
328
  PRIMARY KEY ("id"),
329
  CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
330
);
331 8632 aaronmk
332 8928 aaronmk
--
333
-- Dumping data for table "party"
334
--
335 8336 aaronmk
336 8928 aaronmk
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
337
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
338 8336 aaronmk
339 8928 aaronmk
--
340
-- Table structure for table "place"
341
--
342 8632 aaronmk
343 8928 aaronmk
CREATE TABLE "place" (
344
  "id" varbinary(767) NOT NULL,
345
  "parent" varbinary(767) NOT NULL,
346
  "coordinates" varbinary(767) DEFAULT NULL,
347
  "path" varbinary(767) DEFAULT NULL,
348
  "locality" varbinary(767) DEFAULT NULL,
349
  PRIMARY KEY ("id"),
350
  KEY "fk_place_coordinates1_idx" ("coordinates"),
351
  KEY "fk_place1_idx" ("parent"),
352
  KEY "fk_place_place_path1_idx" ("path"),
353
  CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
354
  CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
355
  CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
356
  CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
357
);
358 8336 aaronmk
359 8928 aaronmk
--
360
-- Dumping data for table "place"
361
--
362 8336 aaronmk
363 8928 aaronmk
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
364
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
365 8632 aaronmk
366 8928 aaronmk
--
367
-- Table structure for table "place_observation"
368
--
369 8573 aaronmk
370 8928 aaronmk
CREATE TABLE "place_observation" (
371
  "id" varbinary(767) NOT NULL,
372
  "place" varbinary(767) NOT NULL,
373
  "elevation_m" double DEFAULT NULL,
374
  "slope_incline_deg" double DEFAULT NULL,
375
  "slope_direction_deg_N" double DEFAULT NULL,
376
  "geological_context" varbinary(767) DEFAULT NULL,
377
  "community" varbinary(767) DEFAULT NULL,
378
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
379
  PRIMARY KEY ("id"),
380
  KEY "fk_place_observation_place1_idx" ("place"),
381
  KEY "fk_place_observation_geological_context1_idx" ("geological_context"),
382
  KEY "fk_place_observation_community1_idx" ("community"),
383
  KEY "fk_place_observation_event1_idx" ("id"),
384
  CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
385
  CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
386
  CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
387
  CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
388
);
389 8573 aaronmk
390 8928 aaronmk
--
391
-- Dumping data for table "place_observation"
392
--
393 8632 aaronmk
394 8928 aaronmk
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
395
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
396 8336 aaronmk
397 8928 aaronmk
--
398
-- Table structure for table "place_path"
399
--
400 8336 aaronmk
401 8928 aaronmk
CREATE TABLE "place_path" (
402
  "id" varbinary(767) NOT NULL,
403
  "continent" varbinary(767) DEFAULT NULL,
404
  "country" varbinary(767) DEFAULT NULL,
405
  "state_province" varbinary(767) DEFAULT NULL,
406
  "county" varbinary(767) DEFAULT NULL,
407
  "municipality" varbinary(767) DEFAULT NULL,
408
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
409
  PRIMARY KEY ("id")
410
);
411 8632 aaronmk
412 8928 aaronmk
--
413
-- Dumping data for table "place_path"
414
--
415 8336 aaronmk
416 8928 aaronmk
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
417
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
418 8336 aaronmk
419 8928 aaronmk
--
420
-- Table structure for table "plot"
421
--
422 8632 aaronmk
423 8928 aaronmk
CREATE TABLE "plot" (
424
  "id" varbinary(767) NOT NULL,
425
  "name" varbinary(767) DEFAULT NULL,
426
  "area_m2" double DEFAULT NULL,
427
  "bounding_box" varbinary(767) DEFAULT NULL,
428
  PRIMARY KEY ("id"),
429
  CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
430
);
431 8336 aaronmk
432 8928 aaronmk
--
433
-- Dumping data for table "plot"
434
--
435 8336 aaronmk
436 8928 aaronmk
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
437
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
438 8632 aaronmk
439 8928 aaronmk
--
440
-- Table structure for table "project"
441
--
442 8336 aaronmk
443 8928 aaronmk
CREATE TABLE "project" (
444
  "id" varbinary(767) NOT NULL,
445
  "name" varbinary(767) NOT NULL,
446
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
447
  PRIMARY KEY ("id"),
448
  CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
449
);
450 8336 aaronmk
451 8928 aaronmk
--
452
-- Dumping data for table "project"
453
--
454 8632 aaronmk
455 8928 aaronmk
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
456
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
457 8336 aaronmk
458 8928 aaronmk
--
459
-- Table structure for table "record"
460
--
461 8336 aaronmk
462 8928 aaronmk
CREATE TABLE "record" (
463
  "id" varbinary(767) NOT NULL,
464
  "source" varbinary(767) NOT NULL,
465
  "source_id_scope" varbinary(767) DEFAULT NULL,
466
  "source_record_id" varbinary(767) DEFAULT NULL,
467
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
468
  PRIMARY KEY ("id"),
469
  UNIQUE KEY "record_unique" ("source","source_id_scope","source_record_id"),
470
  KEY "fk_record_source1_idx" ("source"),
471
  CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE
472
);
473 8632 aaronmk
474 8928 aaronmk
--
475
-- Dumping data for table "record"
476
--
477 8532 aaronmk
478 8928 aaronmk
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
479
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
480 8532 aaronmk
481 8928 aaronmk
--
482
-- Table structure for table "referenced_class"
483
--
484 8632 aaronmk
485 8928 aaronmk
CREATE TABLE "referenced_class" (
486
  "id" varbinary(767) NOT NULL,
487
  PRIMARY KEY ("id"),
488
  CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
489
);
490 8565 aaronmk
491 8928 aaronmk
--
492
-- Dumping data for table "referenced_class"
493
--
494 8565 aaronmk
495 8928 aaronmk
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
496
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
497 8632 aaronmk
498 8928 aaronmk
--
499
-- Table structure for table "relationship"
500
--
501 8623 aaronmk
502 8928 aaronmk
CREATE TABLE "relationship" (
503
  "id" varbinary(767) NOT NULL,
504
  "record" varbinary(767) NOT NULL,
505
  "related_record" varbinary(767) NOT NULL,
506
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
507
  PRIMARY KEY ("id"),
508
  KEY "fk_relationship_record1_idx" ("record"),
509
  KEY "fk_relationship_related_record_idx" ("related_record"),
510
  CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
511
  CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
512
  CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
513
);
514 8623 aaronmk
515 8928 aaronmk
--
516
-- Dumping data for table "relationship"
517
--
518 8632 aaronmk
519 8928 aaronmk
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
520
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
521 8623 aaronmk
522 8928 aaronmk
--
523
-- Table structure for table "soil_observation"
524
--
525 8623 aaronmk
526 8928 aaronmk
CREATE TABLE "soil_observation" (
527
  "id" varbinary(767) NOT NULL,
528
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
529
  PRIMARY KEY ("id"),
530
  CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
531
);
532 8632 aaronmk
533 8928 aaronmk
--
534
-- Dumping data for table "soil_observation"
535
--
536 8623 aaronmk
537 8928 aaronmk
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
538
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
539 8623 aaronmk
540 8928 aaronmk
--
541
-- Table structure for table "source"
542
--
543 8632 aaronmk
544 8928 aaronmk
CREATE TABLE "source" (
545
  "id" varbinary(767) NOT NULL,
546
  "parent" varbinary(767) NOT NULL,
547
  "name" varbinary(767) NOT NULL,
548
  "first_publisher" varbinary(767) DEFAULT NULL,
549
  "owner" varbinary(767) DEFAULT NULL,
550
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
551
  PRIMARY KEY ("id"),
552
  UNIQUE KEY "source_unique" ("parent","name"),
553
  KEY "fk_source1_idx" ("parent"),
554
  KEY "fk_source_party2_idx" ("first_publisher"),
555
  KEY "fk_source_party1_idx" ("owner"),
556
  CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
557
  CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
558
  CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
559
);
560 8336 aaronmk
561 8928 aaronmk
--
562
-- Dumping data for table "source"
563
--
564 8336 aaronmk
565 8928 aaronmk
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
566
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
567 8632 aaronmk
568 8928 aaronmk
--
569
-- Table structure for table "specimen"
570
--
571 8336 aaronmk
572 8928 aaronmk
CREATE TABLE "specimen" (
573
  "id" varbinary(767) NOT NULL,
574
  "individual" varbinary(767) DEFAULT NULL,
575
  "code_in_individual" varbinary(767) DEFAULT NULL,
576
  "collection_event" varbinary(767) DEFAULT NULL,
577
  "orig_collection" varbinary(767) DEFAULT NULL,
578
  "barcode" varbinary(767) DEFAULT NULL,
579
  "accession_number" varbinary(767) DEFAULT NULL,
580
  "current_collection" varbinary(767) DEFAULT NULL,
581
  "owner_collection" varbinary(767) DEFAULT NULL,
582
  PRIMARY KEY ("id"),
583
  UNIQUE KEY "specimen_unique_in_individual" ("individual","code_in_individual"),
584
  UNIQUE KEY "specimen_unique_by_collection_event" ("collection_event"),
585
  UNIQUE KEY "specimen_unique_in_collection_by_barcode" ("orig_collection","barcode"),
586
  UNIQUE KEY "specimen_unique_in_collection_by_accession_number" ("orig_collection","accession_number"),
587
  KEY "fk_specimen_collection1_idx" ("orig_collection"),
588
  KEY "fk_specimen_taxon_observation1_idx" ("collection_event"),
589
  KEY "fk_specimen_individual1_idx" ("individual"),
590
  KEY "fk_specimen_collection2_idx" ("current_collection"),
591
  KEY "fk_specimen_organization3_idx" ("owner_collection"),
592
  CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
593
  CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
594
  CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
595
  CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
596
  CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
597
  CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
598
);
599 8521 aaronmk
600 8928 aaronmk
--
601
-- Dumping data for table "specimen"
602
--
603 8632 aaronmk
604 8928 aaronmk
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
605
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
606 8521 aaronmk
607 8928 aaronmk
--
608
-- Table structure for table "specimen_observation"
609
--
610 8521 aaronmk
611 8928 aaronmk
CREATE TABLE "specimen_observation" (
612
  "id" varbinary(767) NOT NULL,
613
  "specimen" varbinary(767) NOT NULL,
614
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
615
  PRIMARY KEY ("id"),
616
  KEY "fk_specimen_observation_specimen1_idx" ("specimen"),
617
  CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
618
  CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
619
);
620 8632 aaronmk
621 8928 aaronmk
--
622
-- Dumping data for table "specimen_observation"
623
--
624 8521 aaronmk
625 8928 aaronmk
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
626
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
627 8521 aaronmk
628 8928 aaronmk
--
629
-- Table structure for table "stem"
630
--
631 8632 aaronmk
632 8928 aaronmk
CREATE TABLE "stem" (
633
  "id" varbinary(767) NOT NULL,
634
  "individual" varbinary(767) NOT NULL,
635
  PRIMARY KEY ("id"),
636
  KEY "fk_stem_individual1_idx" ("individual"),
637
  CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
638
  CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
639
);
640 8521 aaronmk
641 8928 aaronmk
--
642
-- Dumping data for table "stem"
643
--
644 8533 aaronmk
645 8928 aaronmk
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
646
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
647 8632 aaronmk
648 8928 aaronmk
--
649
-- Table structure for table "stem_observation"
650
--
651 8561 aaronmk
652 8928 aaronmk
CREATE TABLE "stem_observation" (
653
  "id" varbinary(767) NOT NULL,
654
  "individual_observation" varbinary(767) NOT NULL,
655
  "stem" varbinary(767) DEFAULT NULL,
656
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
657
  PRIMARY KEY ("id"),
658
  UNIQUE KEY "stem_observation_unique" ("individual_observation","stem"),
659
  KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation"),
660
  KEY "fk_stem_observation_stem1_idx" ("stem"),
661
  CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
662
  CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
663
  CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE
664
);
665 8567 aaronmk
666 8928 aaronmk
--
667
-- Dumping data for table "stem_observation"
668
--
669 8632 aaronmk
670 8928 aaronmk
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
671
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
672 8567 aaronmk
673 8928 aaronmk
--
674
-- Table structure for table "stratum"
675
--
676 8573 aaronmk
677 8928 aaronmk
CREATE TABLE "stratum" (
678
  "id" varbinary(767) NOT NULL,
679
  "name" varbinary(767) NOT NULL,
680
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
681
  PRIMARY KEY ("id"),
682
  CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
683
);
684 8632 aaronmk
685 8928 aaronmk
--
686
-- Dumping data for table "stratum"
687
--
688 8573 aaronmk
689 8928 aaronmk
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
690
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
691 8581 aaronmk
692 8928 aaronmk
--
693
-- Table structure for table "subplot"
694
--
695 8632 aaronmk
696 8928 aaronmk
CREATE TABLE "subplot" (
697
  "id" varbinary(767) NOT NULL,
698
  "x_m" double DEFAULT NULL,
699
  "y_m" double DEFAULT NULL,
700
  PRIMARY KEY ("id"),
701
  CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE
702
);
703 8581 aaronmk
704 8928 aaronmk
--
705
-- Dumping data for table "subplot"
706
--
707 8593 aaronmk
708 8928 aaronmk
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
709
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
710 8632 aaronmk
711 8928 aaronmk
--
712
-- Table structure for table "taxon_assertion"
713
--
714 8593 aaronmk
715 8928 aaronmk
CREATE TABLE "taxon_assertion" (
716
  "id" varbinary(767) NOT NULL,
717
  "string" varbinary(767) NOT NULL,
718
  "taxon" varbinary(767) DEFAULT NULL,
719
  "cf_aff" varbinary(767) DEFAULT NULL,
720
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
721
  PRIMARY KEY ("id"),
722
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
723
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
724
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
725
  CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
726
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
727
);
728 8594 aaronmk
729 8928 aaronmk
--
730
-- Dumping data for table "taxon_assertion"
731
--
732 8594 aaronmk
733 8928 aaronmk
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
734
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
735
736
--
737
-- Table structure for table "taxon_concept"
738
--
739
740
CREATE TABLE "taxon_concept" (
741
  "id" varbinary(767) NOT NULL,
742
  "according_to" varbinary(767) NOT NULL,
743
  "parent" varbinary(767) NOT NULL,
744
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
745
  PRIMARY KEY ("id"),
746
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
747
  KEY "fk_taxon_taxon1_idx" ("parent"),
748
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
749
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
750
  CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
751
  CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
752
  CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
753
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
754
);
755
756
--
757
-- Dumping data for table "taxon_concept"
758
--
759
760
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
761
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
762
763
--
764
-- Table structure for table "taxon_determination"
765
--
766
767
CREATE TABLE "taxon_determination" (
768
  "id" varbinary(767) NOT NULL,
769
  "taxon_assertion" varbinary(767) NOT NULL,
770
  "identified_by" varbinary(767) DEFAULT NULL,
771
  "fit_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
772
  PRIMARY KEY ("id"),
773
  UNIQUE KEY "taxon_determination_unique" ("taxon_assertion","identified_by"),
774
  KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion"),
775
  KEY "fk_taxon_determination_party1_idx" ("identified_by"),
776
  CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
777
  CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
778
  CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
779
);
780
781
--
782
-- Dumping data for table "taxon_determination"
783
--
784
785
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
786
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
787
788
--
789
-- Table structure for table "taxon_name"
790
--
791
792
CREATE TABLE "taxon_name" (
793
  "id" varbinary(767) NOT NULL,
794
  "unique_name" varbinary(767) NOT NULL,
795
  "formal_name" varbinary(767) DEFAULT NULL,
796
  "taxon_name" varbinary(767) DEFAULT NULL,
797
  "author" varbinary(767) DEFAULT NULL,
798
  "common_name" varbinary(767) DEFAULT NULL,
799
  "rank" varbinary(767) DEFAULT NULL,
800
  PRIMARY KEY ("id"),
801
  KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name"),
802
  CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE,
803
  CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
804
);
805
806
--
807
-- Dumping data for table "taxon_name"
808
--
809
810
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
811
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
812
813
--
814
-- Table structure for table "taxon_observation"
815
--
816
817
CREATE TABLE "taxon_observation" (
818
  "id" varbinary(767) NOT NULL,
819
  "taxon_occurrence" varbinary(767) NOT NULL,
820
  "collector" varbinary(767) DEFAULT NULL,
821
  "collector_number" varbinary(767) DEFAULT NULL,
822
  "voucher" varbinary(767) DEFAULT NULL,
823
  "growth_form" varbinary(767) DEFAULT NULL,
824
  "cultivated" tinyint(1) DEFAULT NULL,
825
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
826
  PRIMARY KEY ("id"),
827
  KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence"),
828
  KEY "fk_taxon_observation_specimen1_idx" ("voucher"),
829
  KEY "fk_taxon_observation_party1_idx" ("collector"),
830
  CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
831
  CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
832
  CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
833
  CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
834
);
835
836
--
837
-- Dumping data for table "taxon_observation"
838
--
839
840
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
841
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
842
843
--
844
-- Table structure for table "taxon_occurrence"
845
--
846
847
CREATE TABLE "taxon_occurrence" (
848
  "id" varbinary(767) NOT NULL,
849
  "current_determination" varbinary(767) DEFAULT NULL,
850
  "original_determination" varbinary(767) DEFAULT NULL,
851
  PRIMARY KEY ("id"),
852
  KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination"),
853
  KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination"),
854
  CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
855
  CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
856
  CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE
857
);
858
859
--
860
-- Dumping data for table "taxon_occurrence"
861
--
862
863
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
864
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
865
866
--
867
-- Table structure for table "taxon_path"
868
--
869
870
CREATE TABLE "taxon_path" (
871
  "id" varbinary(767) NOT NULL,
872
  "family" varbinary(767) DEFAULT NULL,
873
  "genus" varbinary(767) DEFAULT NULL,
874
  "specific_epithet" varbinary(767) DEFAULT NULL,
875
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
876
  PRIMARY KEY ("id"),
877
  CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
878
);
879
880
--
881
-- Dumping data for table "taxon_path"
882
--
883
884
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
885
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
886
887
--
888
-- Table structure for table "taxon_presence"
889
--
890
891
CREATE TABLE "taxon_presence" (
892
  "id" varbinary(767) NOT NULL,
893
  "taxon_concept" varbinary(767) NOT NULL,
894
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
895
  PRIMARY KEY ("id"),
896
  KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept"),
897
  CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
898
  CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
899
);
900
901
--
902
-- Dumping data for table "taxon_presence"
903
--
904
905
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
906
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
907
908
--
909
-- Table structure for table "taxon_string"
910
--
911
912
CREATE TABLE "taxon_string" (
913
  "string" varbinary(767) NOT NULL,
914
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
915
  PRIMARY KEY ("string"),
916
  KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion"),
917
  CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
918
);
919
920
--
921
-- Dumping data for table "taxon_string"
922
--
923
924
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
925
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
926
927
--
928
-- Table structure for table "validatable_place"
929
--
930
931
CREATE TABLE "validatable_place" (
932
  "id" varbinary(767) NOT NULL,
933
  "coordinates" varbinary(767) NOT NULL,
934
  "path" varbinary(767) NOT NULL,
935
  PRIMARY KEY ("id"),
936
  UNIQUE KEY "validatable_place_unique" ("path","coordinates"),
937
  KEY "fk_geovalidation_place_path1_idx" ("path"),
938
  KEY "fk_geovalidation_coordinates1_idx" ("coordinates"),
939
  CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
940
  CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE
941
);
942
943
--
944
-- Dumping data for table "validatable_place"
945
--
946
947
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
948
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
949
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
950
951
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
952
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
953
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
954
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
955
956
-- Dump completed