Project

General

Profile

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