Project

General

Profile

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