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 9617 aaronmk
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
24
  CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
25 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
44
  CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
45 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
67
  CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
68 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
147
  CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
148 8928 aaronmk
  CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
149 9617 aaronmk
  CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
150 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
250
  CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
251 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
271
  CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
272 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("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 8928 aaronmk
  CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
356 9617 aaronmk
  CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE
357 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
385
  CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
386 8928 aaronmk
  CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
387 9617 aaronmk
  CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
388 8928 aaronmk
);
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 9617 aaronmk
  KEY "fk_source_party1_idx" ("owner"),
555 8928 aaronmk
  KEY "fk_source_party2_idx" ("first_publisher"),
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 9617 aaronmk
  CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
593 8928 aaronmk
  CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
594
  CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
595
  CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
596 9617 aaronmk
  CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
597
  CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE
598 8928 aaronmk
);
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 9617 aaronmk
  CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
618
  CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE
619 8928 aaronmk
);
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 9617 aaronmk
-- Table structure for table "specimenholder_institution"
630
--
631
632
CREATE TABLE "specimenholder_institution" (
633
  "specimen" varbinary(767) NOT NULL,
634
  "institution" varbinary(767) NOT NULL,
635
  "sort_order" int(11) DEFAULT NULL,
636
  PRIMARY KEY ("specimen","institution"),
637
  KEY "fk_specimen_has_organization_organization1_idx" ("institution"),
638
  KEY "fk_specimen_has_organization_specimen1_idx" ("specimen"),
639
  CONSTRAINT "fk_specimen_has_organization_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
640
  CONSTRAINT "fk_specimen_has_organization_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
641
);
642
643
--
644
-- Dumping data for table "specimenholder_institution"
645
--
646
647
/*!40000 ALTER TABLE "specimenholder_institution" DISABLE KEYS */;
648
/*!40000 ALTER TABLE "specimenholder_institution" ENABLE KEYS */;
649
650
--
651 8928 aaronmk
-- Table structure for table "stem"
652
--
653 8632 aaronmk
654 8928 aaronmk
CREATE TABLE "stem" (
655
  "id" varbinary(767) NOT NULL,
656
  "individual" varbinary(767) NOT NULL,
657
  PRIMARY KEY ("id"),
658
  KEY "fk_stem_individual1_idx" ("individual"),
659
  CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
660
  CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
661
);
662 8521 aaronmk
663 8928 aaronmk
--
664
-- Dumping data for table "stem"
665
--
666 8533 aaronmk
667 8928 aaronmk
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
668
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
669 8632 aaronmk
670 8928 aaronmk
--
671
-- Table structure for table "stem_observation"
672
--
673 8561 aaronmk
674 8928 aaronmk
CREATE TABLE "stem_observation" (
675
  "id" varbinary(767) NOT NULL,
676
  "individual_observation" varbinary(767) NOT NULL,
677
  "stem" varbinary(767) DEFAULT NULL,
678
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
679
  PRIMARY KEY ("id"),
680
  UNIQUE KEY "stem_observation_unique" ("individual_observation","stem"),
681
  KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation"),
682
  KEY "fk_stem_observation_stem1_idx" ("stem"),
683
  CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
684 9617 aaronmk
  CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
685
  CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
686 8928 aaronmk
);
687 8567 aaronmk
688 8928 aaronmk
--
689
-- Dumping data for table "stem_observation"
690
--
691 8632 aaronmk
692 8928 aaronmk
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
693
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
694 8567 aaronmk
695 8928 aaronmk
--
696
-- Table structure for table "stratum"
697
--
698 8573 aaronmk
699 8928 aaronmk
CREATE TABLE "stratum" (
700
  "id" varbinary(767) NOT NULL,
701
  "name" varbinary(767) NOT NULL,
702
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
703
  PRIMARY KEY ("id"),
704
  CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
705
);
706 8632 aaronmk
707 8928 aaronmk
--
708
-- Dumping data for table "stratum"
709
--
710 8573 aaronmk
711 8928 aaronmk
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
712
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
713 8581 aaronmk
714 8928 aaronmk
--
715
-- Table structure for table "subplot"
716
--
717 8632 aaronmk
718 8928 aaronmk
CREATE TABLE "subplot" (
719
  "id" varbinary(767) NOT NULL,
720
  "x_m" double DEFAULT NULL,
721
  "y_m" double DEFAULT NULL,
722
  PRIMARY KEY ("id"),
723
  CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE
724
);
725 8581 aaronmk
726 8928 aaronmk
--
727
-- Dumping data for table "subplot"
728
--
729 8593 aaronmk
730 8928 aaronmk
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
731
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
732 8632 aaronmk
733 8928 aaronmk
--
734
-- Table structure for table "taxon_assertion"
735
--
736 8593 aaronmk
737 8928 aaronmk
CREATE TABLE "taxon_assertion" (
738
  "id" varbinary(767) NOT NULL,
739
  "string" varbinary(767) NOT NULL,
740
  "taxon" varbinary(767) DEFAULT NULL,
741
  "cf_aff" varbinary(767) DEFAULT NULL,
742
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
743
  PRIMARY KEY ("id"),
744
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
745
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
746
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
747 9617 aaronmk
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE,
748
  CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
749 8928 aaronmk
);
750 8594 aaronmk
751 8928 aaronmk
--
752
-- Dumping data for table "taxon_assertion"
753
--
754 8594 aaronmk
755 8928 aaronmk
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
756
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
757
758
--
759
-- Table structure for table "taxon_concept"
760
--
761
762
CREATE TABLE "taxon_concept" (
763
  "id" varbinary(767) NOT NULL,
764
  "according_to" varbinary(767) NOT NULL,
765
  "parent" varbinary(767) NOT NULL,
766
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
767
  PRIMARY KEY ("id"),
768
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
769
  KEY "fk_taxon_taxon1_idx" ("parent"),
770
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
771
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
772 9617 aaronmk
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
773 8928 aaronmk
  CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
774
  CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
775 9617 aaronmk
  CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
776 8928 aaronmk
);
777
778
--
779
-- Dumping data for table "taxon_concept"
780
--
781
782
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
783
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
784
785
--
786
-- Table structure for table "taxon_determination"
787
--
788
789
CREATE TABLE "taxon_determination" (
790
  "id" varbinary(767) NOT NULL,
791
  "taxon_assertion" varbinary(767) NOT NULL,
792
  "identified_by" varbinary(767) DEFAULT NULL,
793
  "fit_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
794
  PRIMARY KEY ("id"),
795
  UNIQUE KEY "taxon_determination_unique" ("taxon_assertion","identified_by"),
796
  KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion"),
797
  KEY "fk_taxon_determination_party1_idx" ("identified_by"),
798 9617 aaronmk
  CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
799 8928 aaronmk
  CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
800 9617 aaronmk
  CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
801 8928 aaronmk
);
802
803
--
804
-- Dumping data for table "taxon_determination"
805
--
806
807
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
808
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
809
810
--
811
-- Table structure for table "taxon_name"
812
--
813
814
CREATE TABLE "taxon_name" (
815
  "id" varbinary(767) NOT NULL,
816
  "unique_name" varbinary(767) NOT NULL,
817
  "formal_name" varbinary(767) DEFAULT NULL,
818
  "taxon_name" varbinary(767) DEFAULT NULL,
819
  "author" varbinary(767) DEFAULT NULL,
820
  "common_name" varbinary(767) DEFAULT NULL,
821
  "rank" varbinary(767) DEFAULT NULL,
822
  PRIMARY KEY ("id"),
823
  KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name"),
824 9617 aaronmk
  CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
825
  CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
826 8928 aaronmk
);
827
828
--
829
-- Dumping data for table "taxon_name"
830
--
831
832
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
833
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
834
835
--
836
-- Table structure for table "taxon_observation"
837
--
838
839
CREATE TABLE "taxon_observation" (
840
  "id" varbinary(767) NOT NULL,
841
  "taxon_occurrence" varbinary(767) NOT NULL,
842
  "collector" varbinary(767) DEFAULT NULL,
843
  "collector_number" varbinary(767) DEFAULT NULL,
844
  "voucher" varbinary(767) DEFAULT NULL,
845
  "growth_form" varbinary(767) DEFAULT NULL,
846
  "cultivated" tinyint(1) DEFAULT NULL,
847
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
848
  PRIMARY KEY ("id"),
849
  KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence"),
850
  KEY "fk_taxon_observation_specimen1_idx" ("voucher"),
851
  KEY "fk_taxon_observation_party1_idx" ("collector"),
852
  CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
853 9617 aaronmk
  CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
854 8928 aaronmk
  CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
855 9617 aaronmk
  CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
856 8928 aaronmk
);
857
858
--
859
-- Dumping data for table "taxon_observation"
860
--
861
862
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
863
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
864
865
--
866
-- Table structure for table "taxon_occurrence"
867
--
868
869
CREATE TABLE "taxon_occurrence" (
870
  "id" varbinary(767) NOT NULL,
871
  "current_determination" varbinary(767) DEFAULT NULL,
872
  "original_determination" varbinary(767) DEFAULT NULL,
873
  PRIMARY KEY ("id"),
874
  KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination"),
875
  KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination"),
876
  CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
877 9617 aaronmk
  CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
878
  CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
879 8928 aaronmk
);
880
881
--
882
-- Dumping data for table "taxon_occurrence"
883
--
884
885
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
886
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
887
888
--
889
-- Table structure for table "taxon_path"
890
--
891
892
CREATE TABLE "taxon_path" (
893
  "id" varbinary(767) NOT NULL,
894
  "family" varbinary(767) DEFAULT NULL,
895
  "genus" varbinary(767) DEFAULT NULL,
896
  "specific_epithet" varbinary(767) DEFAULT NULL,
897
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
898
  PRIMARY KEY ("id"),
899
  CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
900
);
901
902
--
903
-- Dumping data for table "taxon_path"
904
--
905
906
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
907
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
908
909
--
910
-- Table structure for table "taxon_presence"
911
--
912
913
CREATE TABLE "taxon_presence" (
914
  "id" varbinary(767) NOT NULL,
915
  "taxon_concept" varbinary(767) NOT NULL,
916
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
917
  PRIMARY KEY ("id"),
918
  KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept"),
919
  CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
920
  CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
921
);
922
923
--
924
-- Dumping data for table "taxon_presence"
925
--
926
927
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
928
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
929
930
--
931
-- Table structure for table "taxon_string"
932
--
933
934
CREATE TABLE "taxon_string" (
935
  "string" varbinary(767) NOT NULL,
936
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
937
  PRIMARY KEY ("string"),
938
  KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion"),
939
  CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
940
);
941
942
--
943
-- Dumping data for table "taxon_string"
944
--
945
946
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
947
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
948
949
--
950
-- Table structure for table "validatable_place"
951
--
952
953
CREATE TABLE "validatable_place" (
954
  "id" varbinary(767) NOT NULL,
955
  "coordinates" varbinary(767) NOT NULL,
956
  "path" varbinary(767) NOT NULL,
957
  PRIMARY KEY ("id"),
958
  UNIQUE KEY "validatable_place_unique" ("path","coordinates"),
959
  KEY "fk_geovalidation_place_path1_idx" ("path"),
960
  KEY "fk_geovalidation_coordinates1_idx" ("coordinates"),
961 9617 aaronmk
  CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
962
  CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE
963 8928 aaronmk
);
964
965
--
966
-- Dumping data for table "validatable_place"
967
--
968
969
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
970
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
971
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
972
973
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
974
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
975
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
976
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
977
978
-- Dump completed