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
-- Current Database: "VegCore"
22
--
23

    
24
CREATE DATABASE /*!32312 IF NOT EXISTS*/ "VegCore" /*!40100 DEFAULT */;
25

    
26
USE "VegCore";
27

    
28
--
29
-- Table structure for table "aggregate_observation"
30
--
31

    
32
/*!40101 SET @saved_cs_client     = @@character_set_client */;
33
/*!40101 SET character_set_client = utf8 */;
34
CREATE TABLE "aggregate_observation" (
35
  "id" text NOT NULL,
36
  "occurrence_status" text DEFAULT NULL,
37
  PRIMARY KEY ("id"),
38
  /*CONSTRAINT "fk_taxon_presence_taxon_determination10" FOREIGN KEY ("id") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
39
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
40
/*!40101 SET character_set_client = @saved_cs_client */;
41

    
42
--
43
-- Dumping data for table "aggregate_observation"
44
--
45

    
46
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
47
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
48

    
49
--
50
-- Table structure for table "base_class"
51
--
52

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

    
64
--
65
-- Dumping data for table "base_class"
66
--
67

    
68
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
69
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
70

    
71
--
72
-- Table structure for table "collection"
73
--
74

    
75
/*!40101 SET @saved_cs_client     = @@character_set_client */;
76
/*!40101 SET character_set_client = utf8 */;
77
CREATE TABLE "collection" (
78
  "id" text NOT NULL,
79
  "institution" text NOT NULL,
80
  "name" text NOT NULL,
81
  PRIMARY KEY ("id"),
82
  /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
83
  /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
84
  /*KEY "fk_collection_source1_idx" ("id")*/CHECK (true),
85
  /*CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
86
  /*CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
87
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"the collection within the institution where a specimen is held" ("Brad Boyle":https://projects.nceas.ucsb.edu/nceas/attachments/download/621/vegbien_identifier_examples.xlsx#terms/collectionCode)'*/;
88
/*!40101 SET character_set_client = @saved_cs_client */;
89

    
90
--
91
-- Dumping data for table "collection"
92
--
93

    
94
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
95
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
96

    
97
--
98
-- Table structure for table "community"
99
--
100

    
101
/*!40101 SET @saved_cs_client     = @@character_set_client */;
102
/*!40101 SET character_set_client = utf8 */;
103
CREATE TABLE "community" (
104
  "id" text NOT NULL,
105
  "name" text NOT NULL,
106
  "info" hstore DEFAULT NULL,
107
  PRIMARY KEY ("id"),
108
  /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
109
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A community type is an abstract grouping of organisms that tend to co-occur on the landscape due to shared ecological requirements or preferences. May be designated by syntaxon or physiognomic types." ([[VegCore#VegX|VegX]])'*/;
110
/*!40101 SET character_set_client = @saved_cs_client */;
111

    
112
--
113
-- Dumping data for table "community"
114
--
115

    
116
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
117
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
118

    
119
--
120
-- Table structure for table "data_owner"
121
--
122

    
123
/*!40101 SET @saved_cs_client     = @@character_set_client */;
124
/*!40101 SET character_set_client = utf8 */;
125
CREATE TABLE "data_owner" (
126
  "id" text NOT NULL,
127
  "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc.'*/,
128
  PRIMARY KEY ("id"),
129
  /*CONSTRAINT "fk_party_list_entry_record10" FOREIGN KEY ("id") REFERENCES "party_list_entry" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
130
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
131
/*!40101 SET character_set_client = @saved_cs_client */;
132

    
133
--
134
-- Dumping data for table "data_owner"
135
--
136

    
137
/*!40000 ALTER TABLE "data_owner" DISABLE KEYS */;
138
/*!40000 ALTER TABLE "data_owner" ENABLE KEYS */;
139

    
140
--
141
-- Table structure for table "dataset"
142
--
143

    
144
/*!40101 SET @saved_cs_client     = @@character_set_client */;
145
/*!40101 SET character_set_client = utf8 */;
146
CREATE TABLE "dataset" (
147
  "id" text NOT NULL,
148
  "name" text NOT NULL,
149
  "contacts" text NOT NULL /*COMMENT 'contact person(s) to ask about attribution questions. there should always be at least one contact person. if unknown, the person loading the data should set this to themselves.'*/,
150
  "parent" text DEFAULT NULL /*COMMENT 'this provides a containment relationship, which differs from the attribution relationship provided by dataset_source. e.g. the GBIF.ARIZ dataset is contained within a specific GBIF *dataset* (the parent), but was obtained from the GBIF *organization* (the dataset_source). ARIZ is then the first_publisher.'*/,
151
  "dataset_source" text DEFAULT NULL /*COMMENT 'where the data in the dataset came from (as opposed to where the metadata *about* the dataset came from, which is in source, inherited from traceable); = Brad.vegpath.org?attribution.proximate_data_provider'*/,
152
  "first_publisher" text DEFAULT NULL /*COMMENT '= Brad.vegpath.org?attribution.data_publisher, Brad.vegpath.org?data_provenance.primarydataprovider'*/,
153
  "data_owners" text DEFAULT NULL /*COMMENT 'parties who must be given attribution, such as copyrightholders. this includes all aggregators through which the data has passed. = Brad.vegpath.org?attribution.data_indexer'*/,
154
  "access_rights" text DEFAULT NULL /*COMMENT 'e.g. public, private, by request, metadata only'*/,
155
  "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc. this is the combination of all the use_conditions of the data_owners.'*/,
156
  PRIMARY KEY ("id"),
157
  /*CONSTRAINT "dataset_unique" */UNIQUE ("parent","name"),
158
  /*KEY "fk_source_party_list1_idx" ("data_owners")*/CHECK (true),
159
  /*KEY "fk_source_party1_idx" ("contacts")*/CHECK (true),
160
  /*KEY "fk_dataset_dataset1_idx" ("parent")*/CHECK (true),
161
  /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true),
162
  /*KEY "dataset_dataset_source_fkey1_idx" ("dataset_source")*/CHECK (true),
163
  /*CONSTRAINT "dataset_dataset_source_fkey1" FOREIGN KEY ("dataset_source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
164
  /*CONSTRAINT "fk_dataset_dataset1" FOREIGN KEY ("parent") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
165
  /*CONSTRAINT "fk_dataset_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
166
  /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("contacts") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
167
  /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
168
  /*CONSTRAINT "fk_source_party_list1" FOREIGN KEY ("data_owners") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
169
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a collection of records from the same place, with the same attribution requirements'*/;
170
/*!40101 SET character_set_client = @saved_cs_client */;
171

    
172
--
173
-- Dumping data for table "dataset"
174
--
175

    
176
/*!40000 ALTER TABLE "dataset" DISABLE KEYS */;
177
/*!40000 ALTER TABLE "dataset" ENABLE KEYS */;
178

    
179
--
180
-- Table structure for table "derived_class"
181
--
182

    
183
/*!40101 SET @saved_cs_client     = @@character_set_client */;
184
/*!40101 SET character_set_client = utf8 */;
185
CREATE TABLE "derived_class" (
186
  "id" text NOT NULL,
187
  PRIMARY KEY ("id"),
188
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
189
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
190
/*!40101 SET character_set_client = @saved_cs_client */;
191

    
192
--
193
-- Dumping data for table "derived_class"
194
--
195

    
196
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
197
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
198

    
199
--
200
-- Table structure for table "event"
201
--
202

    
203
/*!40101 SET @saved_cs_client     = @@character_set_client */;
204
/*!40101 SET character_set_client = utf8 */;
205
CREATE TABLE "event" (
206
  "id" text NOT NULL,
207
  "parent" text DEFAULT NULL,
208
  "subject" text DEFAULT NULL /*COMMENT 'what was observed'*/,
209
  "name" text DEFAULT NULL,
210
  "date_range" text DEFAULT NULL,
211
  "participants" text DEFAULT NULL,
212
  PRIMARY KEY ("id"),
213
  /*CONSTRAINT "event_unique_within_parent_by_name" */UNIQUE ("parent","name"),
214
  /*CONSTRAINT "event_unique_within_subject_by_date" */UNIQUE ("subject","date_range","participants"),
215
  /*CONSTRAINT "event_unique_within_parent_by_subject" */UNIQUE ("parent","subject"),
216
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
217
  /*KEY "fk_event_party_list1_idx" ("participants")*/CHECK (true),
218
  /*KEY "fk_event_place1_idx" ("subject")*/CHECK (true),
219
  /*KEY "event_unique_within_subject_by_name" ("subject","name")*/CHECK (true),
220
  /*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
221
  /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
222
  /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("subject") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
223
  /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
224
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"an action that occurs at a place and during a period of text/*time*/" ("DwC":http://rs.tdwg.org/dwc/terms/#Event)'*/;
225
/*!40101 SET character_set_client = @saved_cs_client */;
226

    
227
--
228
-- Dumping data for table "event"
229
--
230

    
231
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
232
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
233

    
234
--
235
-- Table structure for table "geological_context"
236
--
237

    
238
/*!40101 SET @saved_cs_client     = @@character_set_client */;
239
/*!40101 SET character_set_client = utf8 */;
240
CREATE TABLE "geological_context" (
241
  "id" text NOT NULL,
242
  "name" text NOT NULL,
243
  "info" hstore DEFAULT NULL,
244
  PRIMARY KEY ("id"),
245
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
246
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"information pertaining to a location within a geological context, such as stratigraphy" ("DwC":http://rs.tdwg.org/dwc/terms/#GeologicalContext)'*/;
247
/*!40101 SET character_set_client = @saved_cs_client */;
248

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

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

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

    
260
/*!40101 SET @saved_cs_client     = @@character_set_client */;
261
/*!40101 SET character_set_client = utf8 */;
262
CREATE TABLE "geopath" (
263
  "id" text NOT NULL,
264
  "continent" text DEFAULT NULL,
265
  "country" text DEFAULT NULL,
266
  "state_province" text DEFAULT NULL,
267
  "county" text DEFAULT NULL,
268
  "municipality" text DEFAULT NULL,
269
  "ranks" hstore DEFAULT NULL,
270
  PRIMARY KEY ("id")
271
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region'*/;
272
/*!40101 SET character_set_client = @saved_cs_client */;
273

    
274
--
275
-- Dumping data for table "geopath"
276
--
277

    
278
/*!40000 ALTER TABLE "geopath" DISABLE KEYS */;
279
/*!40000 ALTER TABLE "geopath" ENABLE KEYS */;
280

    
281
--
282
-- Table structure for table "geoplace"
283
--
284

    
285
/*!40101 SET @saved_cs_client     = @@character_set_client */;
286
/*!40101 SET character_set_client = utf8 */;
287
CREATE TABLE "geoplace" (
288
  "id" text NOT NULL,
289
  "latitude_deg" text NOT NULL,
290
  "longitude_deg" text NOT NULL,
291
  "boundary_WKT" text NOT NULL DEFAULT 'point',
292
  "official_name" text DEFAULT NULL,
293
  PRIMARY KEY ("id"),
294
  /*CONSTRAINT "fk_geoplace_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
295
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point'*/;
296
/*!40101 SET character_set_client = @saved_cs_client */;
297

    
298
--
299
-- Dumping data for table "geoplace"
300
--
301

    
302
/*!40000 ALTER TABLE "geoplace" DISABLE KEYS */;
303
/*!40000 ALTER TABLE "geoplace" ENABLE KEYS */;
304

    
305
--
306
-- Table structure for table "georeferencing"
307
--
308

    
309
/*!40101 SET @saved_cs_client     = @@character_set_client */;
310
/*!40101 SET character_set_client = utf8 */;
311
CREATE TABLE "georeferencing" (
312
  "id" text NOT NULL,
313
  "input_place" text NOT NULL,
314
  "geoplace" text DEFAULT NULL,
315
  "georeferenced_by" text DEFAULT NULL,
316
  "info" hstore DEFAULT NULL,
317
  PRIMARY KEY ("id"),
318
  /*KEY "fk_georef_place1_idx" ("input_place")*/CHECK (true),
319
  /*KEY "fk_georeferencing_party_list1_idx" ("georeferenced_by")*/CHECK (true),
320
  /*KEY "fk_georeferencing_geoplace1_idx" ("geoplace")*/CHECK (true),
321
  /*CONSTRAINT "fk_georeferencing_geoplace1" FOREIGN KEY ("geoplace") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
322
  /*CONSTRAINT "fk_georeferencing_party_list1" FOREIGN KEY ("georeferenced_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
323
  /*CONSTRAINT "fk_georef_place1" FOREIGN KEY ("input_place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
324
  /*CONSTRAINT "fk_geovalidation_record100" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
325
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='also stored GNRS results'*/;
326
/*!40101 SET character_set_client = @saved_cs_client */;
327

    
328
--
329
-- Dumping data for table "georeferencing"
330
--
331

    
332
/*!40000 ALTER TABLE "georeferencing" DISABLE KEYS */;
333
/*!40000 ALTER TABLE "georeferencing" ENABLE KEYS */;
334

    
335
--
336
-- Table structure for table "geovalidatable_place"
337
--
338

    
339
/*!40101 SET @saved_cs_client     = @@character_set_client */;
340
/*!40101 SET character_set_client = utf8 */;
341
CREATE TABLE "geovalidatable_place" (
342
  "id" text NOT NULL,
343
  "parent" text NOT NULL /*COMMENT 'the parent geoplace'*/,
344
  PRIMARY KEY ("id"),
345
  /*KEY "fk_geovalidatable_place_geoplace1_idx" ("parent")*/CHECK (true),
346
  /*CONSTRAINT "fk_nested_geoplace_geoplace1" FOREIGN KEY ("id") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
347
  /*CONSTRAINT "fk_geovalidatable_place_geoplace1" FOREIGN KEY ("parent") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
348
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores only scrubbed geoplaces (GADM places, and distinct point coordinates that GNRS says should be located within them)'*/;
349
/*!40101 SET character_set_client = @saved_cs_client */;
350

    
351
--
352
-- Dumping data for table "geovalidatable_place"
353
--
354

    
355
/*!40000 ALTER TABLE "geovalidatable_place" DISABLE KEYS */;
356
/*!40000 ALTER TABLE "geovalidatable_place" ENABLE KEYS */;
357

    
358
--
359
-- Table structure for table "geovalidation"
360
--
361

    
362
/*!40101 SET @saved_cs_client     = @@character_set_client */;
363
/*!40101 SET character_set_client = utf8 */;
364
CREATE TABLE "geovalidation" (
365
  "id" text NOT NULL,
366
  "input_geoplace" text NOT NULL,
367
  "geovalid" integer NOT NULL,
368
  "lat_long_domain_valid" integer NOT NULL,
369
  "lat_long_in_place_ranks" hstore DEFAULT NULL,
370
  "corrected_geoplace" text DEFAULT NULL,
371
  PRIMARY KEY ("id"),
372
  /*KEY "fk_geovalidation_geoplace1_idx" ("input_geoplace")*/CHECK (true),
373
  /*KEY "fk_geovalidation_geoplace2_idx" ("corrected_geoplace")*/CHECK (true),
374
  /*CONSTRAINT "fk_geovalidation_geoplace1" FOREIGN KEY ("input_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
375
  /*CONSTRAINT "fk_geovalidation_geoplace2" FOREIGN KEY ("corrected_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
376
  /*CONSTRAINT "fk_geovalidation_georeferencing1" FOREIGN KEY ("id") REFERENCES "georeferencing" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
377
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]'*/;
378
/*!40101 SET character_set_client = @saved_cs_client */;
379

    
380
--
381
-- Dumping data for table "geovalidation"
382
--
383

    
384
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
385
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
386

    
387
--
388
-- Table structure for table "individual"
389
--
390

    
391
/*!40101 SET @saved_cs_client     = @@character_set_client */;
392
/*!40101 SET character_set_client = utf8 */;
393
CREATE TABLE "individual" (
394
  "id" text NOT NULL,
395
  "identifying_place" text DEFAULT NULL /*COMMENT 'subplace within plot. not specified for specimens since their coordinates are usually not precise enough to identify an individual.'*/,
396
  "tag" text DEFAULT NULL,
397
  "tag_history" hstore DEFAULT NULL,
398
  PRIMARY KEY ("id"),
399
  /*KEY "fk_individual_subplace1_idx" ("identifying_place")*/CHECK (true),
400
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
401
  /*CONSTRAINT "fk_individual_subplace1" FOREIGN KEY ("identifying_place") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
402
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism'*/;
403
/*!40101 SET character_set_client = @saved_cs_client */;
404

    
405
--
406
-- Dumping data for table "individual"
407
--
408

    
409
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
410
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
411

    
412
--
413
-- Table structure for table "individual_count"
414
--
415

    
416
/*!40101 SET @saved_cs_client     = @@character_set_client */;
417
/*!40101 SET character_set_client = utf8 */;
418
CREATE TABLE "individual_count" (
419
  "id" text NOT NULL,
420
  "parent" text NOT NULL /*COMMENT 'the taxon_presence for the taxon as a whole (not subdivided by size_class, etc.)'*/,
421
  "size_class" text DEFAULT NULL,
422
  "aggregating_traits" hstore DEFAULT NULL,
423
  "count" integer DEFAULT NULL,
424
  PRIMARY KEY ("id"),
425
  /*KEY "fk_aggregate_observation_taxon_presence1_idx" ("parent")*/CHECK (true),
426
  /*KEY "fk_aggregate_observation_size_class1_idx" ("size_class")*/CHECK (true),
427
  /*CONSTRAINT "fk_aggregate_observation_size_class1" FOREIGN KEY ("size_class") REFERENCES "size_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
428
  /*CONSTRAINT "fk_aggregate_observation_taxon_presence1" FOREIGN KEY ("parent") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
429
  /*CONSTRAINT "fk_individual_count_taxon_presence1" FOREIGN KEY ("id") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
430
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stemCount'*/;
431
/*!40101 SET character_set_client = @saved_cs_client */;
432

    
433
--
434
-- Dumping data for table "individual_count"
435
--
436

    
437
/*!40000 ALTER TABLE "individual_count" DISABLE KEYS */;
438
/*!40000 ALTER TABLE "individual_count" ENABLE KEYS */;
439

    
440
--
441
-- Table structure for table "individual_observation"
442
--
443

    
444
/*!40101 SET @saved_cs_client     = @@character_set_client */;
445
/*!40101 SET character_set_client = utf8 */;
446
CREATE TABLE "individual_observation" (
447
  "id" text NOT NULL,
448
  "subject" text DEFAULT NULL /*COMMENT 'optional because an individual_observation cannot have an associated individual unless the individual is traceable to a specific plant'*/,
449
  "specimenholder_institutions" text DEFAULT NULL /*COMMENT 'institutions which store specimens from this plant. when provided, the taxon_occurrence should have an autogenerated current_observation that merges together all the individual_observations for these institutions'' specimens.'*/,
450
  PRIMARY KEY ("id"),
451
  /*KEY "fk_individual_observation_individual1_idx" ("subject")*/CHECK (true),
452
  /*KEY "individual_observation_id_fkey1_idx" ("specimenholder_institutions")*/CHECK (true),
453
  /*CONSTRAINT "individual_observation_id_fkey1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
454
  /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("subject") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
455
  /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
456
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]; inherited fields: place: contains the place the individual was observed at'*/;
457
/*!40101 SET character_set_client = @saved_cs_client */;
458

    
459
--
460
-- Dumping data for table "individual_observation"
461
--
462

    
463
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
464
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
465

    
466
--
467
-- Table structure for table "method"
468
--
469

    
470
/*!40101 SET @saved_cs_client     = @@character_set_client */;
471
/*!40101 SET character_set_client = utf8 */;
472
CREATE TABLE "method" (
473
  "id" text NOT NULL,
474
  "name" text DEFAULT NULL,
475
  "parent" text DEFAULT NULL,
476
  "info" hstore DEFAULT NULL,
477
  PRIMARY KEY ("id"),
478
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
479
  /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
480
  /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
481
) /*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)'*/;
482
/*!40101 SET character_set_client = @saved_cs_client */;
483

    
484
--
485
-- Dumping data for table "method"
486
--
487

    
488
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
489
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
490

    
491
--
492
-- Table structure for table "organization"
493
--
494

    
495
/*!40101 SET @saved_cs_client     = @@character_set_client */;
496
/*!40101 SET character_set_client = utf8 */;
497
CREATE TABLE "organization" (
498
  "id" text NOT NULL,
499
  "name" text NOT NULL,
500
  "parent" text DEFAULT NULL,
501
  PRIMARY KEY ("id"),
502
  /*CONSTRAINT "organization_unique" */UNIQUE ("parent","name"),
503
  /*KEY "fk_organization_organization1_idx" ("parent")*/CHECK (true),
504
  /*CONSTRAINT "fk_organization_organization1" FOREIGN KEY ("parent") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
505
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
506
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
507
/*!40101 SET character_set_client = @saved_cs_client */;
508

    
509
--
510
-- Dumping data for table "organization"
511
--
512

    
513
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
514
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
515

    
516
--
517
-- Table structure for table "party"
518
--
519

    
520
/*!40101 SET @saved_cs_client     = @@character_set_client */;
521
/*!40101 SET character_set_client = utf8 */;
522
CREATE TABLE "party" (
523
  "id" text NOT NULL,
524
  PRIMARY KEY ("id"),
525
  /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
526
  /*CONSTRAINT "fk_party_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
527
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
528
/*!40101 SET character_set_client = @saved_cs_client */;
529

    
530
--
531
-- Dumping data for table "party"
532
--
533

    
534
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
535
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
536

    
537
--
538
-- Table structure for table "party_list"
539
--
540

    
541
/*!40101 SET @saved_cs_client     = @@character_set_client */;
542
/*!40101 SET character_set_client = utf8 */;
543
CREATE TABLE "party_list" (
544
  "id" text NOT NULL,
545
  "count" integer NOT NULL,
546
  "array" text[] DEFAULT NULL /*COMMENT 'an array combining all the list entries. if specified, a trigger will autogenerate party_list_entries from this field. if not specified, will be autopopulated whenever a party_list_entry is added.'*/,
547
  PRIMARY KEY ("id"),
548
  /*CONSTRAINT "fk_collection_source100" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
549
  /*CONSTRAINT "party_list_id_fkey1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
550
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
551
/*!40101 SET character_set_client = @saved_cs_client */;
552

    
553
--
554
-- Dumping data for table "party_list"
555
--
556

    
557
/*!40000 ALTER TABLE "party_list" DISABLE KEYS */;
558
/*!40000 ALTER TABLE "party_list" ENABLE KEYS */;
559

    
560
--
561
-- Table structure for table "party_list_entry"
562
--
563

    
564
/*!40101 SET @saved_cs_client     = @@character_set_client */;
565
/*!40101 SET character_set_client = utf8 */;
566
CREATE TABLE "party_list_entry" (
567
  "id" text NOT NULL,
568
  "list" text NOT NULL,
569
  "party" text NOT NULL,
570
  "role" text DEFAULT NULL,
571
  "sort_order" integer DEFAULT NULL,
572
  PRIMARY KEY ("id"),
573
  /*KEY "fk_party_list_has_party_party1_idx" ("party")*/CHECK (true),
574
  /*KEY "fk_party_list_entry_party_list1_idx" ("list")*/CHECK (true),
575
  /*CONSTRAINT "fk_party_list_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
576
  /*CONSTRAINT "fk_party_list_entry_party_list1" FOREIGN KEY ("list") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
577
  /*CONSTRAINT "fk_party_list_entry_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
578
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
579
/*!40101 SET character_set_client = @saved_cs_client */;
580

    
581
--
582
-- Dumping data for table "party_list_entry"
583
--
584

    
585
/*!40000 ALTER TABLE "party_list_entry" DISABLE KEYS */;
586
/*!40000 ALTER TABLE "party_list_entry" ENABLE KEYS */;
587

    
588
--
589
-- Table structure for table "person"
590
--
591

    
592
/*!40101 SET @saved_cs_client     = @@character_set_client */;
593
/*!40101 SET character_set_client = utf8 */;
594
CREATE TABLE "person" (
595
  "id" text NOT NULL,
596
  "name" text NOT NULL,
597
  "organization" text DEFAULT NULL,
598
  PRIMARY KEY ("id"),
599
  /*CONSTRAINT "person_unique" */UNIQUE ("organization","name"),
600
  /*KEY "fk_person_organization1_idx" ("organization")*/CHECK (true),
601
  /*CONSTRAINT "fk_person_organization1" FOREIGN KEY ("organization") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
602
  /*CONSTRAINT "fk_organization_party10" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
603
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
604
/*!40101 SET character_set_client = @saved_cs_client */;
605

    
606
--
607
-- Dumping data for table "person"
608
--
609

    
610
/*!40000 ALTER TABLE "person" DISABLE KEYS */;
611
/*!40000 ALTER TABLE "person" ENABLE KEYS */;
612

    
613
--
614
-- Table structure for table "place"
615
--
616

    
617
/*!40101 SET @saved_cs_client     = @@character_set_client */;
618
/*!40101 SET character_set_client = utf8 */;
619
CREATE TABLE "place" (
620
  "id" text NOT NULL,
621
  "parent" text DEFAULT NULL,
622
  "rank" text DEFAULT NULL,
623
  "name" text DEFAULT NULL,
624
  "geopath" text DEFAULT NULL,
625
  "locality" text DEFAULT NULL,
626
  "verbatim" hstore DEFAULT NULL /*COMMENT 'for verbatim coordinates, etc.'*/,
627
  PRIMARY KEY ("id"),
628
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
629
  /*KEY "fk_place_geopath1_idx" ("geopath")*/CHECK (true),
630
  /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
631
  /*CONSTRAINT "fk_place_geopath1" FOREIGN KEY ("geopath") REFERENCES "geopath" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
632
  /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
633
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point'*/;
634
/*!40101 SET character_set_client = @saved_cs_client */;
635

    
636
--
637
-- Dumping data for table "place"
638
--
639

    
640
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
641
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
642

    
643
--
644
-- Table structure for table "place_visit"
645
--
646

    
647
/*!40101 SET @saved_cs_client     = @@character_set_client */;
648
/*!40101 SET character_set_client = utf8 */;
649
CREATE TABLE "place_visit" (
650
  "id" text NOT NULL,
651
  "parent" text DEFAULT NULL /*COMMENT 'the concurrent observation of the parent place'*/,
652
  "subject" text NOT NULL,
653
  "project" text DEFAULT NULL,
654
  "elevation_m" double precision DEFAULT NULL,
655
  "slope_incline_deg" double precision DEFAULT NULL,
656
  "slope_direction_deg_N" double precision DEFAULT NULL,
657
  "geological_context" text DEFAULT NULL,
658
  "community" text DEFAULT NULL,
659
  "observations" hstore DEFAULT NULL,
660
  PRIMARY KEY ("id"),
661
  /*KEY "fk_place_observation_place1_idx" ("subject")*/CHECK (true),
662
  /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true),
663
  /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true),
664
  /*KEY "place_observation_id_fkey1_idx" ("project")*/CHECK (true),
665
  /*KEY "place_visit_id_fkey1_idx" ("parent")*/CHECK (true),
666
  /*CONSTRAINT "place_observation_id_fkey1" FOREIGN KEY ("project") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
667
  /*CONSTRAINT "place_visit_id_fkey1" FOREIGN KEY ("parent") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
668
  /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
669
  /*CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
670
  /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
671
  /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("subject") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
672
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]. = VegX.vegpath.org?plotObservation, VegBank.vegpath.org?observation (which was confusingly named) + some of VegBank.vegpath.org?plot (which is actually 1:1 with observation)'*/;
673
/*!40101 SET character_set_client = @saved_cs_client */;
674

    
675
--
676
-- Dumping data for table "place_visit"
677
--
678

    
679
/*!40000 ALTER TABLE "place_visit" DISABLE KEYS */;
680
/*!40000 ALTER TABLE "place_visit" ENABLE KEYS */;
681

    
682
--
683
-- Table structure for table "plot"
684
--
685

    
686
/*!40101 SET @saved_cs_client     = @@character_set_client */;
687
/*!40101 SET character_set_client = utf8 */;
688
CREATE TABLE "plot" (
689
  "id" text NOT NULL,
690
  "area_m2" double precision DEFAULT NULL,
691
  "shape" text DEFAULT NULL,
692
  "length_m" text DEFAULT NULL,
693
  "width_m" text DEFAULT NULL,
694
  "azimuth_deg_N" text DEFAULT NULL,
695
  "boundary_WKT" text DEFAULT NULL,
696
  "dimensions" hstore DEFAULT NULL,
697
  PRIMARY KEY ("id"),
698
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
699
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
700
/*!40101 SET character_set_client = @saved_cs_client */;
701

    
702
--
703
-- Dumping data for table "plot"
704
--
705

    
706
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
707
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
708

    
709
--
710
-- Table structure for table "project"
711
--
712

    
713
/*!40101 SET @saved_cs_client     = @@character_set_client */;
714
/*!40101 SET character_set_client = utf8 */;
715
CREATE TABLE "project" (
716
  "id" text NOT NULL,
717
  "name" text NOT NULL,
718
  "dataset" text DEFAULT NULL,
719
  "info" hstore DEFAULT NULL,
720
  PRIMARY KEY ("id"),
721
  /*CONSTRAINT "project__unique" */UNIQUE ("dataset","name"),
722
  /*KEY "project_id_fkey1_idx" ("dataset")*/CHECK (true),
723
  /*CONSTRAINT "project_id_fkey1" FOREIGN KEY ("dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
724
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
725
) /*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)'*/;
726
/*!40101 SET character_set_client = @saved_cs_client */;
727

    
728
--
729
-- Dumping data for table "project"
730
--
731

    
732
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
733
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
734

    
735
--
736
-- Table structure for table "record"
737
--
738

    
739
/*!40101 SET @saved_cs_client     = @@character_set_client */;
740
/*!40101 SET character_set_client = utf8 */;
741
CREATE TABLE "record" (
742
  "id" text NOT NULL,
743
  "scoping_dataset" text NOT NULL /*COMMENT 'the dataset that scopes the id_within_dataset'*/,
744
  "id_within_dataset" text NOT NULL,
745
  "attribution_dataset" text NOT NULL /*COMMENT 'the dataset that provides attribution information. defaults to the scoping_dataset.'*/,
746
  PRIMARY KEY ("id"),
747
  /*CONSTRAINT "record_unique" */UNIQUE ("scoping_dataset","id_within_dataset"),
748
  /*KEY "fk_record_source1_idx" ("scoping_dataset")*/CHECK (true),
749
  /*KEY "record_id_fkey2_idx" ("attribution_dataset")*/CHECK (true),
750
  /*CONSTRAINT "fk_record_source10" FOREIGN KEY ("scoping_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
751
  /*CONSTRAINT "fk_record_source2" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
752
  /*CONSTRAINT "record_id_fkey2" FOREIGN KEY ("attribution_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
753
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a collection of data relating to the same entity. this doesn''t have to be a row in a table, it can also be a paragraph of text relating to the same thing (e.g. a method description in a PDF). note that this is the record in the *source* data.'*/;
754
/*!40101 SET character_set_client = @saved_cs_client */;
755

    
756
--
757
-- Dumping data for table "record"
758
--
759

    
760
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
761
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
762

    
763
--
764
-- Table structure for table "referenced_class"
765
--
766

    
767
/*!40101 SET @saved_cs_client     = @@character_set_client */;
768
/*!40101 SET character_set_client = utf8 */;
769
CREATE TABLE "referenced_class" (
770
  "id" text NOT NULL,
771
  PRIMARY KEY ("id"),
772
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
773
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
774
/*!40101 SET character_set_client = @saved_cs_client */;
775

    
776
--
777
-- Dumping data for table "referenced_class"
778
--
779

    
780
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
781
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
782

    
783
--
784
-- Table structure for table "reobservable"
785
--
786

    
787
/*!40101 SET @saved_cs_client     = @@character_set_client */;
788
/*!40101 SET character_set_client = utf8 */;
789
CREATE TABLE "reobservable" (
790
  "id" text NOT NULL,
791
  "orig_observation" text DEFAULT NULL,
792
  PRIMARY KEY ("id"),
793
  /*KEY "fk_reobservable_taxon_determination1_idx" ("orig_observation")*/CHECK (true),
794
  /*CONSTRAINT "fk_reobservable_taxon_determination1" FOREIGN KEY ("orig_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
795
  /*CONSTRAINT "fk_reobservable_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
796
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made'*/;
797
/*!40101 SET character_set_client = @saved_cs_client */;
798

    
799
--
800
-- Dumping data for table "reobservable"
801
--
802

    
803
/*!40000 ALTER TABLE "reobservable" DISABLE KEYS */;
804
/*!40000 ALTER TABLE "reobservable" ENABLE KEYS */;
805

    
806
--
807
-- Table structure for table "size_class"
808
--
809

    
810
/*!40101 SET @saved_cs_client     = @@character_set_client */;
811
/*!40101 SET character_set_client = utf8 */;
812
CREATE TABLE "size_class" (
813
  "id" text NOT NULL,
814
  "diameter_min_m" double precision NOT NULL,
815
  "diameter_max_m" double precision NOT NULL,
816
  PRIMARY KEY ("id"),
817
  /*CONSTRAINT "fk_layer_stratum10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
818
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
819
/*!40101 SET character_set_client = @saved_cs_client */;
820

    
821
--
822
-- Dumping data for table "size_class"
823
--
824

    
825
/*!40000 ALTER TABLE "size_class" DISABLE KEYS */;
826
/*!40000 ALTER TABLE "size_class" ENABLE KEYS */;
827

    
828
--
829
-- Table structure for table "soil_observation"
830
--
831

    
832
/*!40101 SET @saved_cs_client     = @@character_set_client */;
833
/*!40101 SET character_set_client = utf8 */;
834
CREATE TABLE "soil_observation" (
835
  "id" text NOT NULL,
836
  "place_visit" text NOT NULL,
837
  "measurement_spot" text DEFAULT NULL,
838
  "observations" hstore DEFAULT NULL,
839
  PRIMARY KEY ("id"),
840
  /*KEY "fk_soil_observation_place_observation1_idx" ("place_visit")*/CHECK (true),
841
  /*KEY "fk_soil_observation_subplace1_idx" ("measurement_spot")*/CHECK (true),
842
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
843
  /*CONSTRAINT "fk_soil_observation_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
844
  /*CONSTRAINT "fk_soil_observation_subplace1" FOREIGN KEY ("measurement_spot") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
845
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil'*/;
846
/*!40101 SET character_set_client = @saved_cs_client */;
847

    
848
--
849
-- Dumping data for table "soil_observation"
850
--
851

    
852
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
853
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
854

    
855
--
856
-- Table structure for table "source"
857
--
858

    
859
/*!40101 SET @saved_cs_client     = @@character_set_client */;
860
/*!40101 SET character_set_client = utf8 */;
861
CREATE TABLE "source" (
862
  "id" text NOT NULL,
863
  "url" text NOT NULL /*COMMENT 'points to the source data and uniquely identifies the source'*/,
864
  "name" text DEFAULT NULL /*COMMENT 'source names will be scrubbed *upon insert* so that the row always contains the most accurate data. this scrubbing may use the assistance of a thesaurus table.'*/,
865
  "info" hstore DEFAULT NULL,
866
  PRIMARY KEY ("id"),
867
  /*CONSTRAINT "source__unique" */UNIQUE ("url")
868
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='where something came from; a "reference [...] cited within the database" ("VegBank":http://reference.VegBank.vegpath.org); = VegBank.vegpath.org?reference'*/;
869
/*!40101 SET character_set_client = @saved_cs_client */;
870

    
871
--
872
-- Dumping data for table "source"
873
--
874

    
875
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
876
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
877

    
878
--
879
-- Table structure for table "specimen"
880
--
881

    
882
/*!40101 SET @saved_cs_client     = @@character_set_client */;
883
/*!40101 SET character_set_client = utf8 */;
884
CREATE TABLE "specimen" (
885
  "id" text NOT NULL,
886
  "individual_observation" text DEFAULT NULL /*COMMENT 'the plant the specimen was collected from and any observations about it'*/,
887
  "id_within_individual" text DEFAULT NULL,
888
  "orig_collection" text DEFAULT NULL,
889
  "barcode" text DEFAULT NULL,
890
  "accession_number" text DEFAULT NULL,
891
  "defining_data" hstore DEFAULT NULL /*COMMENT 'of the observations made about the specimen in individual_observation.traits, this stores the subset that can be used to make a taxonomic redetermination. for a digital-only specimen, this would be the information that comprises the specimen (e.g. a photo, a sketch, or a description that is detailed enough to be able to make a redetermination). note that a taxon_presence without a physical voucher can still qualify as reobservable if a detailed description of it is provided here.'*/,
892
  PRIMARY KEY ("id"),
893
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual_observation","id_within_individual"),
894
  /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"),
895
  /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"),
896
  /*CONSTRAINT "specimen_unique_in_individual_observation" */UNIQUE ("individual_observation","id_within_individual"),
897
  /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true),
898
  /*KEY "fk_specimen_individual_observation1_idx" ("individual_observation")*/CHECK (true),
899
  /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
900
  /*CONSTRAINT "fk_specimen_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
901
  /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
902
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='something collected from a plant. this can be a physical "part of a plant" ("Wikipedia":http://en.wikipedia.org/wiki/Specimen), or a picture or description of the plant. when there are multiple specimen replicates (copies) of a specimen, each gets its own specimen_observation pointing to the same specimen.'*/;
903
/*!40101 SET character_set_client = @saved_cs_client */;
904

    
905
--
906
-- Dumping data for table "specimen"
907
--
908

    
909
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
910
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
911

    
912
--
913
-- Table structure for table "specimen_observation"
914
--
915

    
916
/*!40101 SET @saved_cs_client     = @@character_set_client */;
917
/*!40101 SET character_set_client = utf8 */;
918
CREATE TABLE "specimen_observation" (
919
  "id" text NOT NULL,
920
  "subject" text NOT NULL,
921
  "description" text DEFAULT NULL,
922
  "current_collection" text DEFAULT NULL,
923
  "owner_collection" text DEFAULT NULL,
924
  PRIMARY KEY ("id"),
925
  /*KEY "fk_specimen_observation_specimen1_idx" ("subject")*/CHECK (true),
926
  /*KEY "specimen_observation_id_fkey1_idx" ("current_collection")*/CHECK (true),
927
  /*KEY "specimen_observation_id_fkey2_idx" ("owner_collection")*/CHECK (true),
928
  /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
929
  /*CONSTRAINT "specimen_observation_id_fkey1" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
930
  /*CONSTRAINT "specimen_observation_id_fkey2" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
931
  /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("subject") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
932
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
933
/*!40101 SET character_set_client = @saved_cs_client */;
934

    
935
--
936
-- Dumping data for table "specimen_observation"
937
--
938

    
939
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
940
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
941

    
942
--
943
-- Table structure for table "stem"
944
--
945

    
946
/*!40101 SET @saved_cs_client     = @@character_set_client */;
947
/*!40101 SET character_set_client = utf8 */;
948
CREATE TABLE "stem" (
949
  "id" text NOT NULL,
950
  "individual" text DEFAULT NULL,
951
  PRIMARY KEY ("id"),
952
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
953
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
954
  /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
955
) /*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)'*/;
956
/*!40101 SET character_set_client = @saved_cs_client */;
957

    
958
--
959
-- Dumping data for table "stem"
960
--
961

    
962
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
963
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
964

    
965
--
966
-- Table structure for table "stem_observation"
967
--
968

    
969
/*!40101 SET @saved_cs_client     = @@character_set_client */;
970
/*!40101 SET character_set_client = utf8 */;
971
CREATE TABLE "stem_observation" (
972
  "id" text NOT NULL,
973
  "subject" text DEFAULT NULL,
974
  "individual_observation" text DEFAULT NULL,
975
  PRIMARY KEY ("id"),
976
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","subject"),
977
  /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true),
978
  /*KEY "fk_stem_observation_stem1_idx" ("subject")*/CHECK (true),
979
  /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("subject") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
980
  /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
981
  /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
982
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]'*/;
983
/*!40101 SET character_set_client = @saved_cs_client */;
984

    
985
--
986
-- Dumping data for table "stem_observation"
987
--
988

    
989
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
990
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
991

    
992
--
993
-- Table structure for table "stratum"
994
--
995

    
996
/*!40101 SET @saved_cs_client     = @@character_set_client */;
997
/*!40101 SET character_set_client = utf8 */;
998
CREATE TABLE "stratum" (
999
  "id" text NOT NULL,
1000
  "name" text NOT NULL,
1001
  "height_min_m" text DEFAULT NULL,
1002
  "height_max_m" text DEFAULT NULL,
1003
  PRIMARY KEY ("id"),
1004
  /*CONSTRAINT "fk_layer_stratum1" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1005
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stratumType'*/;
1006
/*!40101 SET character_set_client = @saved_cs_client */;
1007

    
1008
--
1009
-- Dumping data for table "stratum"
1010
--
1011

    
1012
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
1013
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
1014

    
1015
--
1016
-- Table structure for table "subplace"
1017
--
1018

    
1019
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1020
/*!40101 SET character_set_client = utf8 */;
1021
CREATE TABLE "subplace" (
1022
  "id" text NOT NULL,
1023
  "parent" text NOT NULL,
1024
  "x_m" double precision DEFAULT NULL,
1025
  "y_m" double precision DEFAULT NULL,
1026
  "coords" hstore DEFAULT NULL,
1027
  PRIMARY KEY ("id"),
1028
  /*KEY "fk_rel_place_place1_idx" ("parent")*/CHECK (true),
1029
  /*CONSTRAINT "fk_subplot_place2" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1030
  /*CONSTRAINT "fk_rel_place_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1031
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='stores plot elements such as subplots ("subplot, line, or any other subsample  or subdivision of plot" ("SALVIAS":http://salvias.net/Documents/salvias_data_dictionary.html#Plot_data/subplot))'*/;
1032
/*!40101 SET character_set_client = @saved_cs_client */;
1033

    
1034
--
1035
-- Dumping data for table "subplace"
1036
--
1037

    
1038
/*!40000 ALTER TABLE "subplace" DISABLE KEYS */;
1039
/*!40000 ALTER TABLE "subplace" ENABLE KEYS */;
1040

    
1041
--
1042
-- Table structure for table "subplot"
1043
--
1044

    
1045
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1046
/*!40101 SET character_set_client = utf8 */;
1047
CREATE TABLE "subplot" (
1048
  "id" text NOT NULL,
1049
  "parent" text NOT NULL /*COMMENT 'the parent plot'*/,
1050
  PRIMARY KEY ("id"),
1051
  /*KEY "fk_subplot_plot2_idx" ("parent")*/CHECK (true),
1052
  /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1053
  /*CONSTRAINT "fk_subplot_plot2" FOREIGN KEY ("parent") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1054
  /*CONSTRAINT "fk_subplot_rel_place1" FOREIGN KEY ("id") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1055
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1056
/*!40101 SET character_set_client = @saved_cs_client */;
1057

    
1058
--
1059
-- Dumping data for table "subplot"
1060
--
1061

    
1062
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
1063
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
1064

    
1065
--
1066
-- Table structure for table "taxa_sampling_event"
1067
--
1068

    
1069
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1070
/*!40101 SET character_set_client = utf8 */;
1071
CREATE TABLE "taxa_sampling_event" (
1072
  "id" text NOT NULL,
1073
  "parent" text DEFAULT NULL /*COMMENT 'the taxa_sampling_event for the parent stratum'*/,
1074
  "place_visit" text NOT NULL,
1075
  "subsetting_method" text DEFAULT NULL,
1076
  PRIMARY KEY ("id"),
1077
  /*CONSTRAINT "taxa_sampling_event__unique" */UNIQUE ("place_visit","subsetting_method"),
1078
  /*KEY "fk_sampling_event_method1_idx" ("subsetting_method")*/CHECK (true),
1079
  /*KEY "taxa_sampling_event_id_fkey1_idx" ("place_visit")*/CHECK (true),
1080
  /*KEY "taxa_sampling_event_id_fkey2_idx" ("parent")*/CHECK (true),
1081
  /*CONSTRAINT "fk_project_event10" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1082
  /*CONSTRAINT "taxa_sampling_event_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1083
  /*CONSTRAINT "fk_sampling_event_method1" FOREIGN KEY ("subsetting_method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1084
  /*CONSTRAINT "taxa_sampling_event_id_fkey1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1085
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegX.vegpath.org?stratumObservation, VegBank.vegpath.org?stratum (which was confusingly named)'*/;
1086
/*!40101 SET character_set_client = @saved_cs_client */;
1087

    
1088
--
1089
-- Dumping data for table "taxa_sampling_event"
1090
--
1091

    
1092
/*!40000 ALTER TABLE "taxa_sampling_event" DISABLE KEYS */;
1093
/*!40000 ALTER TABLE "taxa_sampling_event" ENABLE KEYS */;
1094

    
1095
--
1096
-- Table structure for table "taxon_absence"
1097
--
1098

    
1099
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1100
/*!40101 SET character_set_client = utf8 */;
1101
CREATE TABLE "taxon_absence" (
1102
  "id" text NOT NULL,
1103
  PRIMARY KEY ("id"),
1104
  /*CONSTRAINT "fk_taxon_absence_taxa_sampling_event1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1105
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place'*/;
1106
/*!40101 SET character_set_client = @saved_cs_client */;
1107

    
1108
--
1109
-- Dumping data for table "taxon_absence"
1110
--
1111

    
1112
/*!40000 ALTER TABLE "taxon_absence" DISABLE KEYS */;
1113
/*!40000 ALTER TABLE "taxon_absence" ENABLE KEYS */;
1114

    
1115
--
1116
-- Table structure for table "taxon_assertion"
1117
--
1118

    
1119
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1120
/*!40101 SET character_set_client = utf8 */;
1121
CREATE TABLE "taxon_assertion" (
1122
  "id" text NOT NULL,
1123
  "string" text NOT NULL /*COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name'*/,
1124
  "taxon" text DEFAULT NULL,
1125
  "cf_aff" text DEFAULT NULL,
1126
  "annotations" hstore DEFAULT NULL,
1127
  PRIMARY KEY ("id"),
1128
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
1129
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
1130
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1131
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1132
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1133
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1134
/*!40101 SET character_set_client = @saved_cs_client */;
1135

    
1136
--
1137
-- Dumping data for table "taxon_assertion"
1138
--
1139

    
1140
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
1141
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
1142

    
1143
--
1144
-- Table structure for table "taxon_concept"
1145
--
1146

    
1147
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1148
/*!40101 SET character_set_client = utf8 */;
1149
CREATE TABLE "taxon_concept" (
1150
  "id" text NOT NULL,
1151
  "according_to" text NOT NULL,
1152
  "parent" text DEFAULT NULL,
1153
  "accepted_taxon_concept" text DEFAULT NULL,
1154
  PRIMARY KEY ("id"),
1155
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
1156
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
1157
  /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true),
1158
  /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true),
1159
  /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1160
  /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1161
  /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1162
  /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1163
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]'*/;
1164
/*!40101 SET character_set_client = @saved_cs_client */;
1165

    
1166
--
1167
-- Dumping data for table "taxon_concept"
1168
--
1169

    
1170
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
1171
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
1172

    
1173
--
1174
-- Table structure for table "taxon_determination"
1175
--
1176

    
1177
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1178
/*!40101 SET character_set_client = utf8 */;
1179
CREATE TABLE "taxon_determination" (
1180
  "id" text NOT NULL,
1181
  "taxon_assertion" text NOT NULL,
1182
  "voucher" text DEFAULT NULL,
1183
  "identified_by" text DEFAULT NULL,
1184
  "fit_info" hstore DEFAULT NULL,
1185
  PRIMARY KEY ("id"),
1186
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
1187
  /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true),
1188
  /*KEY "fk_taxon_determination_party_list1_idx" ("identified_by")*/CHECK (true),
1189
  /*KEY "taxon_determination_id_fkey1_idx" ("voucher")*/CHECK (true),
1190
  /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1191
  /*CONSTRAINT "taxon_determination_id_fkey1" FOREIGN KEY ("voucher") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1192
  /*CONSTRAINT "fk_taxon_determination_party_list1" FOREIGN KEY ("identified_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1193
  /*CONSTRAINT "fk_taxon_determination_taxon_observation1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1194
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/;
1195
/*!40101 SET character_set_client = @saved_cs_client */;
1196

    
1197
--
1198
-- Dumping data for table "taxon_determination"
1199
--
1200

    
1201
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
1202
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
1203

    
1204
--
1205
-- Table structure for table "taxon_name"
1206
--
1207

    
1208
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1209
/*!40101 SET character_set_client = utf8 */;
1210
CREATE TABLE "taxon_name" (
1211
  "id" text NOT NULL,
1212
  "unique_name" text NOT NULL,
1213
  "formal_name" text DEFAULT NULL,
1214
  "taxon_name" text DEFAULT NULL,
1215
  "author" text DEFAULT NULL,
1216
  "common_name" text DEFAULT NULL,
1217
  "rank" text DEFAULT NULL,
1218
  "taxon_path" text DEFAULT NULL,
1219
  PRIMARY KEY ("id"),
1220
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
1221
  /*KEY "fk_taxon_name_taxon_path1_idx" ("taxon_path")*/CHECK (true),
1222
  /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1223
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1224
  /*CONSTRAINT "fk_taxon_name_taxon_path1" FOREIGN KEY ("taxon_path") REFERENCES "taxon_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1225
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1226
/*!40101 SET character_set_client = @saved_cs_client */;
1227

    
1228
--
1229
-- Dumping data for table "taxon_name"
1230
--
1231

    
1232
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
1233
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
1234

    
1235
--
1236
-- Table structure for table "taxon_observation"
1237
--
1238

    
1239
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1240
/*!40101 SET character_set_client = utf8 */;
1241
CREATE TABLE "taxon_observation" (
1242
  "id" text NOT NULL,
1243
  "parent" text DEFAULT NULL /*COMMENT 'the observation of the same taxon_occurrence in the parent sampling_event'*/,
1244
  "subject" text DEFAULT NULL,
1245
  "taxon_occurrence" text NOT NULL /*COMMENT 'when not provided (and not fillable from another field), a taxon_occurrence will be created with the same id as the taxon_observation'*/,
1246
  "sampling_event" text NOT NULL /*COMMENT 'for specimens, this will have the same event information (date_range, participants, place) as the taxon_observation'*/,
1247
  "primary_collector" text DEFAULT NULL,
1248
  "collector_number" text DEFAULT NULL,
1249
  "all_collectors" text DEFAULT NULL,
1250
  "growth_form" text DEFAULT NULL,
1251
  "cultivated" integer DEFAULT NULL,
1252
  "traits" hstore DEFAULT NULL,
1253
  PRIMARY KEY ("id"),
1254
  /*KEY "fk_taxon_observation_taxon_occurrence1_idx" ("taxon_occurrence")*/CHECK (true),
1255
  /*KEY "fk_taxon_observation_taxa_sampling_event1_idx" ("sampling_event")*/CHECK (true),
1256
  /*KEY "taxon_observation_id_fkey1_idx" ("primary_collector")*/CHECK (true),
1257
  /*KEY "fk_taxon_observation_party_list1_idx" ("all_collectors")*/CHECK (true),
1258
  /*KEY "taxon_observation__unique" ("sampling_event","primary_collector","collector_number")*/CHECK (true),
1259
  /*KEY "taxon_observation_id_fkey2_idx" ("parent")*/CHECK (true),
1260
  /*KEY "taxon_observation_id_fkey3_idx" ("subject")*/CHECK (true),
1261
  /*CONSTRAINT "taxon_observation_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1262
  /*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("all_collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1263
  /*CONSTRAINT "fk_taxon_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1264
  /*CONSTRAINT "fk_taxon_observation_taxa_sampling_event1" FOREIGN KEY ("sampling_event") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1265
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1266
  /*CONSTRAINT "taxon_observation_id_fkey1" FOREIGN KEY ("primary_collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1267
  /*CONSTRAINT "taxon_observation_id_fkey3" FOREIGN KEY ("subject") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1268
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= DwC.vegpath.org?Occurrence (which actually represents an *observation* of an occurrence)'*/;
1269
/*!40101 SET character_set_client = @saved_cs_client */;
1270

    
1271
--
1272
-- Dumping data for table "taxon_observation"
1273
--
1274

    
1275
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
1276
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
1277

    
1278
--
1279
-- Table structure for table "taxon_occurrence"
1280
--
1281

    
1282
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1283
/*!40101 SET character_set_client = utf8 */;
1284
CREATE TABLE "taxon_occurrence" (
1285
  "id" text NOT NULL,
1286
  "within_place" text NOT NULL,
1287
  "current_observation" text DEFAULT NULL,
1288
  PRIMARY KEY ("id"),
1289
  /*KEY "fk_taxon_occurrence_taxon_determination3_idx" ("current_observation")*/CHECK (true),
1290
  /*KEY "fk_taxon_occurrence_place1_idx" ("within_place")*/CHECK (true),
1291
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination3" FOREIGN KEY ("current_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1292
  /*CONSTRAINT "fk_taxon_occurrence_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1293
  /*CONSTRAINT "fk_taxon_occurrence_place1" FOREIGN KEY ("within_place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1294
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='*not* DwC.vegpath.org?Occurrence'*/;
1295
/*!40101 SET character_set_client = @saved_cs_client */;
1296

    
1297
--
1298
-- Dumping data for table "taxon_occurrence"
1299
--
1300

    
1301
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
1302
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
1303

    
1304
--
1305
-- Table structure for table "taxon_path"
1306
--
1307

    
1308
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1309
/*!40101 SET character_set_client = utf8 */;
1310
CREATE TABLE "taxon_path" (
1311
  "id" text NOT NULL,
1312
  "family" text DEFAULT NULL,
1313
  "genus" text DEFAULT NULL,
1314
  "specific_epithet" text DEFAULT NULL,
1315
  "ranks" hstore DEFAULT NULL,
1316
  PRIMARY KEY ("id")
1317
) /*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)'*/;
1318
/*!40101 SET character_set_client = @saved_cs_client */;
1319

    
1320
--
1321
-- Dumping data for table "taxon_path"
1322
--
1323

    
1324
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
1325
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
1326

    
1327
--
1328
-- Table structure for table "taxon_presence"
1329
--
1330

    
1331
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1332
/*!40101 SET character_set_client = utf8 */;
1333
CREATE TABLE "taxon_presence" (
1334
  "id" text NOT NULL,
1335
  "cover_percent" double precision DEFAULT NULL,
1336
  PRIMARY KEY ("id"),
1337
  /*CONSTRAINT "fk_taxon_presence_taxon_determination1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1338
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegX.vegpath.org?aggregateOrganismObservation, VegBank.vegpath.org?taxonImportance; "An observation applying to all occurrences of an organism" ("VegX":http://wiki.tdwg.org/twiki/pub/Vegetation/WebHome/VegX_Schema_1.5.3_proposed.zip#/veg.xsd#/aggregateOrganismObservations/aggregateOrganismObservation).'*/;
1339
/*!40101 SET character_set_client = @saved_cs_client */;
1340

    
1341
--
1342
-- Dumping data for table "taxon_presence"
1343
--
1344

    
1345
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
1346
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
1347

    
1348
--
1349
-- Table structure for table "taxon_scrub"
1350
--
1351

    
1352
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1353
/*!40101 SET character_set_client = utf8 */;
1354
CREATE TABLE "taxon_scrub" (
1355
  "id" text NOT NULL,
1356
  "input_string" text NOT NULL,
1357
  "parsed_taxon_assertion" text NOT NULL,
1358
  "matched_taxon_concept" text DEFAULT NULL,
1359
  "match_score" float DEFAULT NULL,
1360
  "match_info" hstore DEFAULT NULL,
1361
  PRIMARY KEY ("id"),
1362
  /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true),
1363
  /*KEY "fk_taxon_scrub_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
1364
  /*KEY "fk_taxon_scrub_taxon_string1_idx" ("input_string")*/CHECK (true),
1365
  /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1366
  /*CONSTRAINT "fk_taxon_scrub_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1367
  /*CONSTRAINT "fk_taxon_scrub_taxon_string1" FOREIGN KEY ("input_string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1368
  /*CONSTRAINT "fk_taxon_scrub_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1369
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/;
1370
/*!40101 SET character_set_client = @saved_cs_client */;
1371

    
1372
--
1373
-- Dumping data for table "taxon_scrub"
1374
--
1375

    
1376
/*!40000 ALTER TABLE "taxon_scrub" DISABLE KEYS */;
1377
/*!40000 ALTER TABLE "taxon_scrub" ENABLE KEYS */;
1378

    
1379
--
1380
-- Table structure for table "taxon_string"
1381
--
1382

    
1383
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1384
/*!40101 SET character_set_client = utf8 */;
1385
CREATE TABLE "taxon_string" (
1386
  "string" text NOT NULL,
1387
  PRIMARY KEY ("string")
1388
) /*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)'*/;
1389
/*!40101 SET character_set_client = @saved_cs_client */;
1390

    
1391
--
1392
-- Dumping data for table "taxon_string"
1393
--
1394

    
1395
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
1396
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
1397

    
1398
--
1399
-- Table structure for table "traceable"
1400
--
1401

    
1402
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1403
/*!40101 SET character_set_client = utf8 */;
1404
CREATE TABLE "traceable" (
1405
  "id" text NOT NULL,
1406
  "id_by_source" text DEFAULT NULL /*COMMENT 'allows referencing a traceable by its source information even when the subclass chose a different value for the pkey'*/,
1407
  "source" text NOT NULL,
1408
  "id_within_source" text DEFAULT NULL /*COMMENT 'the portion of the source that this traceable refers to. when specified, this must *uniquely identify* the traceable within the source. denormalized source data often contains data for many VegCore tables in the same row, and the traceables for each of these table entries must be distinguished *from each other* since they share the same source. this is usually just the VegCore table name, sometimes with a distinguishing prefix (e.g. collector.party/identified_by.party; current_observation.taxon_determination/orig_observation.taxon_determination). this can also identify e.g. a dataset within the source that it came from.'*/,
1409
  "authors" text DEFAULT NULL /*COMMENT 'the people who created the information in the data record. this is *different* from dataset.data_owners, and refers *only* to original data creators such as collectors and identifiers. note that in vegetation data, these record-specific authors generally do not receive attribution. this makes traceable mutually recursive with party_list. = Brad.vegpath.org?attribution.data_author'*/,
1410
  PRIMARY KEY ("id"),
1411
  /*CONSTRAINT "traceable_unique" */UNIQUE ("source","id_within_source"),
1412
  /*CONSTRAINT "traceable__id_by_source" */UNIQUE ("id_by_source"),
1413
  /*KEY "traceable_id_fkey1_idx" ("authors")*/CHECK (true),
1414
  /*CONSTRAINT "traceable_id_fkey1" FOREIGN KEY ("authors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1415
  /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1416
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a row that can have associated source information'*/;
1417
/*!40101 SET character_set_client = @saved_cs_client */;
1418

    
1419
--
1420
-- Dumping data for table "traceable"
1421
--
1422

    
1423
/*!40000 ALTER TABLE "traceable" DISABLE KEYS */;
1424
/*!40000 ALTER TABLE "traceable" ENABLE KEYS */;
1425
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1426

    
1427
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1428
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1429
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1430
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1431
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1432
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1433
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1434

    
1435
-- Dump completed
(5-5/8)