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