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