Project

General

Profile

1
SET standard_conforming_strings = off;
2
SET escape_string_warning = off;
3
-- MySQL dump 10.13  Distrib 5.5.31, for debian-linux-gnu (x86_64)
4
--
5
-- Host: localhost    Database: VegCore
6
-- ------------------------------------------------------
7
-- Server version	5.5.31-0ubuntu0.12.04.2
8

    
9
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12
SET NAMES 'utf8';
13
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14
/*!40103 SET TIME_ZONE='+00:00' */;
15
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19

    
20
--
21
-- Table structure for table "aggregate_observation"
22
--
23

    
24
/*!40101 SET @saved_cs_client     = @@character_set_client */;
25
/*!40101 SET character_set_client = utf8 */;
26
CREATE TABLE "aggregate_observation" (
27
  "id" text NOT NULL,
28
  "taxon_concept" text NOT NULL,
29
  "traits" hstore DEFAULT NULL,
30
  PRIMARY KEY ("id"),
31
  /*KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
32
  /*CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
33
  /*CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
34
) /*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)'*/;
35
/*!40101 SET character_set_client = @saved_cs_client */;
36

    
37
--
38
-- Dumping data for table "aggregate_observation"
39
--
40

    
41
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
42
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
43

    
44
--
45
-- Table structure for table "base_class"
46
--
47

    
48
/*!40101 SET @saved_cs_client     = @@character_set_client */;
49
/*!40101 SET character_set_client = utf8 */;
50
CREATE TABLE "base_class" (
51
  "id" text NOT NULL,
52
  "referenced_class" text NOT NULL,
53
  PRIMARY KEY ("id"),
54
  /*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true),
55
  /*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
56
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
57
/*!40101 SET character_set_client = @saved_cs_client */;
58

    
59
--
60
-- Dumping data for table "base_class"
61
--
62

    
63
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
64
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
65

    
66
--
67
-- Table structure for table "collection"
68
--
69

    
70
/*!40101 SET @saved_cs_client     = @@character_set_client */;
71
/*!40101 SET character_set_client = utf8 */;
72
CREATE TABLE "collection" (
73
  "id" text NOT NULL,
74
  "institution" text NOT NULL,
75
  "name" text NOT NULL,
76
  PRIMARY KEY ("id"),
77
  /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
78
  /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
79
  /*KEY "fk_collection_source1_idx" ("id")*/CHECK (true),
80
  /*CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
81
  /*CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
82
) /*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)'*/;
83
/*!40101 SET character_set_client = @saved_cs_client */;
84

    
85
--
86
-- Dumping data for table "collection"
87
--
88

    
89
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
90
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
91

    
92
--
93
-- Table structure for table "community"
94
--
95

    
96
/*!40101 SET @saved_cs_client     = @@character_set_client */;
97
/*!40101 SET character_set_client = utf8 */;
98
CREATE TABLE "community" (
99
  "id" text NOT NULL,
100
  "name" text NOT NULL,
101
  "info" hstore DEFAULT NULL,
102
  PRIMARY KEY ("id"),
103
  /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
104
) /*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]])'*/;
105
/*!40101 SET character_set_client = @saved_cs_client */;
106

    
107
--
108
-- Dumping data for table "community"
109
--
110

    
111
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
112
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
113

    
114
--
115
-- Table structure for table "coordinates"
116
--
117

    
118
/*!40101 SET @saved_cs_client     = @@character_set_client */;
119
/*!40101 SET character_set_client = utf8 */;
120
CREATE TABLE "coordinates" (
121
  "id" text NOT NULL,
122
  "latitude_deg" text DEFAULT NULL,
123
  "longitude_deg" text DEFAULT NULL,
124
  PRIMARY KEY ("id")
125
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point'*/;
126
/*!40101 SET character_set_client = @saved_cs_client */;
127

    
128
--
129
-- Dumping data for table "coordinates"
130
--
131

    
132
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
133
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
134

    
135
--
136
-- Table structure for table "derived_class"
137
--
138

    
139
/*!40101 SET @saved_cs_client     = @@character_set_client */;
140
/*!40101 SET character_set_client = utf8 */;
141
CREATE TABLE "derived_class" (
142
  "id" text NOT NULL,
143
  PRIMARY KEY ("id"),
144
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
145
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
146
/*!40101 SET character_set_client = @saved_cs_client */;
147

    
148
--
149
-- Dumping data for table "derived_class"
150
--
151

    
152
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
153
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
154

    
155
--
156
-- Table structure for table "event"
157
--
158

    
159
/*!40101 SET @saved_cs_client     = @@character_set_client */;
160
/*!40101 SET character_set_client = utf8 */;
161
CREATE TABLE "event" (
162
  "id" text NOT NULL,
163
  "parent" text NOT NULL,
164
  "name" text DEFAULT NULL,
165
  "date_range" text DEFAULT NULL,
166
  "place" text DEFAULT NULL,
167
  "method" text DEFAULT NULL,
168
  PRIMARY KEY ("id"),
169
  /*KEY "fk_event_place1_idx" ("place")*/CHECK (true),
170
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
171
  /*KEY "fk_event_method1_idx" ("method")*/CHECK (true),
172
  /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
173
  /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
174
  /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
175
  /*CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
176
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"an action that occurs at a place and during a period of text/*time*/" ("DwC":http://rs.tdwg.org/dwc/terms/#Event)'*/;
177
/*!40101 SET character_set_client = @saved_cs_client */;
178

    
179
--
180
-- Dumping data for table "event"
181
--
182

    
183
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
184
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
185

    
186
--
187
-- Table structure for table "event_participant"
188
--
189

    
190
/*!40101 SET @saved_cs_client     = @@character_set_client */;
191
/*!40101 SET character_set_client = utf8 */;
192
CREATE TABLE "event_participant" (
193
  "event" text NOT NULL,
194
  "party" text NOT NULL,
195
  "sort_order" integer DEFAULT NULL,
196
  PRIMARY KEY ("event","party"),
197
  /*KEY "fk_event_has_party_party1_idx" ("party")*/CHECK (true),
198
  /*KEY "fk_event_has_party_event1_idx" ("event")*/CHECK (true),
199
  /*CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
200
  /*CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
201
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
202
/*!40101 SET character_set_client = @saved_cs_client */;
203

    
204
--
205
-- Dumping data for table "event_participant"
206
--
207

    
208
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
209
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
210

    
211
--
212
-- Table structure for table "geological_context"
213
--
214

    
215
/*!40101 SET @saved_cs_client     = @@character_set_client */;
216
/*!40101 SET character_set_client = utf8 */;
217
CREATE TABLE "geological_context" (
218
  "id" text NOT NULL,
219
  "name" text NOT NULL,
220
  "info" hstore DEFAULT NULL,
221
  PRIMARY KEY ("id"),
222
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
223
) /*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)'*/;
224
/*!40101 SET character_set_client = @saved_cs_client */;
225

    
226
--
227
-- Dumping data for table "geological_context"
228
--
229

    
230
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
231
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
232

    
233
--
234
-- Table structure for table "geovalidation"
235
--
236

    
237
/*!40101 SET @saved_cs_client     = @@character_set_client */;
238
/*!40101 SET character_set_client = utf8 */;
239
CREATE TABLE "geovalidation" (
240
  "id" text NOT NULL,
241
  "geovalid" integer NOT NULL,
242
  "lat_long_domain_valid" integer NOT NULL,
243
  "lat_long_in_ranks" hstore DEFAULT NULL,
244
  PRIMARY KEY ("id"),
245
  /*CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
246
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]'*/;
247
/*!40101 SET character_set_client = @saved_cs_client */;
248

    
249
--
250
-- Dumping data for table "geovalidation"
251
--
252

    
253
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
254
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
255

    
256
--
257
-- Table structure for table "individual"
258
--
259

    
260
/*!40101 SET @saved_cs_client     = @@character_set_client */;
261
/*!40101 SET character_set_client = utf8 */;
262
CREATE TABLE "individual" (
263
  "id" text NOT NULL,
264
  "tag" text DEFAULT NULL,
265
  "tag_history" hstore DEFAULT NULL,
266
  PRIMARY KEY ("id"),
267
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
268
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism'*/;
269
/*!40101 SET character_set_client = @saved_cs_client */;
270

    
271
--
272
-- Dumping data for table "individual"
273
--
274

    
275
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
276
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
277

    
278
--
279
-- Table structure for table "individual_observation"
280
--
281

    
282
/*!40101 SET @saved_cs_client     = @@character_set_client */;
283
/*!40101 SET character_set_client = utf8 */;
284
CREATE TABLE "individual_observation" (
285
  "id" text NOT NULL,
286
  "individual" text DEFAULT NULL,
287
  "code" text DEFAULT NULL,
288
  "traits" hstore DEFAULT NULL,
289
  PRIMARY KEY ("id"),
290
  /*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true),
291
  /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
292
  /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
293
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]'*/;
294
/*!40101 SET character_set_client = @saved_cs_client */;
295

    
296
--
297
-- Dumping data for table "individual_observation"
298
--
299

    
300
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
301
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
302

    
303
--
304
-- Table structure for table "method"
305
--
306

    
307
/*!40101 SET @saved_cs_client     = @@character_set_client */;
308
/*!40101 SET character_set_client = utf8 */;
309
CREATE TABLE "method" (
310
  "id" text NOT NULL,
311
  "parent" text NOT NULL,
312
  "info" hstore DEFAULT NULL,
313
  PRIMARY KEY ("id"),
314
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
315
  /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
316
  /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
317
) /*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)'*/;
318
/*!40101 SET character_set_client = @saved_cs_client */;
319

    
320
--
321
-- Dumping data for table "method"
322
--
323

    
324
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
325
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
326

    
327
--
328
-- Table structure for table "organization"
329
--
330

    
331
/*!40101 SET @saved_cs_client     = @@character_set_client */;
332
/*!40101 SET character_set_client = utf8 */;
333
CREATE TABLE "organization" (
334
  "id" text NOT NULL,
335
  "info" hstore DEFAULT NULL,
336
  PRIMARY KEY ("id"),
337
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
338
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
339
/*!40101 SET character_set_client = @saved_cs_client */;
340

    
341
--
342
-- Dumping data for table "organization"
343
--
344

    
345
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
346
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
347

    
348
--
349
-- Table structure for table "parsed_taxon_assertion"
350
--
351

    
352
/*!40101 SET @saved_cs_client     = @@character_set_client */;
353
/*!40101 SET character_set_client = utf8 */;
354
CREATE TABLE "parsed_taxon_assertion" (
355
  "id" text NOT NULL,
356
  "matched_taxon_concept" text DEFAULT NULL,
357
  "match_score" float DEFAULT NULL,
358
  "match_info" hstore DEFAULT NULL,
359
  PRIMARY KEY ("id"),
360
  /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true),
361
  /*CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
362
  /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
363
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
364
/*!40101 SET character_set_client = @saved_cs_client */;
365

    
366
--
367
-- Dumping data for table "parsed_taxon_assertion"
368
--
369

    
370
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
371
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
372

    
373
--
374
-- Table structure for table "party"
375
--
376

    
377
/*!40101 SET @saved_cs_client     = @@character_set_client */;
378
/*!40101 SET character_set_client = utf8 */;
379
CREATE TABLE "party" (
380
  "id" text NOT NULL,
381
  "info" hstore DEFAULT NULL,
382
  PRIMARY KEY ("id"),
383
  /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
384
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
385
/*!40101 SET character_set_client = @saved_cs_client */;
386

    
387
--
388
-- Dumping data for table "party"
389
--
390

    
391
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
392
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
393

    
394
--
395
-- Table structure for table "place"
396
--
397

    
398
/*!40101 SET @saved_cs_client     = @@character_set_client */;
399
/*!40101 SET character_set_client = utf8 */;
400
CREATE TABLE "place" (
401
  "id" text NOT NULL,
402
  "parent" text NOT NULL,
403
  "coordinates" text DEFAULT NULL,
404
  "path" text DEFAULT NULL,
405
  "locality" text DEFAULT NULL,
406
  PRIMARY KEY ("id"),
407
  /*KEY "fk_place_coordinates1_idx" ("coordinates")*/CHECK (true),
408
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
409
  /*KEY "fk_place_place_path1_idx" ("path")*/CHECK (true),
410
  /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
411
  /*CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
412
  /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
413
  /*CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
414
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point'*/;
415
/*!40101 SET character_set_client = @saved_cs_client */;
416

    
417
--
418
-- Dumping data for table "place"
419
--
420

    
421
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
422
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
423

    
424
--
425
-- Table structure for table "place_observation"
426
--
427

    
428
/*!40101 SET @saved_cs_client     = @@character_set_client */;
429
/*!40101 SET character_set_client = utf8 */;
430
CREATE TABLE "place_observation" (
431
  "id" text NOT NULL,
432
  "place" text NOT NULL,
433
  "elevation_m" double precision DEFAULT NULL,
434
  "slope_incline_deg" double precision DEFAULT NULL,
435
  "slope_direction_deg_N" double precision DEFAULT NULL,
436
  "geological_context" text DEFAULT NULL,
437
  "community" text DEFAULT NULL,
438
  "observations" hstore DEFAULT NULL,
439
  PRIMARY KEY ("id"),
440
  /*KEY "fk_place_observation_place1_idx" ("place")*/CHECK (true),
441
  /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true),
442
  /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true),
443
  /*KEY "fk_place_observation_event1_idx" ("id")*/CHECK (true),
444
  /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
445
  /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
446
  /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
447
  /*CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
448
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]'*/;
449
/*!40101 SET character_set_client = @saved_cs_client */;
450

    
451
--
452
-- Dumping data for table "place_observation"
453
--
454

    
455
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
456
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
457

    
458
--
459
-- Table structure for table "place_path"
460
--
461

    
462
/*!40101 SET @saved_cs_client     = @@character_set_client */;
463
/*!40101 SET character_set_client = utf8 */;
464
CREATE TABLE "place_path" (
465
  "id" text NOT NULL,
466
  "continent" text DEFAULT NULL,
467
  "country" text DEFAULT NULL,
468
  "state_province" text DEFAULT NULL,
469
  "county" text DEFAULT NULL,
470
  "municipality" text DEFAULT NULL,
471
  "ranks" hstore DEFAULT NULL,
472
  PRIMARY KEY ("id")
473
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region'*/;
474
/*!40101 SET character_set_client = @saved_cs_client */;
475

    
476
--
477
-- Dumping data for table "place_path"
478
--
479

    
480
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
481
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
482

    
483
--
484
-- Table structure for table "plot"
485
--
486

    
487
/*!40101 SET @saved_cs_client     = @@character_set_client */;
488
/*!40101 SET character_set_client = utf8 */;
489
CREATE TABLE "plot" (
490
  "id" text NOT NULL,
491
  "name" text DEFAULT NULL,
492
  "area_m2" double precision DEFAULT NULL,
493
  "bounding_box" text DEFAULT NULL,
494
  PRIMARY KEY ("id"),
495
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
496
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
497
/*!40101 SET character_set_client = @saved_cs_client */;
498

    
499
--
500
-- Dumping data for table "plot"
501
--
502

    
503
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
504
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
505

    
506
--
507
-- Table structure for table "project"
508
--
509

    
510
/*!40101 SET @saved_cs_client     = @@character_set_client */;
511
/*!40101 SET character_set_client = utf8 */;
512
CREATE TABLE "project" (
513
  "id" text NOT NULL,
514
  "name" text NOT NULL,
515
  "info" hstore DEFAULT NULL,
516
  PRIMARY KEY ("id"),
517
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
518
) /*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)'*/;
519
/*!40101 SET character_set_client = @saved_cs_client */;
520

    
521
--
522
-- Dumping data for table "project"
523
--
524

    
525
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
526
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
527

    
528
--
529
-- Table structure for table "record"
530
--
531

    
532
/*!40101 SET @saved_cs_client     = @@character_set_client */;
533
/*!40101 SET character_set_client = utf8 */;
534
CREATE TABLE "record" (
535
  "id" text NOT NULL,
536
  "source" text NOT NULL,
537
  "source_id_scope" text DEFAULT NULL,
538
  "source_record_id" text DEFAULT NULL,
539
  "info" hstore DEFAULT NULL,
540
  PRIMARY KEY ("id"),
541
  /*CONSTRAINT "record_unique" */UNIQUE ("source","source_id_scope","source_record_id"),
542
  /*KEY "fk_record_source1_idx" ("source")*/CHECK (true),
543
  /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
544
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
545
/*!40101 SET character_set_client = @saved_cs_client */;
546

    
547
--
548
-- Dumping data for table "record"
549
--
550

    
551
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
552
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
553

    
554
--
555
-- Table structure for table "referenced_class"
556
--
557

    
558
/*!40101 SET @saved_cs_client     = @@character_set_client */;
559
/*!40101 SET character_set_client = utf8 */;
560
CREATE TABLE "referenced_class" (
561
  "id" text NOT NULL,
562
  PRIMARY KEY ("id"),
563
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
564
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
565
/*!40101 SET character_set_client = @saved_cs_client */;
566

    
567
--
568
-- Dumping data for table "referenced_class"
569
--
570

    
571
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
572
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
573

    
574
--
575
-- Table structure for table "relationship"
576
--
577

    
578
/*!40101 SET @saved_cs_client     = @@character_set_client */;
579
/*!40101 SET character_set_client = utf8 */;
580
CREATE TABLE "relationship" (
581
  "id" text NOT NULL,
582
  "record" text NOT NULL,
583
  "related_record" text NOT NULL,
584
  "info" hstore DEFAULT NULL,
585
  PRIMARY KEY ("id"),
586
  /*KEY "fk_relationship_record1_idx" ("record")*/CHECK (true),
587
  /*KEY "fk_relationship_related_record_idx" ("related_record")*/CHECK (true),
588
  /*CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
589
  /*CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
590
  /*CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
591
) /*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)'*/;
592
/*!40101 SET character_set_client = @saved_cs_client */;
593

    
594
--
595
-- Dumping data for table "relationship"
596
--
597

    
598
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
599
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
600

    
601
--
602
-- Table structure for table "soil_observation"
603
--
604

    
605
/*!40101 SET @saved_cs_client     = @@character_set_client */;
606
/*!40101 SET character_set_client = utf8 */;
607
CREATE TABLE "soil_observation" (
608
  "id" text NOT NULL,
609
  "observations" hstore DEFAULT NULL,
610
  PRIMARY KEY ("id"),
611
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
612
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil'*/;
613
/*!40101 SET character_set_client = @saved_cs_client */;
614

    
615
--
616
-- Dumping data for table "soil_observation"
617
--
618

    
619
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
620
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
621

    
622
--
623
-- Table structure for table "source"
624
--
625

    
626
/*!40101 SET @saved_cs_client     = @@character_set_client */;
627
/*!40101 SET character_set_client = utf8 */;
628
CREATE TABLE "source" (
629
  "id" text NOT NULL,
630
  "parent" text NOT NULL,
631
  "name" text NOT NULL,
632
  "first_publisher" text DEFAULT NULL,
633
  "owner" text DEFAULT NULL,
634
  "info" hstore DEFAULT NULL,
635
  PRIMARY KEY ("id"),
636
  /*CONSTRAINT "source_unique" */UNIQUE ("parent","name"),
637
  /*KEY "fk_source1_idx" ("parent")*/CHECK (true),
638
  /*KEY "fk_source_party1_idx" ("owner")*/CHECK (true),
639
  /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true),
640
  /*CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
641
  /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
642
  /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
643
) /*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)'*/;
644
/*!40101 SET character_set_client = @saved_cs_client */;
645

    
646
--
647
-- Dumping data for table "source"
648
--
649

    
650
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
651
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
652

    
653
--
654
-- Table structure for table "specimen"
655
--
656

    
657
/*!40101 SET @saved_cs_client     = @@character_set_client */;
658
/*!40101 SET character_set_client = utf8 */;
659
CREATE TABLE "specimen" (
660
  "id" text NOT NULL,
661
  "individual" text DEFAULT NULL,
662
  "code_in_individual" text DEFAULT NULL,
663
  "collection_event" text DEFAULT NULL,
664
  "orig_collection" text DEFAULT NULL,
665
  "barcode" text DEFAULT NULL,
666
  "accession_number" text DEFAULT NULL,
667
  "current_collection" text DEFAULT NULL,
668
  "owner_collection" text DEFAULT NULL,
669
  PRIMARY KEY ("id"),
670
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual","code_in_individual"),
671
  /*CONSTRAINT "specimen_unique_by_collection_event" */UNIQUE ("collection_event"),
672
  /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"),
673
  /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"),
674
  /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true),
675
  /*KEY "fk_specimen_taxon_observation1_idx" ("collection_event")*/CHECK (true),
676
  /*KEY "fk_specimen_individual1_idx" ("individual")*/CHECK (true),
677
  /*KEY "fk_specimen_collection2_idx" ("current_collection")*/CHECK (true),
678
  /*KEY "fk_specimen_organization3_idx" ("owner_collection")*/CHECK (true),
679
  /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
680
  /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
681
  /*CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
682
  /*CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
683
  /*CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
684
  /*CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
685
) /*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'*/;
686
/*!40101 SET character_set_client = @saved_cs_client */;
687

    
688
--
689
-- Dumping data for table "specimen"
690
--
691

    
692
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
693
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
694

    
695
--
696
-- Table structure for table "specimen_observation"
697
--
698

    
699
/*!40101 SET @saved_cs_client     = @@character_set_client */;
700
/*!40101 SET character_set_client = utf8 */;
701
CREATE TABLE "specimen_observation" (
702
  "id" text NOT NULL,
703
  "specimen" text NOT NULL,
704
  "traits" hstore DEFAULT NULL,
705
  PRIMARY KEY ("id"),
706
  /*KEY "fk_specimen_observation_specimen1_idx" ("specimen")*/CHECK (true),
707
  /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
708
  /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
709
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
710
/*!40101 SET character_set_client = @saved_cs_client */;
711

    
712
--
713
-- Dumping data for table "specimen_observation"
714
--
715

    
716
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
717
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
718

    
719
--
720
-- Table structure for table "specimenholder_institution"
721
--
722

    
723
/*!40101 SET @saved_cs_client     = @@character_set_client */;
724
/*!40101 SET character_set_client = utf8 */;
725
CREATE TABLE "specimenholder_institution" (
726
  "specimen" text NOT NULL,
727
  "institution" text NOT NULL,
728
  "sort_order" integer DEFAULT NULL,
729
  PRIMARY KEY ("specimen","institution"),
730
  /*KEY "fk_specimen_has_organization_organization1_idx" ("institution")*/CHECK (true),
731
  /*KEY "fk_specimen_has_organization_specimen1_idx" ("specimen")*/CHECK (true),
732
  /*CONSTRAINT "fk_specimen_has_organization_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
733
  /*CONSTRAINT "fk_specimen_has_organization_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
734
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
735
/*!40101 SET character_set_client = @saved_cs_client */;
736

    
737
--
738
-- Dumping data for table "specimenholder_institution"
739
--
740

    
741
/*!40000 ALTER TABLE "specimenholder_institution" DISABLE KEYS */;
742
/*!40000 ALTER TABLE "specimenholder_institution" ENABLE KEYS */;
743

    
744
--
745
-- Table structure for table "stem"
746
--
747

    
748
/*!40101 SET @saved_cs_client     = @@character_set_client */;
749
/*!40101 SET character_set_client = utf8 */;
750
CREATE TABLE "stem" (
751
  "id" text NOT NULL,
752
  "individual" text NOT NULL,
753
  PRIMARY KEY ("id"),
754
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
755
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
756
  /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
757
) /*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)'*/;
758
/*!40101 SET character_set_client = @saved_cs_client */;
759

    
760
--
761
-- Dumping data for table "stem"
762
--
763

    
764
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
765
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
766

    
767
--
768
-- Table structure for table "stem_observation"
769
--
770

    
771
/*!40101 SET @saved_cs_client     = @@character_set_client */;
772
/*!40101 SET character_set_client = utf8 */;
773
CREATE TABLE "stem_observation" (
774
  "id" text NOT NULL,
775
  "individual_observation" text NOT NULL,
776
  "stem" text DEFAULT NULL,
777
  "traits" hstore DEFAULT NULL,
778
  PRIMARY KEY ("id"),
779
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","stem"),
780
  /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true),
781
  /*KEY "fk_stem_observation_stem1_idx" ("stem")*/CHECK (true),
782
  /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
783
  /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
784
  /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
785
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]'*/;
786
/*!40101 SET character_set_client = @saved_cs_client */;
787

    
788
--
789
-- Dumping data for table "stem_observation"
790
--
791

    
792
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
793
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
794

    
795
--
796
-- Table structure for table "stratum"
797
--
798

    
799
/*!40101 SET @saved_cs_client     = @@character_set_client */;
800
/*!40101 SET character_set_client = utf8 */;
801
CREATE TABLE "stratum" (
802
  "id" text NOT NULL,
803
  "name" text NOT NULL,
804
  "info" hstore DEFAULT NULL,
805
  PRIMARY KEY ("id"),
806
  /*CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
807
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
808
/*!40101 SET character_set_client = @saved_cs_client */;
809

    
810
--
811
-- Dumping data for table "stratum"
812
--
813

    
814
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
815
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
816

    
817
--
818
-- Table structure for table "subplot"
819
--
820

    
821
/*!40101 SET @saved_cs_client     = @@character_set_client */;
822
/*!40101 SET character_set_client = utf8 */;
823
CREATE TABLE "subplot" (
824
  "id" text NOT NULL,
825
  "x_m" double precision DEFAULT NULL,
826
  "y_m" double precision DEFAULT NULL,
827
  PRIMARY KEY ("id"),
828
  /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
829
) /*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)'*/;
830
/*!40101 SET character_set_client = @saved_cs_client */;
831

    
832
--
833
-- Dumping data for table "subplot"
834
--
835

    
836
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
837
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
838

    
839
--
840
-- Table structure for table "taxon_assertion"
841
--
842

    
843
/*!40101 SET @saved_cs_client     = @@character_set_client */;
844
/*!40101 SET character_set_client = utf8 */;
845
CREATE TABLE "taxon_assertion" (
846
  "id" text NOT NULL,
847
  "string" text NOT NULL /*COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name'*/,
848
  "taxon" text DEFAULT NULL,
849
  "cf_aff" text DEFAULT NULL,
850
  "annotations" hstore DEFAULT NULL,
851
  PRIMARY KEY ("id"),
852
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
853
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
854
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
855
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
856
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
857
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
858
/*!40101 SET character_set_client = @saved_cs_client */;
859

    
860
--
861
-- Dumping data for table "taxon_assertion"
862
--
863

    
864
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
865
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
866

    
867
--
868
-- Table structure for table "taxon_concept"
869
--
870

    
871
/*!40101 SET @saved_cs_client     = @@character_set_client */;
872
/*!40101 SET character_set_client = utf8 */;
873
CREATE TABLE "taxon_concept" (
874
  "id" text NOT NULL,
875
  "according_to" text NOT NULL,
876
  "parent" text NOT NULL,
877
  "accepted_taxon_concept" text DEFAULT NULL,
878
  PRIMARY KEY ("id"),
879
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
880
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
881
  /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true),
882
  /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true),
883
  /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
884
  /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
885
  /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
886
  /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
887
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]'*/;
888
/*!40101 SET character_set_client = @saved_cs_client */;
889

    
890
--
891
-- Dumping data for table "taxon_concept"
892
--
893

    
894
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
895
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
896

    
897
--
898
-- Table structure for table "taxon_determination"
899
--
900

    
901
/*!40101 SET @saved_cs_client     = @@character_set_client */;
902
/*!40101 SET character_set_client = utf8 */;
903
CREATE TABLE "taxon_determination" (
904
  "id" text NOT NULL,
905
  "taxon_assertion" text NOT NULL,
906
  "identified_by" text DEFAULT NULL,
907
  "fit_info" hstore DEFAULT NULL,
908
  PRIMARY KEY ("id"),
909
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
910
  /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true),
911
  /*KEY "fk_taxon_determination_party1_idx" ("identified_by")*/CHECK (true),
912
  /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
913
  /*CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
914
  /*CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
915
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/;
916
/*!40101 SET character_set_client = @saved_cs_client */;
917

    
918
--
919
-- Dumping data for table "taxon_determination"
920
--
921

    
922
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
923
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
924

    
925
--
926
-- Table structure for table "taxon_name"
927
--
928

    
929
/*!40101 SET @saved_cs_client     = @@character_set_client */;
930
/*!40101 SET character_set_client = utf8 */;
931
CREATE TABLE "taxon_name" (
932
  "id" text NOT NULL,
933
  "unique_name" text NOT NULL,
934
  "formal_name" text DEFAULT NULL,
935
  "taxon_name" text DEFAULT NULL,
936
  "author" text DEFAULT NULL,
937
  "common_name" text DEFAULT NULL,
938
  "rank" text DEFAULT NULL,
939
  PRIMARY KEY ("id"),
940
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
941
  /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
942
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
943
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
944
/*!40101 SET character_set_client = @saved_cs_client */;
945

    
946
--
947
-- Dumping data for table "taxon_name"
948
--
949

    
950
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
951
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
952

    
953
--
954
-- Table structure for table "taxon_observation"
955
--
956

    
957
/*!40101 SET @saved_cs_client     = @@character_set_client */;
958
/*!40101 SET character_set_client = utf8 */;
959
CREATE TABLE "taxon_observation" (
960
  "id" text NOT NULL,
961
  "taxon_occurrence" text NOT NULL,
962
  "collector" text DEFAULT NULL,
963
  "collector_number" text DEFAULT NULL,
964
  "voucher" text DEFAULT NULL,
965
  "growth_form" text DEFAULT NULL,
966
  "cultivated" integer DEFAULT NULL,
967
  "traits" hstore DEFAULT NULL,
968
  PRIMARY KEY ("id"),
969
  /*KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence")*/CHECK (true),
970
  /*KEY "fk_taxon_observation_specimen1_idx" ("voucher")*/CHECK (true),
971
  /*KEY "fk_taxon_observation_party1_idx" ("collector")*/CHECK (true),
972
  /*CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
973
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
974
  /*CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
975
  /*CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
976
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
977
/*!40101 SET character_set_client = @saved_cs_client */;
978

    
979
--
980
-- Dumping data for table "taxon_observation"
981
--
982

    
983
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
984
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
985

    
986
--
987
-- Table structure for table "taxon_occurrence"
988
--
989

    
990
/*!40101 SET @saved_cs_client     = @@character_set_client */;
991
/*!40101 SET character_set_client = utf8 */;
992
CREATE TABLE "taxon_occurrence" (
993
  "id" text NOT NULL,
994
  "current_determination" text DEFAULT NULL,
995
  "original_determination" text DEFAULT NULL,
996
  PRIMARY KEY ("id"),
997
  /*KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination")*/CHECK (true),
998
  /*KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination")*/CHECK (true),
999
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1000
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1001
  /*CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1002
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made'*/;
1003
/*!40101 SET character_set_client = @saved_cs_client */;
1004

    
1005
--
1006
-- Dumping data for table "taxon_occurrence"
1007
--
1008

    
1009
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
1010
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
1011

    
1012
--
1013
-- Table structure for table "taxon_path"
1014
--
1015

    
1016
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1017
/*!40101 SET character_set_client = utf8 */;
1018
CREATE TABLE "taxon_path" (
1019
  "id" text NOT NULL,
1020
  "family" text DEFAULT NULL,
1021
  "genus" text DEFAULT NULL,
1022
  "specific_epithet" text DEFAULT NULL,
1023
  "ranks" hstore DEFAULT NULL,
1024
  PRIMARY KEY ("id"),
1025
  /*CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1026
) /*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)'*/;
1027
/*!40101 SET character_set_client = @saved_cs_client */;
1028

    
1029
--
1030
-- Dumping data for table "taxon_path"
1031
--
1032

    
1033
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
1034
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
1035

    
1036
--
1037
-- Table structure for table "taxon_presence"
1038
--
1039

    
1040
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1041
/*!40101 SET character_set_client = utf8 */;
1042
CREATE TABLE "taxon_presence" (
1043
  "id" text NOT NULL,
1044
  "taxon_concept" text NOT NULL,
1045
  "traits" hstore DEFAULT NULL,
1046
  PRIMARY KEY ("id"),
1047
  /*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
1048
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1049
  /*CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1050
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_'*/;
1051
/*!40101 SET character_set_client = @saved_cs_client */;
1052

    
1053
--
1054
-- Dumping data for table "taxon_presence"
1055
--
1056

    
1057
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
1058
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
1059

    
1060
--
1061
-- Table structure for table "taxon_string"
1062
--
1063

    
1064
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1065
/*!40101 SET character_set_client = utf8 */;
1066
CREATE TABLE "taxon_string" (
1067
  "string" text NOT NULL,
1068
  PRIMARY KEY ("string")
1069
) /*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)'*/;
1070
/*!40101 SET character_set_client = @saved_cs_client */;
1071

    
1072
--
1073
-- Dumping data for table "taxon_string"
1074
--
1075

    
1076
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1077
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1078

    
1079
--
1080
-- Table structure for table "validatable_place"
1081
--
1082

    
1083
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1084
/*!40101 SET character_set_client = utf8 */;
1085
CREATE TABLE "validatable_place" (
1086
  "id" text NOT NULL,
1087
  "coordinates" text NOT NULL,
1088
  "path" text NOT NULL,
1089
  PRIMARY KEY ("id"),
1090
  /*CONSTRAINT "validatable_place_unique" */UNIQUE ("path","coordinates"),
1091
  /*KEY "fk_geovalidation_place_path1_idx" ("path")*/CHECK (true),
1092
  /*KEY "fk_geovalidation_coordinates1_idx" ("coordinates")*/CHECK (true),
1093
  /*CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1094
  /*CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1095
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1096
/*!40101 SET character_set_client = @saved_cs_client */;
1097

    
1098
--
1099
-- Dumping data for table "validatable_place"
1100
--
1101

    
1102
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
1103
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
1104
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1105

    
1106
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1107
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1108
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1109
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1110
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1111
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1112
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1113

    
1114
-- Dump completed
(9-9/14)