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