Project

General

Profile

1
SET standard_conforming_strings = off;
2
SET escape_string_warning = off;
3
-- MySQL dump 10.13  Distrib 5.5.32, for debian-linux-gnu (x86_64)
4
--
5
-- Host: localhost    Database: VegCore
6
-- ------------------------------------------------------
7
-- Server version	5.5.32-0ubuntu0.12.04.1
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
  "traits" hstore DEFAULT NULL,
29
  PRIMARY KEY ("id"),
30
  /*CONSTRAINT "fk_aggregate_observation_taxon_presence1" FOREIGN KEY ("id") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
31
) /*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)'*/;
32
/*!40101 SET character_set_client = @saved_cs_client */;
33

    
34
--
35
-- Dumping data for table "aggregate_observation"
36
--
37

    
38
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
39
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
40

    
41
--
42
-- Table structure for table "base_class"
43
--
44

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

    
56
--
57
-- Dumping data for table "base_class"
58
--
59

    
60
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
61
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
62

    
63
--
64
-- Table structure for table "collection"
65
--
66

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

    
82
--
83
-- Dumping data for table "collection"
84
--
85

    
86
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
87
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
88

    
89
--
90
-- Table structure for table "community"
91
--
92

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

    
104
--
105
-- Dumping data for table "community"
106
--
107

    
108
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
109
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
110

    
111
--
112
-- Table structure for table "derived_class"
113
--
114

    
115
/*!40101 SET @saved_cs_client     = @@character_set_client */;
116
/*!40101 SET character_set_client = utf8 */;
117
CREATE TABLE "derived_class" (
118
  "id" text NOT NULL,
119
  PRIMARY KEY ("id"),
120
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
121
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
122
/*!40101 SET character_set_client = @saved_cs_client */;
123

    
124
--
125
-- Dumping data for table "derived_class"
126
--
127

    
128
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
129
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
130

    
131
--
132
-- Table structure for table "event"
133
--
134

    
135
/*!40101 SET @saved_cs_client     = @@character_set_client */;
136
/*!40101 SET character_set_client = utf8 */;
137
CREATE TABLE "event" (
138
  "id" text NOT NULL,
139
  "parent" text NOT NULL,
140
  "name" text DEFAULT NULL,
141
  "date_range" text DEFAULT NULL,
142
  "place" text DEFAULT NULL,
143
  "participants" text DEFAULT NULL,
144
  PRIMARY KEY ("id"),
145
  /*KEY "fk_event_place1_idx" ("place")*/CHECK (true),
146
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
147
  /*KEY "fk_event_party_list1_idx" ("participants")*/CHECK (true),
148
  /*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
149
  /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
150
  /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
151
  /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
152
) /*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)'*/;
153
/*!40101 SET character_set_client = @saved_cs_client */;
154

    
155
--
156
-- Dumping data for table "event"
157
--
158

    
159
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
160
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
161

    
162
--
163
-- Table structure for table "geocoordinates"
164
--
165

    
166
/*!40101 SET @saved_cs_client     = @@character_set_client */;
167
/*!40101 SET character_set_client = utf8 */;
168
CREATE TABLE "geocoordinates" (
169
  "id" text NOT NULL,
170
  "latitude_deg" text DEFAULT NULL,
171
  "longitude_deg" text DEFAULT NULL,
172
  PRIMARY KEY ("id")
173
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point'*/;
174
/*!40101 SET character_set_client = @saved_cs_client */;
175

    
176
--
177
-- Dumping data for table "geocoordinates"
178
--
179

    
180
/*!40000 ALTER TABLE "geocoordinates" DISABLE KEYS */;
181
/*!40000 ALTER TABLE "geocoordinates" ENABLE KEYS */;
182

    
183
--
184
-- Table structure for table "geological_context"
185
--
186

    
187
/*!40101 SET @saved_cs_client     = @@character_set_client */;
188
/*!40101 SET character_set_client = utf8 */;
189
CREATE TABLE "geological_context" (
190
  "id" text NOT NULL,
191
  "name" text NOT NULL,
192
  "info" hstore DEFAULT NULL,
193
  PRIMARY KEY ("id"),
194
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
195
) /*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)'*/;
196
/*!40101 SET character_set_client = @saved_cs_client */;
197

    
198
--
199
-- Dumping data for table "geological_context"
200
--
201

    
202
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
203
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
204

    
205
--
206
-- Table structure for table "geopath"
207
--
208

    
209
/*!40101 SET @saved_cs_client     = @@character_set_client */;
210
/*!40101 SET character_set_client = utf8 */;
211
CREATE TABLE "geopath" (
212
  "id" text NOT NULL,
213
  "continent" text DEFAULT NULL,
214
  "country" text DEFAULT NULL,
215
  "state_province" text DEFAULT NULL,
216
  "county" text DEFAULT NULL,
217
  "municipality" text DEFAULT NULL,
218
  "ranks" hstore DEFAULT NULL,
219
  PRIMARY KEY ("id")
220
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region'*/;
221
/*!40101 SET character_set_client = @saved_cs_client */;
222

    
223
--
224
-- Dumping data for table "geopath"
225
--
226

    
227
/*!40000 ALTER TABLE "geopath" DISABLE KEYS */;
228
/*!40000 ALTER TABLE "geopath" ENABLE KEYS */;
229

    
230
--
231
-- Table structure for table "geoplace"
232
--
233

    
234
/*!40101 SET @saved_cs_client     = @@character_set_client */;
235
/*!40101 SET character_set_client = utf8 */;
236
CREATE TABLE "geoplace" (
237
  "id" text NOT NULL,
238
  "geocoordinates" text NOT NULL,
239
  "geopath" text NOT NULL,
240
  PRIMARY KEY ("id"),
241
  /*CONSTRAINT "validatable_place_unique" */UNIQUE ("geopath","geocoordinates"),
242
  /*KEY "fk_geovalidation_place_path1_idx" ("geopath")*/CHECK (true),
243
  /*KEY "fk_geovalidation_coordinates1_idx" ("geocoordinates")*/CHECK (true),
244
  /*CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("geopath") REFERENCES "geopath" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
245
  /*CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("geocoordinates") REFERENCES "geocoordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
246
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
247
/*!40101 SET character_set_client = @saved_cs_client */;
248

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

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

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

    
260
/*!40101 SET @saved_cs_client     = @@character_set_client */;
261
/*!40101 SET character_set_client = utf8 */;
262
CREATE TABLE "geovalidation" (
263
  "id" text NOT NULL,
264
  "geovalid" integer NOT NULL,
265
  "lat_long_domain_valid" integer NOT NULL,
266
  "lat_long_in_place_ranks" hstore DEFAULT NULL,
267
  PRIMARY KEY ("id"),
268
  /*CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
269
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]'*/;
270
/*!40101 SET character_set_client = @saved_cs_client */;
271

    
272
--
273
-- Dumping data for table "geovalidation"
274
--
275

    
276
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
277
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
278

    
279
--
280
-- Table structure for table "individual"
281
--
282

    
283
/*!40101 SET @saved_cs_client     = @@character_set_client */;
284
/*!40101 SET character_set_client = utf8 */;
285
CREATE TABLE "individual" (
286
  "id" text NOT NULL,
287
  "tag" text DEFAULT NULL,
288
  "tag_history" hstore DEFAULT NULL,
289
  PRIMARY KEY ("id"),
290
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
291
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism'*/;
292
/*!40101 SET character_set_client = @saved_cs_client */;
293

    
294
--
295
-- Dumping data for table "individual"
296
--
297

    
298
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
299
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
300

    
301
--
302
-- Table structure for table "individual_observation"
303
--
304

    
305
/*!40101 SET @saved_cs_client     = @@character_set_client */;
306
/*!40101 SET character_set_client = utf8 */;
307
CREATE TABLE "individual_observation" (
308
  "id" text NOT NULL,
309
  "individual" text DEFAULT NULL,
310
  "code" text DEFAULT NULL,
311
  "traits" hstore DEFAULT NULL,
312
  PRIMARY KEY ("id"),
313
  /*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true),
314
  /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
315
  /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
316
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]'*/;
317
/*!40101 SET character_set_client = @saved_cs_client */;
318

    
319
--
320
-- Dumping data for table "individual_observation"
321
--
322

    
323
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
324
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
325

    
326
--
327
-- Table structure for table "method"
328
--
329

    
330
/*!40101 SET @saved_cs_client     = @@character_set_client */;
331
/*!40101 SET character_set_client = utf8 */;
332
CREATE TABLE "method" (
333
  "id" text NOT NULL,
334
  "parent" text NOT NULL,
335
  "info" hstore DEFAULT NULL,
336
  PRIMARY KEY ("id"),
337
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
338
  /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
339
  /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
340
) /*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)'*/;
341
/*!40101 SET character_set_client = @saved_cs_client */;
342

    
343
--
344
-- Dumping data for table "method"
345
--
346

    
347
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
348
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
349

    
350
--
351
-- Table structure for table "organization"
352
--
353

    
354
/*!40101 SET @saved_cs_client     = @@character_set_client */;
355
/*!40101 SET character_set_client = utf8 */;
356
CREATE TABLE "organization" (
357
  "id" text NOT NULL,
358
  "info" hstore DEFAULT NULL,
359
  PRIMARY KEY ("id"),
360
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
361
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
362
/*!40101 SET character_set_client = @saved_cs_client */;
363

    
364
--
365
-- Dumping data for table "organization"
366
--
367

    
368
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
369
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
370

    
371
--
372
-- Table structure for table "party"
373
--
374

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

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

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

    
395
--
396
-- Table structure for table "party_list"
397
--
398

    
399
/*!40101 SET @saved_cs_client     = @@character_set_client */;
400
/*!40101 SET character_set_client = utf8 */;
401
CREATE TABLE "party_list" (
402
  "id" text NOT NULL,
403
  "count" integer NOT NULL,
404
  PRIMARY KEY ("id"),
405
  /*CONSTRAINT "fk_collection_source100" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
406
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
407
/*!40101 SET character_set_client = @saved_cs_client */;
408

    
409
--
410
-- Dumping data for table "party_list"
411
--
412

    
413
/*!40000 ALTER TABLE "party_list" DISABLE KEYS */;
414
/*!40000 ALTER TABLE "party_list" ENABLE KEYS */;
415

    
416
--
417
-- Table structure for table "party_list_entry"
418
--
419

    
420
/*!40101 SET @saved_cs_client     = @@character_set_client */;
421
/*!40101 SET character_set_client = utf8 */;
422
CREATE TABLE "party_list_entry" (
423
  "id" text NOT NULL,
424
  "entry" text NOT NULL,
425
  "sort_order" integer DEFAULT NULL,
426
  PRIMARY KEY ("id","entry"),
427
  /*KEY "fk_party_list_has_party_party1_idx" ("entry")*/CHECK (true),
428
  /*KEY "fk_party_list_has_party_party_list1_idx" ("id")*/CHECK (true),
429
  /*CONSTRAINT "fk_party_list_has_party_party_list1" FOREIGN KEY ("id") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
430
  /*CONSTRAINT "fk_party_list_has_party_party1" FOREIGN KEY ("entry") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
431
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
432
/*!40101 SET character_set_client = @saved_cs_client */;
433

    
434
--
435
-- Dumping data for table "party_list_entry"
436
--
437

    
438
/*!40000 ALTER TABLE "party_list_entry" DISABLE KEYS */;
439
/*!40000 ALTER TABLE "party_list_entry" ENABLE KEYS */;
440

    
441
--
442
-- Table structure for table "place"
443
--
444

    
445
/*!40101 SET @saved_cs_client     = @@character_set_client */;
446
/*!40101 SET character_set_client = utf8 */;
447
CREATE TABLE "place" (
448
  "id" text NOT NULL,
449
  "parent" text NOT NULL,
450
  "geocoordinates" text DEFAULT NULL,
451
  "geopath" text DEFAULT NULL,
452
  "locality" text DEFAULT NULL,
453
  PRIMARY KEY ("id"),
454
  /*KEY "fk_place_coordinates1_idx" ("geocoordinates")*/CHECK (true),
455
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
456
  /*KEY "fk_place_place_path1_idx" ("geopath")*/CHECK (true),
457
  /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
458
  /*CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("geocoordinates") REFERENCES "geocoordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
459
  /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
460
  /*CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("geopath") REFERENCES "geopath" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
461
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point'*/;
462
/*!40101 SET character_set_client = @saved_cs_client */;
463

    
464
--
465
-- Dumping data for table "place"
466
--
467

    
468
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
469
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
470

    
471
--
472
-- Table structure for table "place_observation"
473
--
474

    
475
/*!40101 SET @saved_cs_client     = @@character_set_client */;
476
/*!40101 SET character_set_client = utf8 */;
477
CREATE TABLE "place_observation" (
478
  "id" text NOT NULL,
479
  "place" text NOT NULL,
480
  "elevation_m" double precision DEFAULT NULL,
481
  "slope_incline_deg" double precision DEFAULT NULL,
482
  "slope_direction_deg_N" double precision DEFAULT NULL,
483
  "geological_context" text DEFAULT NULL,
484
  "community" text DEFAULT NULL,
485
  "observations" hstore DEFAULT NULL,
486
  PRIMARY KEY ("id"),
487
  /*KEY "fk_place_observation_place1_idx" ("place")*/CHECK (true),
488
  /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true),
489
  /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true),
490
  /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
491
  /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
492
  /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
493
  /*CONSTRAINT "fk_place_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
494
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]'*/;
495
/*!40101 SET character_set_client = @saved_cs_client */;
496

    
497
--
498
-- Dumping data for table "place_observation"
499
--
500

    
501
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
502
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
503

    
504
--
505
-- Table structure for table "plot"
506
--
507

    
508
/*!40101 SET @saved_cs_client     = @@character_set_client */;
509
/*!40101 SET character_set_client = utf8 */;
510
CREATE TABLE "plot" (
511
  "id" text NOT NULL,
512
  "name" text DEFAULT NULL,
513
  "area_m2" double precision DEFAULT NULL,
514
  "shape" text DEFAULT NULL,
515
  "bounding_box_rect" text DEFAULT NULL,
516
  "footprint_geom_WKT" text DEFAULT NULL,
517
  "dimensions" hstore DEFAULT NULL,
518
  PRIMARY KEY ("id"),
519
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
520
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
521
/*!40101 SET character_set_client = @saved_cs_client */;
522

    
523
--
524
-- Dumping data for table "plot"
525
--
526

    
527
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
528
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
529

    
530
--
531
-- Table structure for table "project"
532
--
533

    
534
/*!40101 SET @saved_cs_client     = @@character_set_client */;
535
/*!40101 SET character_set_client = utf8 */;
536
CREATE TABLE "project" (
537
  "id" text NOT NULL,
538
  "name" text NOT NULL,
539
  "info" hstore DEFAULT NULL,
540
  PRIMARY KEY ("id"),
541
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
542
) /*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)'*/;
543
/*!40101 SET character_set_client = @saved_cs_client */;
544

    
545
--
546
-- Dumping data for table "project"
547
--
548

    
549
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
550
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
551

    
552
--
553
-- Table structure for table "record"
554
--
555

    
556
/*!40101 SET @saved_cs_client     = @@character_set_client */;
557
/*!40101 SET character_set_client = utf8 */;
558
CREATE TABLE "record" (
559
  "id" text NOT NULL,
560
  "source" text NOT NULL,
561
  "source_id_scope" text DEFAULT NULL,
562
  "source_record_id" text DEFAULT NULL,
563
  "info" hstore DEFAULT NULL,
564
  PRIMARY KEY ("id"),
565
  /*CONSTRAINT "record_unique" */UNIQUE ("source","source_id_scope","source_record_id"),
566
  /*KEY "fk_record_source1_idx" ("source")*/CHECK (true),
567
  /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
568
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
569
/*!40101 SET character_set_client = @saved_cs_client */;
570

    
571
--
572
-- Dumping data for table "record"
573
--
574

    
575
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
576
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
577

    
578
--
579
-- Table structure for table "referenced_class"
580
--
581

    
582
/*!40101 SET @saved_cs_client     = @@character_set_client */;
583
/*!40101 SET character_set_client = utf8 */;
584
CREATE TABLE "referenced_class" (
585
  "id" text NOT NULL,
586
  PRIMARY KEY ("id"),
587
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
588
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
589
/*!40101 SET character_set_client = @saved_cs_client */;
590

    
591
--
592
-- Dumping data for table "referenced_class"
593
--
594

    
595
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
596
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
597

    
598
--
599
-- Table structure for table "relationship"
600
--
601

    
602
/*!40101 SET @saved_cs_client     = @@character_set_client */;
603
/*!40101 SET character_set_client = utf8 */;
604
CREATE TABLE "relationship" (
605
  "id" text NOT NULL,
606
  "record" text NOT NULL,
607
  "related_record" text NOT NULL,
608
  "info" hstore DEFAULT NULL,
609
  PRIMARY KEY ("id"),
610
  /*KEY "fk_relationship_record1_idx" ("record")*/CHECK (true),
611
  /*KEY "fk_relationship_related_record_idx" ("related_record")*/CHECK (true),
612
  /*CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
613
  /*CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
614
  /*CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
615
) /*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)'*/;
616
/*!40101 SET character_set_client = @saved_cs_client */;
617

    
618
--
619
-- Dumping data for table "relationship"
620
--
621

    
622
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
623
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
624

    
625
--
626
-- Table structure for table "sampling_event"
627
--
628

    
629
/*!40101 SET @saved_cs_client     = @@character_set_client */;
630
/*!40101 SET character_set_client = utf8 */;
631
CREATE TABLE "sampling_event" (
632
  "id" text NOT NULL,
633
  "method" text DEFAULT NULL,
634
  PRIMARY KEY ("id"),
635
  /*KEY "fk_sampling_event_method1_idx" ("method")*/CHECK (true),
636
  /*CONSTRAINT "fk_sampling_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
637
  /*CONSTRAINT "fk_project_event10" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
638
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
639
/*!40101 SET character_set_client = @saved_cs_client */;
640

    
641
--
642
-- Dumping data for table "sampling_event"
643
--
644

    
645
/*!40000 ALTER TABLE "sampling_event" DISABLE KEYS */;
646
/*!40000 ALTER TABLE "sampling_event" ENABLE KEYS */;
647

    
648
--
649
-- Table structure for table "soil_observation"
650
--
651

    
652
/*!40101 SET @saved_cs_client     = @@character_set_client */;
653
/*!40101 SET character_set_client = utf8 */;
654
CREATE TABLE "soil_observation" (
655
  "id" text NOT NULL,
656
  "observations" hstore DEFAULT NULL,
657
  PRIMARY KEY ("id"),
658
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
659
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil'*/;
660
/*!40101 SET character_set_client = @saved_cs_client */;
661

    
662
--
663
-- Dumping data for table "soil_observation"
664
--
665

    
666
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
667
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
668

    
669
--
670
-- Table structure for table "source"
671
--
672

    
673
/*!40101 SET @saved_cs_client     = @@character_set_client */;
674
/*!40101 SET character_set_client = utf8 */;
675
CREATE TABLE "source" (
676
  "id" text NOT NULL,
677
  "parent" text NOT NULL,
678
  "name" text NOT NULL,
679
  "first_publisher" text DEFAULT NULL,
680
  "owner" text DEFAULT NULL,
681
  "info" hstore DEFAULT NULL,
682
  PRIMARY KEY ("id"),
683
  /*CONSTRAINT "source_unique" */UNIQUE ("parent","name"),
684
  /*KEY "fk_source1_idx" ("parent")*/CHECK (true),
685
  /*KEY "fk_source_party1_idx" ("owner")*/CHECK (true),
686
  /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true),
687
  /*CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
688
  /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
689
  /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
690
) /*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)'*/;
691
/*!40101 SET character_set_client = @saved_cs_client */;
692

    
693
--
694
-- Dumping data for table "source"
695
--
696

    
697
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
698
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
699

    
700
--
701
-- Table structure for table "specimen"
702
--
703

    
704
/*!40101 SET @saved_cs_client     = @@character_set_client */;
705
/*!40101 SET character_set_client = utf8 */;
706
CREATE TABLE "specimen" (
707
  "id" text NOT NULL,
708
  "individual" text DEFAULT NULL,
709
  "code_in_individual" text DEFAULT NULL,
710
  "collection_event" text DEFAULT NULL,
711
  "orig_collection" text DEFAULT NULL,
712
  "barcode" text DEFAULT NULL,
713
  "accession_number" text DEFAULT NULL,
714
  "specimenholder_institutions" text DEFAULT NULL,
715
  "current_collection" text DEFAULT NULL,
716
  "owner_collection" text DEFAULT NULL,
717
  PRIMARY KEY ("id"),
718
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual","code_in_individual"),
719
  /*CONSTRAINT "specimen_unique_by_collection_event" */UNIQUE ("collection_event"),
720
  /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"),
721
  /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"),
722
  /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true),
723
  /*KEY "fk_specimen_taxon_observation1_idx" ("collection_event")*/CHECK (true),
724
  /*KEY "fk_specimen_individual1_idx" ("individual")*/CHECK (true),
725
  /*KEY "fk_specimen_collection2_idx" ("current_collection")*/CHECK (true),
726
  /*KEY "fk_specimen_organization3_idx" ("owner_collection")*/CHECK (true),
727
  /*KEY "fk_specimen_party_list1_idx" ("specimenholder_institutions")*/CHECK (true),
728
  /*CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
729
  /*CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
730
  /*CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
731
  /*CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
732
  /*CONSTRAINT "fk_specimen_party_list1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
733
  /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
734
  /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
735
) /*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'*/;
736
/*!40101 SET character_set_client = @saved_cs_client */;
737

    
738
--
739
-- Dumping data for table "specimen"
740
--
741

    
742
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
743
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
744

    
745
--
746
-- Table structure for table "specimen_observation"
747
--
748

    
749
/*!40101 SET @saved_cs_client     = @@character_set_client */;
750
/*!40101 SET character_set_client = utf8 */;
751
CREATE TABLE "specimen_observation" (
752
  "id" text NOT NULL,
753
  "specimen" text NOT NULL,
754
  "traits" hstore DEFAULT NULL,
755
  PRIMARY KEY ("id"),
756
  /*KEY "fk_specimen_observation_specimen1_idx" ("specimen")*/CHECK (true),
757
  /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
758
  /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
759
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
760
/*!40101 SET character_set_client = @saved_cs_client */;
761

    
762
--
763
-- Dumping data for table "specimen_observation"
764
--
765

    
766
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
767
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
768

    
769
--
770
-- Table structure for table "stem"
771
--
772

    
773
/*!40101 SET @saved_cs_client     = @@character_set_client */;
774
/*!40101 SET character_set_client = utf8 */;
775
CREATE TABLE "stem" (
776
  "id" text NOT NULL,
777
  "individual" text NOT NULL,
778
  PRIMARY KEY ("id"),
779
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
780
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
781
  /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
782
) /*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)'*/;
783
/*!40101 SET character_set_client = @saved_cs_client */;
784

    
785
--
786
-- Dumping data for table "stem"
787
--
788

    
789
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
790
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
791

    
792
--
793
-- Table structure for table "stem_observation"
794
--
795

    
796
/*!40101 SET @saved_cs_client     = @@character_set_client */;
797
/*!40101 SET character_set_client = utf8 */;
798
CREATE TABLE "stem_observation" (
799
  "id" text NOT NULL,
800
  "individual_observation" text NOT NULL,
801
  "stem" text DEFAULT NULL,
802
  "traits" hstore DEFAULT NULL,
803
  PRIMARY KEY ("id"),
804
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","stem"),
805
  /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true),
806
  /*KEY "fk_stem_observation_stem1_idx" ("stem")*/CHECK (true),
807
  /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
808
  /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
809
  /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
810
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]'*/;
811
/*!40101 SET character_set_client = @saved_cs_client */;
812

    
813
--
814
-- Dumping data for table "stem_observation"
815
--
816

    
817
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
818
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
819

    
820
--
821
-- Table structure for table "stratum"
822
--
823

    
824
/*!40101 SET @saved_cs_client     = @@character_set_client */;
825
/*!40101 SET character_set_client = utf8 */;
826
CREATE TABLE "stratum" (
827
  "id" text NOT NULL,
828
  "name" text NOT NULL,
829
  "info" hstore DEFAULT NULL,
830
  PRIMARY KEY ("id"),
831
  /*CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
832
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
833
/*!40101 SET character_set_client = @saved_cs_client */;
834

    
835
--
836
-- Dumping data for table "stratum"
837
--
838

    
839
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
840
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
841

    
842
--
843
-- Table structure for table "subplot"
844
--
845

    
846
/*!40101 SET @saved_cs_client     = @@character_set_client */;
847
/*!40101 SET character_set_client = utf8 */;
848
CREATE TABLE "subplot" (
849
  "id" text NOT NULL,
850
  "x_m" double precision DEFAULT NULL,
851
  "y_m" double precision DEFAULT NULL,
852
  "coordinates" hstore DEFAULT NULL,
853
  PRIMARY KEY ("id"),
854
  /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
855
) /*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)'*/;
856
/*!40101 SET character_set_client = @saved_cs_client */;
857

    
858
--
859
-- Dumping data for table "subplot"
860
--
861

    
862
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
863
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
864

    
865
--
866
-- Table structure for table "taxon_absence"
867
--
868

    
869
/*!40101 SET @saved_cs_client     = @@character_set_client */;
870
/*!40101 SET character_set_client = utf8 */;
871
CREATE TABLE "taxon_absence" (
872
  "id" text NOT NULL,
873
  "taxon_concept" text NOT NULL,
874
  PRIMARY KEY ("id"),
875
  /*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
876
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
877
  /*CONSTRAINT "fk_taxon_presence_taxon_name10" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
878
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place'*/;
879
/*!40101 SET character_set_client = @saved_cs_client */;
880

    
881
--
882
-- Dumping data for table "taxon_absence"
883
--
884

    
885
/*!40000 ALTER TABLE "taxon_absence" DISABLE KEYS */;
886
/*!40000 ALTER TABLE "taxon_absence" ENABLE KEYS */;
887

    
888
--
889
-- Table structure for table "taxon_assertion"
890
--
891

    
892
/*!40101 SET @saved_cs_client     = @@character_set_client */;
893
/*!40101 SET character_set_client = utf8 */;
894
CREATE TABLE "taxon_assertion" (
895
  "id" text NOT NULL,
896
  "string" text NOT NULL /*COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name'*/,
897
  "taxon" text DEFAULT NULL,
898
  "cf_aff" text DEFAULT NULL,
899
  "annotations" hstore DEFAULT NULL,
900
  PRIMARY KEY ("id"),
901
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
902
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
903
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
904
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
905
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
906
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
907
/*!40101 SET character_set_client = @saved_cs_client */;
908

    
909
--
910
-- Dumping data for table "taxon_assertion"
911
--
912

    
913
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
914
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
915

    
916
--
917
-- Table structure for table "taxon_concept"
918
--
919

    
920
/*!40101 SET @saved_cs_client     = @@character_set_client */;
921
/*!40101 SET character_set_client = utf8 */;
922
CREATE TABLE "taxon_concept" (
923
  "id" text NOT NULL,
924
  "according_to" text NOT NULL,
925
  "parent" text NOT NULL,
926
  "accepted_taxon_concept" text DEFAULT NULL,
927
  PRIMARY KEY ("id"),
928
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
929
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
930
  /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true),
931
  /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true),
932
  /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
933
  /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
934
  /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
935
  /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
936
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]'*/;
937
/*!40101 SET character_set_client = @saved_cs_client */;
938

    
939
--
940
-- Dumping data for table "taxon_concept"
941
--
942

    
943
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
944
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
945

    
946
--
947
-- Table structure for table "taxon_determination"
948
--
949

    
950
/*!40101 SET @saved_cs_client     = @@character_set_client */;
951
/*!40101 SET character_set_client = utf8 */;
952
CREATE TABLE "taxon_determination" (
953
  "id" text NOT NULL,
954
  "taxon_assertion" text NOT NULL,
955
  "identified_by" text DEFAULT NULL,
956
  "fit_info" hstore DEFAULT NULL,
957
  PRIMARY KEY ("id"),
958
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
959
  /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true),
960
  /*KEY "fk_taxon_determination_party_list1_idx" ("identified_by")*/CHECK (true),
961
  /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
962
  /*CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
963
  /*CONSTRAINT "fk_taxon_determination_party_list1" FOREIGN KEY ("identified_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
964
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/;
965
/*!40101 SET character_set_client = @saved_cs_client */;
966

    
967
--
968
-- Dumping data for table "taxon_determination"
969
--
970

    
971
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
972
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
973

    
974
--
975
-- Table structure for table "taxon_name"
976
--
977

    
978
/*!40101 SET @saved_cs_client     = @@character_set_client */;
979
/*!40101 SET character_set_client = utf8 */;
980
CREATE TABLE "taxon_name" (
981
  "id" text NOT NULL,
982
  "unique_name" text NOT NULL,
983
  "formal_name" text DEFAULT NULL,
984
  "taxon_name" text DEFAULT NULL,
985
  "author" text DEFAULT NULL,
986
  "common_name" text DEFAULT NULL,
987
  "rank" text DEFAULT NULL,
988
  PRIMARY KEY ("id"),
989
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
990
  /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
991
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
992
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
993
/*!40101 SET character_set_client = @saved_cs_client */;
994

    
995
--
996
-- Dumping data for table "taxon_name"
997
--
998

    
999
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
1000
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
1001

    
1002
--
1003
-- Table structure for table "taxon_observation"
1004
--
1005

    
1006
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1007
/*!40101 SET character_set_client = utf8 */;
1008
CREATE TABLE "taxon_observation" (
1009
  "id" text NOT NULL,
1010
  "taxon_occurrence" text NOT NULL,
1011
  "collectors" text DEFAULT NULL,
1012
  "collector_number" text DEFAULT NULL,
1013
  "voucher" text DEFAULT NULL,
1014
  "growth_form" text DEFAULT NULL,
1015
  "cultivated" integer DEFAULT NULL,
1016
  "traits" hstore DEFAULT NULL,
1017
  PRIMARY KEY ("id"),
1018
  /*KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence")*/CHECK (true),
1019
  /*KEY "fk_taxon_observation_specimen1_idx" ("voucher")*/CHECK (true),
1020
  /*KEY "fk_taxon_observation_party_list1_idx" ("collectors")*/CHECK (true),
1021
  /*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1022
  /*CONSTRAINT "fk_taxon_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1023
  /*CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1024
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1025
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1026
/*!40101 SET character_set_client = @saved_cs_client */;
1027

    
1028
--
1029
-- Dumping data for table "taxon_observation"
1030
--
1031

    
1032
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
1033
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
1034

    
1035
--
1036
-- Table structure for table "taxon_occurrence"
1037
--
1038

    
1039
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1040
/*!40101 SET character_set_client = utf8 */;
1041
CREATE TABLE "taxon_occurrence" (
1042
  "id" text NOT NULL,
1043
  "current_determination" text DEFAULT NULL,
1044
  "original_determination" text DEFAULT NULL,
1045
  PRIMARY KEY ("id"),
1046
  /*KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination")*/CHECK (true),
1047
  /*KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination")*/CHECK (true),
1048
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1049
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1050
  /*CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1051
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made'*/;
1052
/*!40101 SET character_set_client = @saved_cs_client */;
1053

    
1054
--
1055
-- Dumping data for table "taxon_occurrence"
1056
--
1057

    
1058
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
1059
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
1060

    
1061
--
1062
-- Table structure for table "taxon_path"
1063
--
1064

    
1065
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1066
/*!40101 SET character_set_client = utf8 */;
1067
CREATE TABLE "taxon_path" (
1068
  "id" text NOT NULL,
1069
  "family" text DEFAULT NULL,
1070
  "genus" text DEFAULT NULL,
1071
  "specific_epithet" text DEFAULT NULL,
1072
  "ranks" hstore DEFAULT NULL,
1073
  PRIMARY KEY ("id"),
1074
  /*CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1075
) /*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)'*/;
1076
/*!40101 SET character_set_client = @saved_cs_client */;
1077

    
1078
--
1079
-- Dumping data for table "taxon_path"
1080
--
1081

    
1082
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
1083
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
1084

    
1085
--
1086
-- Table structure for table "taxon_presence"
1087
--
1088

    
1089
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1090
/*!40101 SET character_set_client = utf8 */;
1091
CREATE TABLE "taxon_presence" (
1092
  "id" text NOT NULL,
1093
  "taxon_concept" text NOT NULL,
1094
  "traits" hstore DEFAULT NULL,
1095
  PRIMARY KEY ("id"),
1096
  /*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
1097
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1098
  /*CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1099
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of just a [[VegCore#Taxon|Taxon]]''s _presence_'*/;
1100
/*!40101 SET character_set_client = @saved_cs_client */;
1101

    
1102
--
1103
-- Dumping data for table "taxon_presence"
1104
--
1105

    
1106
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
1107
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
1108

    
1109
--
1110
-- Table structure for table "taxon_scrub"
1111
--
1112

    
1113
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1114
/*!40101 SET character_set_client = utf8 */;
1115
CREATE TABLE "taxon_scrub" (
1116
  "id" text NOT NULL,
1117
  "input_string" text NOT NULL,
1118
  "parsed_taxon_assertion" text NOT NULL,
1119
  "matched_taxon_concept" text DEFAULT NULL,
1120
  "match_score" float DEFAULT NULL,
1121
  "match_info" hstore DEFAULT NULL,
1122
  PRIMARY KEY ("id"),
1123
  /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true),
1124
  /*KEY "fk_taxon_scrub_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
1125
  /*KEY "fk_taxon_scrub_taxon_string1_idx" ("input_string")*/CHECK (true),
1126
  /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1127
  /*CONSTRAINT "fk_taxon_scrub_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1128
  /*CONSTRAINT "fk_taxon_scrub_taxon_string1" FOREIGN KEY ("input_string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1129
  /*CONSTRAINT "fk_taxon_scrub_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1130
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1131
/*!40101 SET character_set_client = @saved_cs_client */;
1132

    
1133
--
1134
-- Dumping data for table "taxon_scrub"
1135
--
1136

    
1137
/*!40000 ALTER TABLE "taxon_scrub" DISABLE KEYS */;
1138
/*!40000 ALTER TABLE "taxon_scrub" ENABLE KEYS */;
1139

    
1140
--
1141
-- Table structure for table "taxon_string"
1142
--
1143

    
1144
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1145
/*!40101 SET character_set_client = utf8 */;
1146
CREATE TABLE "taxon_string" (
1147
  "string" text NOT NULL,
1148
  PRIMARY KEY ("string")
1149
) /*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)'*/;
1150
/*!40101 SET character_set_client = @saved_cs_client */;
1151

    
1152
--
1153
-- Dumping data for table "taxon_string"
1154
--
1155

    
1156
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1157
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1158
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1159

    
1160
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1161
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1162
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1163
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1164
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1165
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1166
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1167

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