Project

General

Profile

1 8931 aaronmk
SET standard_conforming_strings = off;
2
SET escape_string_warning = off;
3 11525 aaronmk
-- MySQL dump 10.13  Distrib 5.5.34, for debian-linux-gnu (x86_64)
4 8931 aaronmk
--
5 9630 aaronmk
-- Host: localhost    Database: VegCore
6 8931 aaronmk
-- ------------------------------------------------------
7 11525 aaronmk
-- Server version	5.5.34-0ubuntu0.12.04.1
8 10446 aaronmk
9
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12
SET NAMES 'utf8';
13 8931 aaronmk
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14
/*!40103 SET TIME_ZONE='+00:00' */;
15
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17 10446 aaronmk
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18 8931 aaronmk
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20
--
21 10652 aaronmk
-- Current Database: "VegCore"
22
--
23
24
CREATE DATABASE /*!32312 IF NOT EXISTS*/ "VegCore" /*!40100 DEFAULT */;
25
26
USE "VegCore";
27
28
--
29 10659 aaronmk
-- Table structure for table "aggregate_observation"
30
--
31
32
/*!40101 SET @saved_cs_client     = @@character_set_client */;
33
/*!40101 SET character_set_client = utf8 */;
34
CREATE TABLE "aggregate_observation" (
35
  "id" text NOT NULL,
36
  "occurrence_status" text DEFAULT NULL,
37
  PRIMARY KEY ("id"),
38 11130 aaronmk
  /*CONSTRAINT "fk_taxon_presence_taxon_determination10" FOREIGN KEY ("id") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
39 10659 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
40
/*!40101 SET character_set_client = @saved_cs_client */;
41
42
--
43
-- Dumping data for table "aggregate_observation"
44
--
45
46
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
47
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
48
49
--
50 8931 aaronmk
-- Table structure for table "base_class"
51
--
52
53 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
54
/*!40101 SET character_set_client = utf8 */;
55 8931 aaronmk
CREATE TABLE "base_class" (
56 8944 aaronmk
  "id" text NOT NULL,
57
  "referenced_class" text NOT NULL,
58 8931 aaronmk
  PRIMARY KEY ("id"),
59
  /*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true),
60 10437 aaronmk
  /*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
61 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
62 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
63 8931 aaronmk
64
--
65
-- Dumping data for table "base_class"
66
--
67
68
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
69
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
70
71
--
72
-- Table structure for table "collection"
73
--
74
75 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
76
/*!40101 SET character_set_client = utf8 */;
77 8931 aaronmk
CREATE TABLE "collection" (
78 8944 aaronmk
  "id" text NOT NULL,
79
  "institution" text NOT NULL,
80
  "name" text NOT NULL,
81 8931 aaronmk
  PRIMARY KEY ("id"),
82
  /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
83
  /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
84
  /*KEY "fk_collection_source1_idx" ("id")*/CHECK (true),
85 11376 aaronmk
  /*CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
86
  /*CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
87 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"the collection within the institution where a specimen is held" ("Brad Boyle":https://projects.nceas.ucsb.edu/nceas/attachments/download/621/vegbien_identifier_examples.xlsx#terms/collectionCode)'*/;
88 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
89 8931 aaronmk
90
--
91
-- Dumping data for table "collection"
92
--
93
94
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
95
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
96
97
--
98
-- Table structure for table "community"
99
--
100
101 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
102
/*!40101 SET character_set_client = utf8 */;
103 8931 aaronmk
CREATE TABLE "community" (
104 8944 aaronmk
  "id" text NOT NULL,
105
  "name" text NOT NULL,
106 8938 aaronmk
  "info" hstore DEFAULT NULL,
107 8931 aaronmk
  PRIMARY KEY ("id"),
108 10968 aaronmk
  /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
109 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A community type is an abstract grouping of organisms that tend to co-occur on the landscape due to shared ecological requirements or preferences. May be designated by syntaxon or physiognomic types." ([[VegCore#VegX|VegX]])'*/;
110 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
111 8931 aaronmk
112
--
113
-- Dumping data for table "community"
114
--
115
116
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
117
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
118
119
--
120 11199 aaronmk
-- Table structure for table "data_owner"
121
--
122
123
/*!40101 SET @saved_cs_client     = @@character_set_client */;
124
/*!40101 SET character_set_client = utf8 */;
125
CREATE TABLE "data_owner" (
126
  "id" text NOT NULL,
127
  "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc.'*/,
128
  PRIMARY KEY ("id"),
129
  /*CONSTRAINT "fk_party_list_entry_record10" FOREIGN KEY ("id") REFERENCES "party_list_entry" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
130
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
131
/*!40101 SET character_set_client = @saved_cs_client */;
132
133
--
134
-- Dumping data for table "data_owner"
135
--
136
137
/*!40000 ALTER TABLE "data_owner" DISABLE KEYS */;
138
/*!40000 ALTER TABLE "data_owner" ENABLE KEYS */;
139
140
--
141 10975 aaronmk
-- Table structure for table "dataset"
142
--
143
144
/*!40101 SET @saved_cs_client     = @@character_set_client */;
145
/*!40101 SET character_set_client = utf8 */;
146
CREATE TABLE "dataset" (
147
  "id" text NOT NULL,
148 11067 aaronmk
  "name" text NOT NULL,
149 11191 aaronmk
  "contacts" text NOT NULL /*COMMENT 'contact person(s) to ask about attribution questions. there should always be at least one contact person. if unknown, the person loading the data should set this to themselves.'*/,
150 11193 aaronmk
  "parent" text DEFAULT NULL /*COMMENT 'this provides a containment relationship, which differs from the attribution relationship provided by dataset_source. e.g. the GBIF.ARIZ dataset is contained within a specific GBIF *dataset* (the parent), but was obtained from the GBIF *organization* (the dataset_source). ARIZ is then the first_publisher.'*/,
151 11187 aaronmk
  "dataset_source" text DEFAULT NULL /*COMMENT 'where the data in the dataset came from (as opposed to where the metadata *about* the dataset came from, which is in source, inherited from traceable); = Brad.vegpath.org?attribution.proximate_data_provider'*/,
152
  "first_publisher" text DEFAULT NULL /*COMMENT '= Brad.vegpath.org?attribution.data_publisher, Brad.vegpath.org?data_provenance.primarydataprovider'*/,
153 11194 aaronmk
  "data_owners" text DEFAULT NULL /*COMMENT 'parties who must be given attribution, such as copyrightholders. this includes all aggregators through which the data has passed. = Brad.vegpath.org?attribution.data_indexer'*/,
154 11199 aaronmk
  "access_rights" text DEFAULT NULL /*COMMENT 'e.g. public, private, by request, metadata only'*/,
155
  "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc. this is the combination of all the use_conditions of the data_owners.'*/,
156 10975 aaronmk
  PRIMARY KEY ("id"),
157 11067 aaronmk
  /*CONSTRAINT "dataset_unique" */UNIQUE ("parent","name"),
158 10975 aaronmk
  /*KEY "fk_source_party_list1_idx" ("data_owners")*/CHECK (true),
159
  /*KEY "fk_source_party1_idx" ("contacts")*/CHECK (true),
160 11059 aaronmk
  /*KEY "fk_dataset_dataset1_idx" ("parent")*/CHECK (true),
161 11188 aaronmk
  /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true),
162 11199 aaronmk
  /*KEY "dataset_dataset_source_fkey1_idx" ("dataset_source")*/CHECK (true),
163
  /*CONSTRAINT "dataset_dataset_source_fkey1" FOREIGN KEY ("dataset_source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
164 11192 aaronmk
  /*CONSTRAINT "fk_dataset_dataset1" FOREIGN KEY ("parent") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
165 11193 aaronmk
  /*CONSTRAINT "fk_dataset_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
166 11221 aaronmk
  /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("contacts") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
167
  /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
168
  /*CONSTRAINT "fk_source_party_list1" FOREIGN KEY ("data_owners") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
169 11054 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a collection of records from the same place, with the same attribution requirements'*/;
170 10975 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
171
172
--
173
-- Dumping data for table "dataset"
174
--
175
176
/*!40000 ALTER TABLE "dataset" DISABLE KEYS */;
177
/*!40000 ALTER TABLE "dataset" ENABLE KEYS */;
178
179
--
180 8931 aaronmk
-- Table structure for table "derived_class"
181
--
182
183 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
184
/*!40101 SET character_set_client = utf8 */;
185 8931 aaronmk
CREATE TABLE "derived_class" (
186 8944 aaronmk
  "id" text NOT NULL,
187 8931 aaronmk
  PRIMARY KEY ("id"),
188
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
189 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
190 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
191 8931 aaronmk
192
--
193
-- Dumping data for table "derived_class"
194
--
195
196
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
197
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
198
199
--
200
-- Table structure for table "event"
201
--
202
203 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
204
/*!40101 SET character_set_client = utf8 */;
205 8931 aaronmk
CREATE TABLE "event" (
206 8944 aaronmk
  "id" text NOT NULL,
207 10498 aaronmk
  "parent" text DEFAULT NULL,
208 11209 aaronmk
  "subject" text DEFAULT NULL /*COMMENT 'what was observed'*/,
209 8944 aaronmk
  "name" text DEFAULT NULL,
210
  "date_range" text DEFAULT NULL,
211 11120 aaronmk
  "participants" text DEFAULT NULL,
212 8931 aaronmk
  PRIMARY KEY ("id"),
213 11210 aaronmk
  /*CONSTRAINT "event_unique_within_parent_by_name" */UNIQUE ("parent","name"),
214
  /*CONSTRAINT "event_unique_within_subject_by_date" */UNIQUE ("subject","date_range","participants"),
215
  /*CONSTRAINT "event_unique_within_parent_by_subject" */UNIQUE ("parent","subject"),
216 8931 aaronmk
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
217 10454 aaronmk
  /*KEY "fk_event_party_list1_idx" ("participants")*/CHECK (true),
218 11209 aaronmk
  /*KEY "fk_event_place1_idx" ("subject")*/CHECK (true),
219 11210 aaronmk
  /*KEY "event_unique_within_subject_by_name" ("subject","name")*/CHECK (true),
220 11376 aaronmk
  /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
221 11195 aaronmk
  /*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
222 11209 aaronmk
  /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("subject") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
223 10975 aaronmk
  /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
224 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"an action that occurs at a place and during a period of text/*time*/" ("DwC":http://rs.tdwg.org/dwc/terms/#Event)'*/;
225 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
226 8931 aaronmk
227
--
228
-- Dumping data for table "event"
229
--
230
231
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
232
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
233
234
--
235
-- Table structure for table "geological_context"
236
--
237
238 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
239
/*!40101 SET character_set_client = utf8 */;
240 8931 aaronmk
CREATE TABLE "geological_context" (
241 8944 aaronmk
  "id" text NOT NULL,
242
  "name" text NOT NULL,
243 8938 aaronmk
  "info" hstore DEFAULT NULL,
244 8931 aaronmk
  PRIMARY KEY ("id"),
245 10968 aaronmk
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
246 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"information pertaining to a location within a geological context, such as stratigraphy" ("DwC":http://rs.tdwg.org/dwc/terms/#GeologicalContext)'*/;
247 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
248 8931 aaronmk
249
--
250
-- Dumping data for table "geological_context"
251
--
252
253
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
254
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
255
256
--
257 10466 aaronmk
-- Table structure for table "geopath"
258
--
259
260
/*!40101 SET @saved_cs_client     = @@character_set_client */;
261
/*!40101 SET character_set_client = utf8 */;
262
CREATE TABLE "geopath" (
263
  "id" text NOT NULL,
264 11405 aaronmk
  "ranks" hstore DEFAULT NULL,
265 10466 aaronmk
  "continent" text DEFAULT NULL,
266 10495 aaronmk
  "country" text DEFAULT NULL,
267 10466 aaronmk
  "state_province" text DEFAULT NULL,
268
  "county" text DEFAULT NULL,
269
  "municipality" text DEFAULT NULL,
270 11378 aaronmk
  "locality" text DEFAULT NULL,
271 10466 aaronmk
  PRIMARY KEY ("id")
272
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region'*/;
273
/*!40101 SET character_set_client = @saved_cs_client */;
274
275
--
276
-- Dumping data for table "geopath"
277
--
278
279
/*!40000 ALTER TABLE "geopath" DISABLE KEYS */;
280
/*!40000 ALTER TABLE "geopath" ENABLE KEYS */;
281
282
--
283 10493 aaronmk
-- Table structure for table "geoplace"
284
--
285
286
/*!40101 SET @saved_cs_client     = @@character_set_client */;
287
/*!40101 SET character_set_client = utf8 */;
288
CREATE TABLE "geoplace" (
289
  "id" text NOT NULL,
290 10495 aaronmk
  "latitude_deg" text NOT NULL,
291
  "longitude_deg" text NOT NULL,
292 10636 aaronmk
  "boundary_WKT" text NOT NULL DEFAULT 'point',
293 11383 aaronmk
  "georeferenced_by" text DEFAULT NULL,
294
  "georeferencing_info" text DEFAULT NULL,
295 10493 aaronmk
  PRIMARY KEY ("id"),
296 11383 aaronmk
  /*KEY "geoplace_id_fkey1_idx" ("georeferenced_by")*/CHECK (true),
297
  /*CONSTRAINT "fk_geoplace_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
298
  /*CONSTRAINT "geoplace_id_fkey1" FOREIGN KEY ("georeferenced_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
299 11376 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point. inherited fields: name: the official, scrubbed name'*/;
300 10493 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
301
302
--
303
-- Dumping data for table "geoplace"
304
--
305
306
/*!40000 ALTER TABLE "geoplace" DISABLE KEYS */;
307
/*!40000 ALTER TABLE "geoplace" ENABLE KEYS */;
308
309
--
310 10554 aaronmk
-- Table structure for table "geovalidatable_place"
311
--
312
313
/*!40101 SET @saved_cs_client     = @@character_set_client */;
314
/*!40101 SET character_set_client = utf8 */;
315
CREATE TABLE "geovalidatable_place" (
316
  "id" text NOT NULL,
317 11382 aaronmk
  "parent_boundary_WKT" text NOT NULL /*COMMENT 'the parent geoplace'*/,
318 10554 aaronmk
  PRIMARY KEY ("id"),
319 11376 aaronmk
  /*CONSTRAINT "fk_nested_geoplace_geoplace1" FOREIGN KEY ("id") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
320 10554 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores only scrubbed geoplaces (GADM places, and distinct point coordinates that GNRS says should be located within them)'*/;
321
/*!40101 SET character_set_client = @saved_cs_client */;
322
323
--
324
-- Dumping data for table "geovalidatable_place"
325
--
326
327
/*!40000 ALTER TABLE "geovalidatable_place" DISABLE KEYS */;
328
/*!40000 ALTER TABLE "geovalidatable_place" ENABLE KEYS */;
329
330
--
331 8931 aaronmk
-- Table structure for table "geovalidation"
332
--
333
334 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
335
/*!40101 SET character_set_client = utf8 */;
336 8931 aaronmk
CREATE TABLE "geovalidation" (
337 8944 aaronmk
  "id" text NOT NULL,
338 10474 aaronmk
  "input_geoplace" text NOT NULL,
339 8931 aaronmk
  "geovalid" integer NOT NULL,
340
  "lat_long_domain_valid" integer NOT NULL,
341 11405 aaronmk
  "corrected_geoplace" text DEFAULT NULL,
342 10451 aaronmk
  "lat_long_in_place_ranks" hstore DEFAULT NULL,
343 8931 aaronmk
  PRIMARY KEY ("id"),
344 10474 aaronmk
  /*KEY "fk_geovalidation_geoplace1_idx" ("input_geoplace")*/CHECK (true),
345 10495 aaronmk
  /*KEY "fk_geovalidation_geoplace2_idx" ("corrected_geoplace")*/CHECK (true),
346 10554 aaronmk
  /*CONSTRAINT "fk_geovalidation_geoplace1" FOREIGN KEY ("input_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
347 11383 aaronmk
  /*CONSTRAINT "fk_geovalidation_geoplace2" FOREIGN KEY ("corrected_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
348 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]'*/;
349 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
350 8931 aaronmk
351
--
352
-- Dumping data for table "geovalidation"
353
--
354
355
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
356
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
357
358
--
359
-- Table structure for table "individual"
360
--
361
362 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
363
/*!40101 SET character_set_client = utf8 */;
364 8931 aaronmk
CREATE TABLE "individual" (
365 8944 aaronmk
  "id" text NOT NULL,
366 10661 aaronmk
  "identifying_place" text DEFAULT NULL /*COMMENT 'subplace within plot. not specified for specimens since their coordinates are usually not precise enough to identify an individual.'*/,
367 8944 aaronmk
  "tag" text DEFAULT NULL,
368 10450 aaronmk
  "tag_history" hstore DEFAULT NULL,
369 8931 aaronmk
  PRIMARY KEY ("id"),
370 10660 aaronmk
  /*KEY "fk_individual_subplace1_idx" ("identifying_place")*/CHECK (true),
371 10807 aaronmk
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
372
  /*CONSTRAINT "fk_individual_subplace1" FOREIGN KEY ("identifying_place") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
373 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism'*/;
374 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
375 8931 aaronmk
376
--
377
-- Dumping data for table "individual"
378
--
379
380
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
381
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
382
383
--
384 10658 aaronmk
-- Table structure for table "individual_count"
385
--
386
387
/*!40101 SET @saved_cs_client     = @@character_set_client */;
388
/*!40101 SET character_set_client = utf8 */;
389
CREATE TABLE "individual_count" (
390
  "id" text NOT NULL,
391 11127 aaronmk
  "parent" text NOT NULL /*COMMENT 'the taxon_presence for the taxon as a whole (not subdivided by size_class, etc.)'*/,
392 10658 aaronmk
  "size_class" text DEFAULT NULL,
393
  "aggregating_traits" hstore DEFAULT NULL,
394
  "count" integer DEFAULT NULL,
395
  PRIMARY KEY ("id"),
396 11127 aaronmk
  /*KEY "fk_aggregate_observation_taxon_presence1_idx" ("parent")*/CHECK (true),
397 11048 aaronmk
  /*KEY "fk_aggregate_observation_size_class1_idx" ("size_class")*/CHECK (true),
398 11179 aaronmk
  /*CONSTRAINT "fk_aggregate_observation_size_class1" FOREIGN KEY ("size_class") REFERENCES "size_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
399 11127 aaronmk
  /*CONSTRAINT "fk_aggregate_observation_taxon_presence1" FOREIGN KEY ("parent") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
400 10975 aaronmk
  /*CONSTRAINT "fk_individual_count_taxon_presence1" FOREIGN KEY ("id") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
401 11048 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stemCount'*/;
402 10658 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
403
404
--
405
-- Dumping data for table "individual_count"
406
--
407
408
/*!40000 ALTER TABLE "individual_count" DISABLE KEYS */;
409
/*!40000 ALTER TABLE "individual_count" ENABLE KEYS */;
410
411
--
412 8931 aaronmk
-- Table structure for table "individual_observation"
413
--
414
415 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
416
/*!40101 SET character_set_client = utf8 */;
417 8931 aaronmk
CREATE TABLE "individual_observation" (
418 8944 aaronmk
  "id" text NOT NULL,
419 11211 aaronmk
  "subject" text DEFAULT NULL /*COMMENT 'optional because an individual_observation cannot have an associated individual unless the individual is traceable to a specific plant'*/,
420 11135 aaronmk
  "specimenholder_institutions" text DEFAULT NULL /*COMMENT 'institutions which store specimens from this plant. when provided, the taxon_occurrence should have an autogenerated current_observation that merges together all the individual_observations for these institutions'' specimens.'*/,
421 8931 aaronmk
  PRIMARY KEY ("id"),
422 11211 aaronmk
  /*KEY "fk_individual_observation_individual1_idx" ("subject")*/CHECK (true),
423 11113 aaronmk
  /*KEY "individual_observation_id_fkey1_idx" ("specimenholder_institutions")*/CHECK (true),
424 11211 aaronmk
  /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("subject") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
425 11376 aaronmk
  /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
426
  /*CONSTRAINT "individual_observation_id_fkey1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
427 11121 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]; inherited fields: place: contains the place the individual was observed at'*/;
428 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
429 8931 aaronmk
430
--
431
-- Dumping data for table "individual_observation"
432
--
433
434
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
435
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
436
437
--
438
-- Table structure for table "method"
439
--
440
441 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
442
/*!40101 SET character_set_client = utf8 */;
443 8931 aaronmk
CREATE TABLE "method" (
444 8944 aaronmk
  "id" text NOT NULL,
445 11052 aaronmk
  "name" text DEFAULT NULL,
446 10633 aaronmk
  "parent" text DEFAULT NULL,
447 8938 aaronmk
  "info" hstore DEFAULT NULL,
448 8931 aaronmk
  PRIMARY KEY ("id"),
449
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
450 10975 aaronmk
  /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
451
  /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
452 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A specific method definition followed in the creation of the dataset. Each method links to a protocol and literature citation reference. A protocol may have many method or steps." ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/methods/method)'*/;
453 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
454 8931 aaronmk
455
--
456
-- Dumping data for table "method"
457
--
458
459
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
460
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
461
462
--
463
-- Table structure for table "organization"
464
--
465
466 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
467
/*!40101 SET character_set_client = utf8 */;
468 8931 aaronmk
CREATE TABLE "organization" (
469 8944 aaronmk
  "id" text NOT NULL,
470 11067 aaronmk
  "name" text NOT NULL,
471 11066 aaronmk
  "parent" text DEFAULT NULL,
472 8931 aaronmk
  PRIMARY KEY ("id"),
473 11067 aaronmk
  /*CONSTRAINT "organization_unique" */UNIQUE ("parent","name"),
474 11066 aaronmk
  /*KEY "fk_organization_organization1_idx" ("parent")*/CHECK (true),
475
  /*CONSTRAINT "fk_organization_organization1" FOREIGN KEY ("parent") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
476 8931 aaronmk
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
477 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
478 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
479 8931 aaronmk
480
--
481
-- Dumping data for table "organization"
482
--
483
484
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
485
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
486
487
--
488
-- Table structure for table "party"
489
--
490
491 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
492
/*!40101 SET character_set_client = utf8 */;
493 8931 aaronmk
CREATE TABLE "party" (
494 8944 aaronmk
  "id" text NOT NULL,
495 8931 aaronmk
  PRIMARY KEY ("id"),
496 11062 aaronmk
  /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
497
  /*CONSTRAINT "fk_party_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
498 10449 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
499 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
500 8931 aaronmk
501
--
502
-- Dumping data for table "party"
503
--
504
505
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
506
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
507
508
--
509 10453 aaronmk
-- Table structure for table "party_list"
510
--
511
512
/*!40101 SET @saved_cs_client     = @@character_set_client */;
513
/*!40101 SET character_set_client = utf8 */;
514
CREATE TABLE "party_list" (
515
  "id" text NOT NULL,
516
  "count" integer NOT NULL,
517 11200 aaronmk
  "array" text[] DEFAULT NULL /*COMMENT 'an array combining all the list entries. if specified, a trigger will autogenerate party_list_entries from this field. if not specified, will be autopopulated whenever a party_list_entry is added.'*/,
518 10453 aaronmk
  PRIMARY KEY ("id"),
519 11179 aaronmk
  /*CONSTRAINT "fk_collection_source100" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
520
  /*CONSTRAINT "party_list_id_fkey1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
521 10453 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
522
/*!40101 SET character_set_client = @saved_cs_client */;
523
524
--
525
-- Dumping data for table "party_list"
526
--
527
528
/*!40000 ALTER TABLE "party_list" DISABLE KEYS */;
529
/*!40000 ALTER TABLE "party_list" ENABLE KEYS */;
530
531
--
532
-- Table structure for table "party_list_entry"
533
--
534
535
/*!40101 SET @saved_cs_client     = @@character_set_client */;
536
/*!40101 SET character_set_client = utf8 */;
537
CREATE TABLE "party_list_entry" (
538
  "id" text NOT NULL,
539 10967 aaronmk
  "list" text NOT NULL,
540
  "party" text NOT NULL,
541 10966 aaronmk
  "role" text DEFAULT NULL,
542 10453 aaronmk
  "sort_order" integer DEFAULT NULL,
543 10967 aaronmk
  PRIMARY KEY ("id"),
544
  /*KEY "fk_party_list_has_party_party1_idx" ("party")*/CHECK (true),
545
  /*KEY "fk_party_list_entry_party_list1_idx" ("list")*/CHECK (true),
546
  /*CONSTRAINT "fk_party_list_entry_party_list1" FOREIGN KEY ("list") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
547 11376 aaronmk
  /*CONSTRAINT "fk_party_list_entry_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
548
  /*CONSTRAINT "fk_party_list_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
549 10453 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
550
/*!40101 SET character_set_client = @saved_cs_client */;
551
552
--
553
-- Dumping data for table "party_list_entry"
554
--
555
556
/*!40000 ALTER TABLE "party_list_entry" DISABLE KEYS */;
557
/*!40000 ALTER TABLE "party_list_entry" ENABLE KEYS */;
558
559
--
560 11066 aaronmk
-- Table structure for table "person"
561
--
562
563
/*!40101 SET @saved_cs_client     = @@character_set_client */;
564
/*!40101 SET character_set_client = utf8 */;
565
CREATE TABLE "person" (
566
  "id" text NOT NULL,
567 11067 aaronmk
  "name" text NOT NULL,
568 11385 aaronmk
  "organizations" text DEFAULT NULL,
569 11066 aaronmk
  PRIMARY KEY ("id"),
570 11385 aaronmk
  /*CONSTRAINT "person_unique" */UNIQUE ("organizations","name"),
571
  /*KEY "person_organization_fkey1_idx" ("organizations")*/CHECK (true),
572 11404 aaronmk
  /*CONSTRAINT "fk_organization_party10" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
573
  /*CONSTRAINT "person_organization_fkey1" FOREIGN KEY ("organizations") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
574 11066 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
575
/*!40101 SET character_set_client = @saved_cs_client */;
576
577
--
578
-- Dumping data for table "person"
579
--
580
581
/*!40000 ALTER TABLE "person" DISABLE KEYS */;
582
/*!40000 ALTER TABLE "person" ENABLE KEYS */;
583
584
--
585 10495 aaronmk
-- Table structure for table "place"
586
--
587
588
/*!40101 SET @saved_cs_client     = @@character_set_client */;
589
/*!40101 SET character_set_client = utf8 */;
590
CREATE TABLE "place" (
591
  "id" text NOT NULL,
592 11380 aaronmk
  "rank" text NOT NULL /*COMMENT 'every place should have some kind of rank indicating what type of place it is, including lower ranks (e.g. plot, individual)'*/,
593 11381 aaronmk
  "name" text NOT NULL /*COMMENT 'for geoplace, generated from the coordinates'*/,
594 10495 aaronmk
  "parent" text DEFAULT NULL,
595
  "geopath" text DEFAULT NULL,
596
  "verbatim" hstore DEFAULT NULL /*COMMENT 'for verbatim coordinates, etc.'*/,
597
  PRIMARY KEY ("id"),
598 11379 aaronmk
  /*CONSTRAINT "place__unique" */UNIQUE ("parent","rank","name"),
599 10495 aaronmk
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
600
  /*KEY "fk_place_geopath1_idx" ("geopath")*/CHECK (true),
601
  /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
602 10975 aaronmk
  /*CONSTRAINT "fk_place_geopath1" FOREIGN KEY ("geopath") REFERENCES "geopath" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
603
  /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
604 10495 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point'*/;
605
/*!40101 SET character_set_client = @saved_cs_client */;
606
607
--
608
-- Dumping data for table "place"
609
--
610
611
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
612
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
613
614
--
615 11213 aaronmk
-- Table structure for table "place_visit"
616 8931 aaronmk
--
617
618 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
619
/*!40101 SET character_set_client = utf8 */;
620 11213 aaronmk
CREATE TABLE "place_visit" (
621 8944 aaronmk
  "id" text NOT NULL,
622 11216 aaronmk
  "parent" text DEFAULT NULL /*COMMENT 'the concurrent observation of the parent place'*/,
623 11211 aaronmk
  "subject" text NOT NULL,
624 11110 aaronmk
  "project" text DEFAULT NULL,
625 11405 aaronmk
  "community" text DEFAULT NULL,
626
  "geological_context" text DEFAULT NULL,
627
  "observations" hstore DEFAULT NULL,
628 8931 aaronmk
  "elevation_m" double precision DEFAULT NULL,
629
  "slope_incline_deg" double precision DEFAULT NULL,
630
  "slope_direction_deg_N" double precision DEFAULT NULL,
631
  PRIMARY KEY ("id"),
632 11211 aaronmk
  /*KEY "fk_place_observation_place1_idx" ("subject")*/CHECK (true),
633 8931 aaronmk
  /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true),
634
  /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true),
635 11110 aaronmk
  /*KEY "place_observation_id_fkey1_idx" ("project")*/CHECK (true),
636 11216 aaronmk
  /*KEY "place_visit_id_fkey1_idx" ("parent")*/CHECK (true),
637 11110 aaronmk
  /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
638
  /*CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
639 10975 aaronmk
  /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
640 11525 aaronmk
  /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("subject") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
641
  /*CONSTRAINT "place_observation_id_fkey1" FOREIGN KEY ("project") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
642
  /*CONSTRAINT "place_visit_id_fkey1" FOREIGN KEY ("parent") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
643 11214 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]. = VegX.vegpath.org?plotObservation, VegBank.vegpath.org?observation (which was confusingly named) + some of VegBank.vegpath.org?plot (which is actually 1:1 with observation)'*/;
644 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
645 8931 aaronmk
646
--
647 11213 aaronmk
-- Dumping data for table "place_visit"
648 8931 aaronmk
--
649
650 11213 aaronmk
/*!40000 ALTER TABLE "place_visit" DISABLE KEYS */;
651
/*!40000 ALTER TABLE "place_visit" ENABLE KEYS */;
652 8931 aaronmk
653
--
654
-- Table structure for table "plot"
655
--
656
657 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
658
/*!40101 SET character_set_client = utf8 */;
659 8931 aaronmk
CREATE TABLE "plot" (
660 8944 aaronmk
  "id" text NOT NULL,
661 8931 aaronmk
  "area_m2" double precision DEFAULT NULL,
662 10463 aaronmk
  "shape" text DEFAULT NULL,
663 10499 aaronmk
  "length_m" text DEFAULT NULL,
664
  "width_m" text DEFAULT NULL,
665
  "azimuth_deg_N" text DEFAULT NULL,
666 10636 aaronmk
  "boundary_WKT" text DEFAULT NULL,
667 10465 aaronmk
  "dimensions" hstore DEFAULT NULL,
668 8931 aaronmk
  PRIMARY KEY ("id"),
669 10495 aaronmk
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
670 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
671 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
672 8931 aaronmk
673
--
674
-- Dumping data for table "plot"
675
--
676
677
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
678
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
679
680
--
681
-- Table structure for table "project"
682
--
683
684 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
685
/*!40101 SET character_set_client = utf8 */;
686 8931 aaronmk
CREATE TABLE "project" (
687 8944 aaronmk
  "id" text NOT NULL,
688 11221 aaronmk
  "name" text NOT NULL,
689
  "dataset" text DEFAULT NULL,
690 8938 aaronmk
  "info" hstore DEFAULT NULL,
691 8931 aaronmk
  PRIMARY KEY ("id"),
692 11221 aaronmk
  /*CONSTRAINT "project__unique" */UNIQUE ("dataset","name"),
693
  /*KEY "project_id_fkey1_idx" ("dataset")*/CHECK (true),
694 11376 aaronmk
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
695
  /*CONSTRAINT "project_id_fkey1" FOREIGN KEY ("dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
696 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A "project established to collect vegetation plot data. Each plot originates as part of a project." ("VegBank":http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=project&entity=dba_tabledescription&where=where_tablename)'*/;
697 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
698 8931 aaronmk
699
--
700
-- Dumping data for table "project"
701
--
702
703
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
704
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
705
706
--
707
-- Table structure for table "record"
708
--
709
710 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
711
/*!40101 SET character_set_client = utf8 */;
712 8931 aaronmk
CREATE TABLE "record" (
713 8944 aaronmk
  "id" text NOT NULL,
714 11203 aaronmk
  "scoping_dataset" text NOT NULL /*COMMENT 'the dataset that scopes the id_within_dataset'*/,
715 11197 aaronmk
  "id_within_dataset" text NOT NULL,
716 11203 aaronmk
  "attribution_dataset" text NOT NULL /*COMMENT 'the dataset that provides attribution information. defaults to the scoping_dataset.'*/,
717 8931 aaronmk
  PRIMARY KEY ("id"),
718 11203 aaronmk
  /*CONSTRAINT "record_unique" */UNIQUE ("scoping_dataset","id_within_dataset"),
719
  /*KEY "fk_record_source1_idx" ("scoping_dataset")*/CHECK (true),
720
  /*KEY "record_id_fkey2_idx" ("attribution_dataset")*/CHECK (true),
721 11212 aaronmk
  /*CONSTRAINT "fk_record_source10" FOREIGN KEY ("scoping_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
722 11204 aaronmk
  /*CONSTRAINT "fk_record_source2" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
723
  /*CONSTRAINT "record_id_fkey2" FOREIGN KEY ("attribution_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
724 11054 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a collection of data relating to the same entity. this doesn''t have to be a row in a table, it can also be a paragraph of text relating to the same thing (e.g. a method description in a PDF). note that this is the record in the *source* data.'*/;
725 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
726 8931 aaronmk
727
--
728
-- Dumping data for table "record"
729
--
730
731
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
732
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
733
734
--
735
-- Table structure for table "referenced_class"
736
--
737
738 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
739
/*!40101 SET character_set_client = utf8 */;
740 8931 aaronmk
CREATE TABLE "referenced_class" (
741 8944 aaronmk
  "id" text NOT NULL,
742 8931 aaronmk
  PRIMARY KEY ("id"),
743 10968 aaronmk
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
744 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
745 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
746 8931 aaronmk
747
--
748
-- Dumping data for table "referenced_class"
749
--
750
751
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
752
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
753
754
--
755 10487 aaronmk
-- Table structure for table "reobservable"
756
--
757
758
/*!40101 SET @saved_cs_client     = @@character_set_client */;
759
/*!40101 SET character_set_client = utf8 */;
760
CREATE TABLE "reobservable" (
761
  "id" text NOT NULL,
762 11025 aaronmk
  "orig_observation" text DEFAULT NULL,
763 10487 aaronmk
  PRIMARY KEY ("id"),
764 11025 aaronmk
  /*KEY "fk_reobservable_taxon_determination1_idx" ("orig_observation")*/CHECK (true),
765
  /*CONSTRAINT "fk_reobservable_taxon_determination1" FOREIGN KEY ("orig_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
766 10952 aaronmk
  /*CONSTRAINT "fk_reobservable_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
767 10487 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made'*/;
768
/*!40101 SET character_set_client = @saved_cs_client */;
769
770
--
771
-- Dumping data for table "reobservable"
772
--
773
774
/*!40000 ALTER TABLE "reobservable" DISABLE KEYS */;
775
/*!40000 ALTER TABLE "reobservable" ENABLE KEYS */;
776
777
--
778 10630 aaronmk
-- Table structure for table "size_class"
779
--
780
781
/*!40101 SET @saved_cs_client     = @@character_set_client */;
782
/*!40101 SET character_set_client = utf8 */;
783
CREATE TABLE "size_class" (
784
  "id" text NOT NULL,
785
  "diameter_min_m" double precision NOT NULL,
786
  "diameter_max_m" double precision NOT NULL,
787
  PRIMARY KEY ("id"),
788 11212 aaronmk
  /*CONSTRAINT "fk_layer_stratum10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
789 10630 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
790
/*!40101 SET character_set_client = @saved_cs_client */;
791
792
--
793
-- Dumping data for table "size_class"
794
--
795
796
/*!40000 ALTER TABLE "size_class" DISABLE KEYS */;
797
/*!40000 ALTER TABLE "size_class" ENABLE KEYS */;
798
799
--
800 8931 aaronmk
-- Table structure for table "soil_observation"
801
--
802
803 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
804
/*!40101 SET character_set_client = utf8 */;
805 8931 aaronmk
CREATE TABLE "soil_observation" (
806 8944 aaronmk
  "id" text NOT NULL,
807 11213 aaronmk
  "place_visit" text NOT NULL,
808 10639 aaronmk
  "measurement_spot" text DEFAULT NULL,
809 8938 aaronmk
  "observations" hstore DEFAULT NULL,
810 8931 aaronmk
  PRIMARY KEY ("id"),
811 11213 aaronmk
  /*KEY "fk_soil_observation_place_observation1_idx" ("place_visit")*/CHECK (true),
812 10639 aaronmk
  /*KEY "fk_soil_observation_subplace1_idx" ("measurement_spot")*/CHECK (true),
813 11213 aaronmk
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
814
  /*CONSTRAINT "fk_soil_observation_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
815
  /*CONSTRAINT "fk_soil_observation_subplace1" FOREIGN KEY ("measurement_spot") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
816 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil'*/;
817 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
818 8931 aaronmk
819
--
820
-- Dumping data for table "soil_observation"
821
--
822
823
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
824
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
825
826
--
827
-- Table structure for table "source"
828
--
829
830 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
831
/*!40101 SET character_set_client = utf8 */;
832 8931 aaronmk
CREATE TABLE "source" (
833 8944 aaronmk
  "id" text NOT NULL,
834 11146 aaronmk
  "url" text NOT NULL /*COMMENT 'points to the source data and uniquely identifies the source'*/,
835 11143 aaronmk
  "name" text DEFAULT NULL /*COMMENT 'source names will be scrubbed *upon insert* so that the row always contains the most accurate data. this scrubbing may use the assistance of a thesaurus table.'*/,
836 8938 aaronmk
  "info" hstore DEFAULT NULL,
837 11146 aaronmk
  PRIMARY KEY ("id"),
838
  /*CONSTRAINT "source__unique" */UNIQUE ("url")
839 11048 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='where something came from; a "reference [...] cited within the database" ("VegBank":http://reference.VegBank.vegpath.org); = VegBank.vegpath.org?reference'*/;
840 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
841 8931 aaronmk
842
--
843
-- Dumping data for table "source"
844
--
845
846
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
847
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
848
849
--
850
-- Table structure for table "specimen"
851
--
852
853 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
854
/*!40101 SET character_set_client = utf8 */;
855 8931 aaronmk
CREATE TABLE "specimen" (
856 8944 aaronmk
  "id" text NOT NULL,
857 11112 aaronmk
  "individual_observation" text DEFAULT NULL /*COMMENT 'the plant the specimen was collected from and any observations about it'*/,
858 11115 aaronmk
  "id_within_individual" text DEFAULT NULL,
859 8944 aaronmk
  "orig_collection" text DEFAULT NULL,
860
  "barcode" text DEFAULT NULL,
861
  "accession_number" text DEFAULT NULL,
862 10925 aaronmk
  "defining_data" hstore DEFAULT NULL /*COMMENT 'of the observations made about the specimen in individual_observation.traits, this stores the subset that can be used to make a taxonomic redetermination. for a digital-only specimen, this would be the information that comprises the specimen (e.g. a photo, a sketch, or a description that is detailed enough to be able to make a redetermination). note that a taxon_presence without a physical voucher can still qualify as reobservable if a detailed description of it is provided here.'*/,
863 8931 aaronmk
  PRIMARY KEY ("id"),
864 11117 aaronmk
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual_observation","id_within_individual"),
865 8931 aaronmk
  /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"),
866
  /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"),
867 11115 aaronmk
  /*CONSTRAINT "specimen_unique_in_individual_observation" */UNIQUE ("individual_observation","id_within_individual"),
868 8931 aaronmk
  /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true),
869 10807 aaronmk
  /*KEY "fk_specimen_individual_observation1_idx" ("individual_observation")*/CHECK (true),
870 11116 aaronmk
  /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
871 11115 aaronmk
  /*CONSTRAINT "fk_specimen_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
872 11111 aaronmk
  /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
873 10928 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='something collected from a plant. this can be a physical "part of a plant" ("Wikipedia":http://en.wikipedia.org/wiki/Specimen), or a picture or description of the plant. when there are multiple specimen replicates (copies) of a specimen, each gets its own specimen_observation pointing to the same specimen.'*/;
874 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
875 8931 aaronmk
876
--
877
-- Dumping data for table "specimen"
878
--
879
880
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
881
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
882
883
--
884
-- Table structure for table "specimen_observation"
885
--
886
887 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
888
/*!40101 SET character_set_client = utf8 */;
889 8931 aaronmk
CREATE TABLE "specimen_observation" (
890 8944 aaronmk
  "id" text NOT NULL,
891 11211 aaronmk
  "subject" text NOT NULL,
892 11116 aaronmk
  "current_collection" text DEFAULT NULL,
893
  "owner_collection" text DEFAULT NULL,
894 11405 aaronmk
  "description" text DEFAULT NULL,
895 8931 aaronmk
  PRIMARY KEY ("id"),
896 11211 aaronmk
  /*KEY "fk_specimen_observation_specimen1_idx" ("subject")*/CHECK (true),
897 11116 aaronmk
  /*KEY "specimen_observation_id_fkey1_idx" ("current_collection")*/CHECK (true),
898
  /*KEY "specimen_observation_id_fkey2_idx" ("owner_collection")*/CHECK (true),
899 11376 aaronmk
  /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("subject") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
900 11116 aaronmk
  /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
901
  /*CONSTRAINT "specimen_observation_id_fkey1" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
902 11376 aaronmk
  /*CONSTRAINT "specimen_observation_id_fkey2" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
903 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
904 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
905 8931 aaronmk
906
--
907
-- Dumping data for table "specimen_observation"
908
--
909
910
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
911
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
912
913
--
914
-- Table structure for table "stem"
915
--
916
917 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
918
/*!40101 SET character_set_client = utf8 */;
919 8931 aaronmk
CREATE TABLE "stem" (
920 8944 aaronmk
  "id" text NOT NULL,
921 10492 aaronmk
  "individual" text DEFAULT NULL,
922 8931 aaronmk
  PRIMARY KEY ("id"),
923
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
924
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
925
  /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
926 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An "individual tree stem" ("VegBank":http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemlocation&entity=dba_tabledescription&where=where_tablename)'*/;
927 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
928 8931 aaronmk
929
--
930
-- Dumping data for table "stem"
931
--
932
933
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
934
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
935
936
--
937
-- Table structure for table "stem_observation"
938
--
939
940 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
941
/*!40101 SET character_set_client = utf8 */;
942 8931 aaronmk
CREATE TABLE "stem_observation" (
943 8944 aaronmk
  "id" text NOT NULL,
944 11211 aaronmk
  "subject" text DEFAULT NULL,
945 10492 aaronmk
  "individual_observation" text DEFAULT NULL,
946 8931 aaronmk
  PRIMARY KEY ("id"),
947 11211 aaronmk
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","subject"),
948 8931 aaronmk
  /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true),
949 11211 aaronmk
  /*KEY "fk_stem_observation_stem1_idx" ("subject")*/CHECK (true),
950 8931 aaronmk
  /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
951 11376 aaronmk
  /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
952
  /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("subject") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
953 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]'*/;
954 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
955 8931 aaronmk
956
--
957
-- Dumping data for table "stem_observation"
958
--
959
960
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
961
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
962
963
--
964
-- Table structure for table "stratum"
965
--
966
967 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
968
/*!40101 SET character_set_client = utf8 */;
969 8931 aaronmk
CREATE TABLE "stratum" (
970 8944 aaronmk
  "id" text NOT NULL,
971 11212 aaronmk
  "name" text NOT NULL,
972
  "height_min_m" text DEFAULT NULL,
973
  "height_max_m" text DEFAULT NULL,
974 8931 aaronmk
  PRIMARY KEY ("id"),
975 11212 aaronmk
  /*CONSTRAINT "fk_layer_stratum1" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
976
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stratumType'*/;
977 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
978 8931 aaronmk
979
--
980
-- Dumping data for table "stratum"
981
--
982
983
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
984
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
985
986
--
987 10526 aaronmk
-- Table structure for table "subplace"
988
--
989
990
/*!40101 SET @saved_cs_client     = @@character_set_client */;
991
/*!40101 SET character_set_client = utf8 */;
992
CREATE TABLE "subplace" (
993
  "id" text NOT NULL,
994
  "parent" text NOT NULL,
995
  "x_m" double precision DEFAULT NULL,
996
  "y_m" double precision DEFAULT NULL,
997
  "coords" hstore DEFAULT NULL,
998
  PRIMARY KEY ("id"),
999
  /*KEY "fk_rel_place_place1_idx" ("parent")*/CHECK (true),
1000 11376 aaronmk
  /*CONSTRAINT "fk_rel_place_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1001
  /*CONSTRAINT "fk_subplot_place2" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1002 10526 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores plot elements such as subplots ("subplot, line, or any other subsample  or subdivision of plot" ("SALVIAS":http://salvias.net/Documents/salvias_data_dictionary.html#Plot_data/subplot))'*/;
1003
/*!40101 SET character_set_client = @saved_cs_client */;
1004
1005
--
1006
-- Dumping data for table "subplace"
1007
--
1008
1009
/*!40000 ALTER TABLE "subplace" DISABLE KEYS */;
1010
/*!40000 ALTER TABLE "subplace" ENABLE KEYS */;
1011
1012
--
1013 10519 aaronmk
-- Table structure for table "subplot"
1014
--
1015
1016
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1017
/*!40101 SET character_set_client = utf8 */;
1018
CREATE TABLE "subplot" (
1019
  "id" text NOT NULL,
1020 11128 aaronmk
  "parent" text NOT NULL /*COMMENT 'the parent plot'*/,
1021 10519 aaronmk
  PRIMARY KEY ("id"),
1022 11128 aaronmk
  /*KEY "fk_subplot_plot2_idx" ("parent")*/CHECK (true),
1023 11179 aaronmk
  /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1024 11128 aaronmk
  /*CONSTRAINT "fk_subplot_plot2" FOREIGN KEY ("parent") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1025 10526 aaronmk
  /*CONSTRAINT "fk_subplot_rel_place1" FOREIGN KEY ("id") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1026 10519 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1027
/*!40101 SET character_set_client = @saved_cs_client */;
1028
1029
--
1030
-- Dumping data for table "subplot"
1031
--
1032
1033
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
1034
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
1035
1036
--
1037 10632 aaronmk
-- Table structure for table "taxa_sampling_event"
1038
--
1039
1040
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1041
/*!40101 SET character_set_client = utf8 */;
1042
CREATE TABLE "taxa_sampling_event" (
1043
  "id" text NOT NULL,
1044 11220 aaronmk
  "parent" text DEFAULT NULL /*COMMENT 'the taxa_sampling_event for the parent stratum'*/,
1045 11213 aaronmk
  "place_visit" text NOT NULL,
1046 11126 aaronmk
  "subsetting_method" text DEFAULT NULL,
1047 10632 aaronmk
  PRIMARY KEY ("id"),
1048 11213 aaronmk
  /*CONSTRAINT "taxa_sampling_event__unique" */UNIQUE ("place_visit","subsetting_method"),
1049 11126 aaronmk
  /*KEY "fk_sampling_event_method1_idx" ("subsetting_method")*/CHECK (true),
1050 11213 aaronmk
  /*KEY "taxa_sampling_event_id_fkey1_idx" ("place_visit")*/CHECK (true),
1051 11220 aaronmk
  /*KEY "taxa_sampling_event_id_fkey2_idx" ("parent")*/CHECK (true),
1052 11179 aaronmk
  /*CONSTRAINT "fk_project_event10" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1053 11220 aaronmk
  /*CONSTRAINT "fk_sampling_event_method1" FOREIGN KEY ("subsetting_method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1054 11376 aaronmk
  /*CONSTRAINT "taxa_sampling_event_id_fkey1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1055
  /*CONSTRAINT "taxa_sampling_event_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1056 11212 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegX.vegpath.org?stratumObservation, VegBank.vegpath.org?stratum (which was confusingly named)'*/;
1057 10632 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1058
1059
--
1060
-- Dumping data for table "taxa_sampling_event"
1061
--
1062
1063
/*!40000 ALTER TABLE "taxa_sampling_event" DISABLE KEYS */;
1064
/*!40000 ALTER TABLE "taxa_sampling_event" ENABLE KEYS */;
1065
1066
--
1067 10457 aaronmk
-- Table structure for table "taxon_absence"
1068
--
1069
1070
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1071
/*!40101 SET character_set_client = utf8 */;
1072
CREATE TABLE "taxon_absence" (
1073
  "id" text NOT NULL,
1074
  PRIMARY KEY ("id"),
1075 10659 aaronmk
  /*CONSTRAINT "fk_taxon_absence_taxa_sampling_event1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1076 10457 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place'*/;
1077
/*!40101 SET character_set_client = @saved_cs_client */;
1078
1079
--
1080
-- Dumping data for table "taxon_absence"
1081
--
1082
1083
/*!40000 ALTER TABLE "taxon_absence" DISABLE KEYS */;
1084
/*!40000 ALTER TABLE "taxon_absence" ENABLE KEYS */;
1085
1086
--
1087 8931 aaronmk
-- Table structure for table "taxon_assertion"
1088
--
1089
1090 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1091
/*!40101 SET character_set_client = utf8 */;
1092 8931 aaronmk
CREATE TABLE "taxon_assertion" (
1093 8944 aaronmk
  "id" text NOT NULL,
1094 10446 aaronmk
  "string" text NOT NULL /*COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name'*/,
1095 8944 aaronmk
  "taxon" text DEFAULT NULL,
1096
  "cf_aff" text DEFAULT NULL,
1097 8938 aaronmk
  "annotations" hstore DEFAULT NULL,
1098 8931 aaronmk
  PRIMARY KEY ("id"),
1099
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
1100
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
1101 10968 aaronmk
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1102 11376 aaronmk
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1103
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1104 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1105 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1106 8931 aaronmk
1107
--
1108
-- Dumping data for table "taxon_assertion"
1109
--
1110
1111
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
1112
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
1113
1114
--
1115
-- Table structure for table "taxon_concept"
1116
--
1117
1118 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1119
/*!40101 SET character_set_client = utf8 */;
1120 8931 aaronmk
CREATE TABLE "taxon_concept" (
1121 8944 aaronmk
  "id" text NOT NULL,
1122
  "according_to" text NOT NULL,
1123 10498 aaronmk
  "parent" text DEFAULT NULL,
1124 8944 aaronmk
  "accepted_taxon_concept" text DEFAULT NULL,
1125 8931 aaronmk
  PRIMARY KEY ("id"),
1126
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
1127
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
1128
  /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true),
1129
  /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true),
1130 10975 aaronmk
  /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1131 8931 aaronmk
  /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1132 11376 aaronmk
  /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1133
  /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1134 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]'*/;
1135 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1136 8931 aaronmk
1137
--
1138
-- Dumping data for table "taxon_concept"
1139
--
1140
1141
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
1142
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
1143
1144
--
1145
-- Table structure for table "taxon_determination"
1146
--
1147
1148 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1149
/*!40101 SET character_set_client = utf8 */;
1150 8931 aaronmk
CREATE TABLE "taxon_determination" (
1151 8944 aaronmk
  "id" text NOT NULL,
1152 10663 aaronmk
  "taxon_assertion" text NOT NULL,
1153 11132 aaronmk
  "voucher" text DEFAULT NULL,
1154 10473 aaronmk
  "identified_by" text DEFAULT NULL,
1155 8938 aaronmk
  "fit_info" hstore DEFAULT NULL,
1156 8931 aaronmk
  PRIMARY KEY ("id"),
1157
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
1158
  /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true),
1159 10455 aaronmk
  /*KEY "fk_taxon_determination_party_list1_idx" ("identified_by")*/CHECK (true),
1160 11132 aaronmk
  /*KEY "taxon_determination_id_fkey1_idx" ("voucher")*/CHECK (true),
1161 11376 aaronmk
  /*CONSTRAINT "fk_taxon_determination_party_list1" FOREIGN KEY ("identified_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1162
  /*CONSTRAINT "fk_taxon_determination_taxon_observation1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1163 11195 aaronmk
  /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1164 11376 aaronmk
  /*CONSTRAINT "taxon_determination_id_fkey1" FOREIGN KEY ("voucher") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1165 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/;
1166 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1167 8931 aaronmk
1168
--
1169
-- Dumping data for table "taxon_determination"
1170
--
1171
1172
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
1173
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
1174
1175
--
1176
-- Table structure for table "taxon_name"
1177
--
1178
1179 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1180
/*!40101 SET character_set_client = utf8 */;
1181 8931 aaronmk
CREATE TABLE "taxon_name" (
1182 8944 aaronmk
  "id" text NOT NULL,
1183
  "unique_name" text NOT NULL,
1184 11405 aaronmk
  "taxon_path" text DEFAULT NULL,
1185 8944 aaronmk
  "formal_name" text DEFAULT NULL,
1186
  "taxon_name" text DEFAULT NULL,
1187
  "author" text DEFAULT NULL,
1188
  "common_name" text DEFAULT NULL,
1189
  "rank" text DEFAULT NULL,
1190 8931 aaronmk
  PRIMARY KEY ("id"),
1191
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
1192 10496 aaronmk
  /*KEY "fk_taxon_name_taxon_path1_idx" ("taxon_path")*/CHECK (true),
1193
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1194 11525 aaronmk
  /*CONSTRAINT "fk_taxon_name_taxon_path1" FOREIGN KEY ("taxon_path") REFERENCES "taxon_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1195
  /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1196 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1197 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1198 8931 aaronmk
1199
--
1200
-- Dumping data for table "taxon_name"
1201
--
1202
1203
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
1204
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
1205
1206
--
1207
-- Table structure for table "taxon_observation"
1208
--
1209
1210 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1211
/*!40101 SET character_set_client = utf8 */;
1212 8931 aaronmk
CREATE TABLE "taxon_observation" (
1213 8944 aaronmk
  "id" text NOT NULL,
1214 11216 aaronmk
  "parent" text DEFAULT NULL /*COMMENT 'the observation of the same taxon_occurrence in the parent sampling_event'*/,
1215 11211 aaronmk
  "subject" text DEFAULT NULL,
1216 11139 aaronmk
  "taxon_occurrence" text NOT NULL /*COMMENT 'when not provided (and not fillable from another field), a taxon_occurrence will be created with the same id as the taxon_observation'*/,
1217 11119 aaronmk
  "sampling_event" text NOT NULL /*COMMENT 'for specimens, this will have the same event information (date_range, participants, place) as the taxon_observation'*/,
1218 11117 aaronmk
  "primary_collector" text DEFAULT NULL,
1219 8944 aaronmk
  "collector_number" text DEFAULT NULL,
1220 11117 aaronmk
  "all_collectors" text DEFAULT NULL,
1221 11405 aaronmk
  "traits" hstore DEFAULT NULL,
1222 8944 aaronmk
  "growth_form" text DEFAULT NULL,
1223 8931 aaronmk
  "cultivated" integer DEFAULT NULL,
1224
  PRIMARY KEY ("id"),
1225 10952 aaronmk
  /*KEY "fk_taxon_observation_taxon_occurrence1_idx" ("taxon_occurrence")*/CHECK (true),
1226 10959 aaronmk
  /*KEY "fk_taxon_observation_taxa_sampling_event1_idx" ("sampling_event")*/CHECK (true),
1227 11117 aaronmk
  /*KEY "taxon_observation_id_fkey1_idx" ("primary_collector")*/CHECK (true),
1228
  /*KEY "fk_taxon_observation_party_list1_idx" ("all_collectors")*/CHECK (true),
1229 11118 aaronmk
  /*KEY "taxon_observation__unique" ("sampling_event","primary_collector","collector_number")*/CHECK (true),
1230 11129 aaronmk
  /*KEY "taxon_observation_id_fkey2_idx" ("parent")*/CHECK (true),
1231 11211 aaronmk
  /*KEY "taxon_observation_id_fkey3_idx" ("subject")*/CHECK (true),
1232 11525 aaronmk
  /*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("all_collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1233
  /*CONSTRAINT "fk_taxon_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1234
  /*CONSTRAINT "fk_taxon_observation_taxa_sampling_event1" FOREIGN KEY ("sampling_event") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1235
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1236 11405 aaronmk
  /*CONSTRAINT "taxon_observation_id_fkey1" FOREIGN KEY ("primary_collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1237
  /*CONSTRAINT "taxon_observation_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1238 11525 aaronmk
  /*CONSTRAINT "taxon_observation_id_fkey3" FOREIGN KEY ("subject") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1239 11129 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= DwC.vegpath.org?Occurrence (which actually represents an *observation* of an occurrence)'*/;
1240 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1241 8931 aaronmk
1242
--
1243
-- Dumping data for table "taxon_observation"
1244
--
1245
1246
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
1247
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
1248
1249
--
1250 10952 aaronmk
-- Table structure for table "taxon_occurrence"
1251
--
1252
1253
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1254
/*!40101 SET character_set_client = utf8 */;
1255
CREATE TABLE "taxon_occurrence" (
1256
  "id" text NOT NULL,
1257 10961 aaronmk
  "within_place" text NOT NULL,
1258 10952 aaronmk
  "current_observation" text DEFAULT NULL,
1259
  PRIMARY KEY ("id"),
1260
  /*KEY "fk_taxon_occurrence_taxon_determination3_idx" ("current_observation")*/CHECK (true),
1261 10956 aaronmk
  /*KEY "fk_taxon_occurrence_place1_idx" ("within_place")*/CHECK (true),
1262 11376 aaronmk
  /*CONSTRAINT "fk_taxon_occurrence_place1" FOREIGN KEY ("within_place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1263 10968 aaronmk
  /*CONSTRAINT "fk_taxon_occurrence_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1264 11376 aaronmk
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination3" FOREIGN KEY ("current_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1265 11048 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='*not* DwC.vegpath.org?Occurrence'*/;
1266 10952 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1267
1268
--
1269
-- Dumping data for table "taxon_occurrence"
1270
--
1271
1272
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
1273
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
1274
1275
--
1276 8931 aaronmk
-- Table structure for table "taxon_path"
1277
--
1278
1279 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1280
/*!40101 SET character_set_client = utf8 */;
1281 8931 aaronmk
CREATE TABLE "taxon_path" (
1282 8944 aaronmk
  "id" text NOT NULL,
1283
  "family" text DEFAULT NULL,
1284
  "genus" text DEFAULT NULL,
1285
  "specific_epithet" text DEFAULT NULL,
1286 8938 aaronmk
  "ranks" hstore DEFAULT NULL,
1287 10496 aaronmk
  PRIMARY KEY ("id")
1288 10446 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"a group of one (or more) populations of organism(s), which a taxonomist adjudges to be a unit" ("Wikipedia":http://en.wikipedia.org/wiki/Taxon)'*/;
1289 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1290 8931 aaronmk
1291
--
1292
-- Dumping data for table "taxon_path"
1293
--
1294
1295
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
1296
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
1297
1298
--
1299
-- Table structure for table "taxon_presence"
1300
--
1301
1302 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1303
/*!40101 SET character_set_client = utf8 */;
1304 8931 aaronmk
CREATE TABLE "taxon_presence" (
1305 8944 aaronmk
  "id" text NOT NULL,
1306 10658 aaronmk
  "cover_percent" double precision DEFAULT NULL,
1307 8931 aaronmk
  PRIMARY KEY ("id"),
1308 10659 aaronmk
  /*CONSTRAINT "fk_taxon_presence_taxon_determination1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1309 11048 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegX.vegpath.org?aggregateOrganismObservation, VegBank.vegpath.org?taxonImportance; "An observation applying to all occurrences of an organism" ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/aggregateOrganismObservations/aggregateOrganismObservation).'*/;
1310 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1311 8931 aaronmk
1312
--
1313
-- Dumping data for table "taxon_presence"
1314
--
1315
1316
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
1317
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
1318
1319
--
1320 10469 aaronmk
-- Table structure for table "taxon_scrub"
1321
--
1322
1323
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1324
/*!40101 SET character_set_client = utf8 */;
1325
CREATE TABLE "taxon_scrub" (
1326
  "id" text NOT NULL,
1327
  "input_string" text NOT NULL,
1328
  "parsed_taxon_assertion" text NOT NULL,
1329
  "matched_taxon_concept" text DEFAULT NULL,
1330 11405 aaronmk
  "match_info" hstore DEFAULT NULL,
1331 10469 aaronmk
  "match_score" float DEFAULT NULL,
1332
  PRIMARY KEY ("id"),
1333
  /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true),
1334
  /*KEY "fk_taxon_scrub_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
1335
  /*KEY "fk_taxon_scrub_taxon_string1_idx" ("input_string")*/CHECK (true),
1336 11525 aaronmk
  /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1337 11405 aaronmk
  /*CONSTRAINT "fk_taxon_scrub_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1338 10469 aaronmk
  /*CONSTRAINT "fk_taxon_scrub_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1339 11376 aaronmk
  /*CONSTRAINT "fk_taxon_scrub_taxon_string1" FOREIGN KEY ("input_string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1340 10469 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1341
/*!40101 SET character_set_client = @saved_cs_client */;
1342
1343
--
1344
-- Dumping data for table "taxon_scrub"
1345
--
1346
1347
/*!40000 ALTER TABLE "taxon_scrub" DISABLE KEYS */;
1348
/*!40000 ALTER TABLE "taxon_scrub" ENABLE KEYS */;
1349
1350
--
1351 8931 aaronmk
-- Table structure for table "taxon_string"
1352
--
1353
1354 9630 aaronmk
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1355
/*!40101 SET character_set_client = utf8 */;
1356 8931 aaronmk
CREATE TABLE "taxon_string" (
1357 8944 aaronmk
  "string" text NOT NULL,
1358 10438 aaronmk
  PRIMARY KEY ("string")
1359 10449 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='to get the parsed_taxon_assertion (TNRS result) for a taxon_string, join using taxon_string.string<-taxon_assertion(string)::parsed_taxon_assertion[source=''TNRS.version''] (see wiki.vegpath.org/SQL_dotpaths)'*/;
1360 9630 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1361 8931 aaronmk
1362
--
1363
-- Dumping data for table "taxon_string"
1364
--
1365
1366
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1367
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1368 10968 aaronmk
1369
--
1370
-- Table structure for table "traceable"
1371
--
1372
1373
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1374
/*!40101 SET character_set_client = utf8 */;
1375
CREATE TABLE "traceable" (
1376
  "id" text NOT NULL,
1377 11525 aaronmk
  "ids_by_source" text[] DEFAULT NULL /*COMMENT 'allows referencing a traceable by its source information even when the subclass chose a different value for the pkey'*/,
1378 11029 aaronmk
  "source" text NOT NULL,
1379 11058 aaronmk
  "id_within_source" text DEFAULT NULL /*COMMENT 'the portion of the source that this traceable refers to. when specified, this must *uniquely identify* the traceable within the source. denormalized source data often contains data for many VegCore tables in the same row, and the traceables for each of these table entries must be distinguished *from each other* since they share the same source. this is usually just the VegCore table name, sometimes with a distinguishing prefix (e.g. collector.party/identified_by.party; current_observation.taxon_determination/orig_observation.taxon_determination). this can also identify e.g. a dataset within the source that it came from.'*/,
1380 11208 aaronmk
  "authors" text DEFAULT NULL /*COMMENT 'the people who created the information in the data record. this is *different* from dataset.data_owners, and refers *only* to original data creators such as collectors and identifiers. note that in vegetation data, these record-specific authors generally do not receive attribution. this makes traceable mutually recursive with party_list. = Brad.vegpath.org?attribution.data_author'*/,
1381 10968 aaronmk
  PRIMARY KEY ("id"),
1382 11058 aaronmk
  /*CONSTRAINT "traceable_unique" */UNIQUE ("source","id_within_source"),
1383 11525 aaronmk
  /*CONSTRAINT "traceable__id_by_source" */UNIQUE ("ids_by_source"),
1384 11204 aaronmk
  /*KEY "traceable_id_fkey1_idx" ("authors")*/CHECK (true),
1385 11525 aaronmk
  /*CONSTRAINT "traceable_id_fkey1" FOREIGN KEY ("authors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1386
  /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1387 10969 aaronmk
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a row that can have associated source information'*/;
1388 10968 aaronmk
/*!40101 SET character_set_client = @saved_cs_client */;
1389
1390
--
1391
-- Dumping data for table "traceable"
1392
--
1393
1394
/*!40000 ALTER TABLE "traceable" DISABLE KEYS */;
1395
/*!40000 ALTER TABLE "traceable" ENABLE KEYS */;
1396 8931 aaronmk
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1397
1398
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1399
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1400
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1401 10446 aaronmk
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1402
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1403
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1404 8931 aaronmk
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1405
1406
-- Dump completed