Project

General

Profile

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