SET standard_conforming_strings = off; SET escape_string_warning = off; -- MySQL dump 10.13 Distrib 5.5.34, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: VegCore -- ------------------------------------------------------ -- Server version 5.5.34-0ubuntu0.12.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; SET NAMES 'utf8'; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Current Database: "VegCore" -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ "VegCore" /*!40100 DEFAULT */; USE "VegCore"; -- -- Table structure for table "aggregate_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "aggregate_observation" ( "id" text NOT NULL, "occurrence_status" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_taxon_presence_taxon_determination10" FOREIGN KEY ("id") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "aggregate_observation" -- /*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */; -- -- Table structure for table "base_class" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "base_class" ( "id" text NOT NULL, "referenced_class" text NOT NULL, PRIMARY KEY ("id"), /*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true), /*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "base_class" -- /*!40000 ALTER TABLE "base_class" DISABLE KEYS */; /*!40000 ALTER TABLE "base_class" ENABLE KEYS */; -- -- Table structure for table "collection" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "collection" ( "id" text NOT NULL, "institution" text NOT NULL, "name" text NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"), /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true), /*KEY "fk_collection_source1_idx" ("id")*/CHECK (true), /*CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "collection" -- /*!40000 ALTER TABLE "collection" DISABLE KEYS */; /*!40000 ALTER TABLE "collection" ENABLE KEYS */; -- -- Table structure for table "community" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "community" ( "id" text NOT NULL, "name" text NOT NULL, "info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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]])'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "community" -- /*!40000 ALTER TABLE "community" DISABLE KEYS */; /*!40000 ALTER TABLE "community" ENABLE KEYS */; -- -- Table structure for table "data_owner" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "data_owner" ( "id" text NOT NULL, "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "fk_party_list_entry_record10" FOREIGN KEY ("id") REFERENCES "party_list_entry" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "data_owner" -- /*!40000 ALTER TABLE "data_owner" DISABLE KEYS */; /*!40000 ALTER TABLE "data_owner" ENABLE KEYS */; -- -- Table structure for table "dataset" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "dataset" ( "id" text NOT NULL, "name" text NOT NULL, "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.'*/, "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.'*/, "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'*/, "first_publisher" text DEFAULT NULL /*COMMENT '= Brad.vegpath.org?attribution.data_publisher, Brad.vegpath.org?data_provenance.primarydataprovider'*/, "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'*/, "access_rights" text DEFAULT NULL /*COMMENT 'e.g. public, private, by request, metadata only'*/, "use_conditions" text DEFAULT NULL /*COMMENT 'citation requirements, etc. this is the combination of all the use_conditions of the data_owners.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "dataset_unique" */UNIQUE ("parent","name"), /*KEY "fk_source_party_list1_idx" ("data_owners")*/CHECK (true), /*KEY "fk_source_party1_idx" ("contacts")*/CHECK (true), /*KEY "fk_dataset_dataset1_idx" ("parent")*/CHECK (true), /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true), /*KEY "dataset_dataset_source_fkey1_idx" ("dataset_source")*/CHECK (true), /*CONSTRAINT "dataset_dataset_source_fkey1" FOREIGN KEY ("dataset_source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_dataset_dataset1" FOREIGN KEY ("parent") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_dataset_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("contacts") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_source_party_list1" FOREIGN KEY ("data_owners") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a collection of records from the same place, with the same attribution requirements'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "dataset" -- /*!40000 ALTER TABLE "dataset" DISABLE KEYS */; /*!40000 ALTER TABLE "dataset" ENABLE KEYS */; -- -- Table structure for table "derived_class" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "derived_class" ( "id" text NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "derived_class" -- /*!40000 ALTER TABLE "derived_class" DISABLE KEYS */; /*!40000 ALTER TABLE "derived_class" ENABLE KEYS */; -- -- Table structure for table "event" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "event" ( "id" text NOT NULL, "parent" text DEFAULT NULL, "subject" text DEFAULT NULL /*COMMENT 'what was observed'*/, "name" text DEFAULT NULL, "date_range" text DEFAULT NULL, "participants" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "event_unique_within_parent_by_name" */UNIQUE ("parent","name"), /*CONSTRAINT "event_unique_within_subject_by_date" */UNIQUE ("subject","date_range","participants"), /*CONSTRAINT "event_unique_within_parent_by_subject" */UNIQUE ("parent","subject"), /*KEY "fk_event1_idx" ("parent")*/CHECK (true), /*KEY "fk_event_party_list1_idx" ("participants")*/CHECK (true), /*KEY "fk_event_place1_idx" ("subject")*/CHECK (true), /*KEY "event_unique_within_subject_by_name" ("subject","name")*/CHECK (true), /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("subject") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "event" -- /*!40000 ALTER TABLE "event" DISABLE KEYS */; /*!40000 ALTER TABLE "event" ENABLE KEYS */; -- -- Table structure for table "geological_context" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "geological_context" ( "id" text NOT NULL, "name" text NOT NULL, "info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "geological_context" -- /*!40000 ALTER TABLE "geological_context" DISABLE KEYS */; /*!40000 ALTER TABLE "geological_context" ENABLE KEYS */; -- -- Table structure for table "geopath" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "geopath" ( "id" text NOT NULL, "ranks" hstore DEFAULT NULL, "continent" text DEFAULT NULL, "country" text DEFAULT NULL, "state_province" text DEFAULT NULL, "county" text DEFAULT NULL, "municipality" text DEFAULT NULL, "locality" text DEFAULT NULL, PRIMARY KEY ("id") ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A named region'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "geopath" -- /*!40000 ALTER TABLE "geopath" DISABLE KEYS */; /*!40000 ALTER TABLE "geopath" ENABLE KEYS */; -- -- Table structure for table "geoplace" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "geoplace" ( "id" text NOT NULL, "latitude_deg" text NOT NULL, "longitude_deg" text NOT NULL, "boundary_WKT" text NOT NULL DEFAULT 'point', "georeferenced_by" text DEFAULT NULL, "georeferencing_info" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "geoplace_id_fkey1_idx" ("georeferenced_by")*/CHECK (true), /*CONSTRAINT "fk_geoplace_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "geoplace_id_fkey1" FOREIGN KEY ("georeferenced_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A numerically-defined point. inherited fields: name: the official, scrubbed name'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "geoplace" -- /*!40000 ALTER TABLE "geoplace" DISABLE KEYS */; /*!40000 ALTER TABLE "geoplace" ENABLE KEYS */; -- -- Table structure for table "geovalidatable_place" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "geovalidatable_place" ( "id" text NOT NULL, "parent_boundary_WKT" text NOT NULL /*COMMENT 'the parent geoplace'*/, PRIMARY KEY ("id"), /*CONSTRAINT "fk_nested_geoplace_geoplace1" FOREIGN KEY ("id") REFERENCES "geoplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "geovalidatable_place" -- /*!40000 ALTER TABLE "geovalidatable_place" DISABLE KEYS */; /*!40000 ALTER TABLE "geovalidatable_place" ENABLE KEYS */; -- -- Table structure for table "geovalidation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "geovalidation" ( "id" text NOT NULL, "input_geoplace" text NOT NULL, "geovalid" integer NOT NULL, "lat_long_domain_valid" integer NOT NULL, "corrected_geoplace" text DEFAULT NULL, "lat_long_in_place_ranks" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_geovalidation_geoplace1_idx" ("input_geoplace")*/CHECK (true), /*KEY "fk_geovalidation_geoplace2_idx" ("corrected_geoplace")*/CHECK (true), /*CONSTRAINT "fk_geovalidation_geoplace1" FOREIGN KEY ("input_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_geovalidation_geoplace2" FOREIGN KEY ("corrected_geoplace") REFERENCES "geovalidatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='The accuracy of the [[VegCore#Coordinates|Coordinates]], taking into account the [[VegCore#Placename|Placename]]'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "geovalidation" -- /*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */; /*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */; -- -- Table structure for table "individual" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "individual" ( "id" text NOT NULL, "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.'*/, "tag" text DEFAULT NULL, "tag_history" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_individual_subplace1_idx" ("identifying_place")*/CHECK (true), /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_individual_subplace1" FOREIGN KEY ("identifying_place") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A distinct biological organism'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "individual" -- /*!40000 ALTER TABLE "individual" DISABLE KEYS */; /*!40000 ALTER TABLE "individual" ENABLE KEYS */; -- -- Table structure for table "individual_count" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "individual_count" ( "id" text NOT NULL, "parent" text NOT NULL /*COMMENT 'the taxon_presence for the taxon as a whole (not subdivided by size_class, etc.)'*/, "size_class" text DEFAULT NULL, "aggregating_traits" hstore DEFAULT NULL, "count" integer DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_aggregate_observation_taxon_presence1_idx" ("parent")*/CHECK (true), /*KEY "fk_aggregate_observation_size_class1_idx" ("size_class")*/CHECK (true), /*CONSTRAINT "fk_aggregate_observation_size_class1" FOREIGN KEY ("size_class") REFERENCES "size_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_aggregate_observation_taxon_presence1" FOREIGN KEY ("parent") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_individual_count_taxon_presence1" FOREIGN KEY ("id") REFERENCES "taxon_presence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stemCount'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "individual_count" -- /*!40000 ALTER TABLE "individual_count" DISABLE KEYS */; /*!40000 ALTER TABLE "individual_count" ENABLE KEYS */; -- -- Table structure for table "individual_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "individual_observation" ( "id" text NOT NULL, "subject" text DEFAULT NULL /*COMMENT 'optional because an individual_observation cannot have an associated individual unless the individual is traceable to a specific plant'*/, "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.'*/, PRIMARY KEY ("id"), /*KEY "fk_individual_observation_individual1_idx" ("subject")*/CHECK (true), /*KEY "individual_observation_id_fkey1_idx" ("specimenholder_institutions")*/CHECK (true), /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("subject") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "individual_observation_id_fkey1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "individual_observation" -- /*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */; -- -- Table structure for table "method" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "method" ( "id" text NOT NULL, "name" text DEFAULT NULL, "parent" text DEFAULT NULL, "info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "method" -- /*!40000 ALTER TABLE "method" DISABLE KEYS */; /*!40000 ALTER TABLE "method" ENABLE KEYS */; -- -- Table structure for table "organization" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "organization" ( "id" text NOT NULL, "name" text NOT NULL, "parent" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "organization_unique" */UNIQUE ("parent","name"), /*KEY "fk_organization_organization1_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_organization_organization1" FOREIGN KEY ("parent") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "organization" -- /*!40000 ALTER TABLE "organization" DISABLE KEYS */; /*!40000 ALTER TABLE "organization" ENABLE KEYS */; -- -- Table structure for table "party" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "party" ( "id" text NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_party_source1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "party" -- /*!40000 ALTER TABLE "party" DISABLE KEYS */; /*!40000 ALTER TABLE "party" ENABLE KEYS */; -- -- Table structure for table "party_list" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "party_list" ( "id" text NOT NULL, "count" integer NOT NULL, "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.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "fk_collection_source100" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "party_list_id_fkey1" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "party_list" -- /*!40000 ALTER TABLE "party_list" DISABLE KEYS */; /*!40000 ALTER TABLE "party_list" ENABLE KEYS */; -- -- Table structure for table "party_list_entry" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "party_list_entry" ( "id" text NOT NULL, "list" text NOT NULL, "party" text NOT NULL, "role" text DEFAULT NULL, "sort_order" integer DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_party_list_has_party_party1_idx" ("party")*/CHECK (true), /*KEY "fk_party_list_entry_party_list1_idx" ("list")*/CHECK (true), /*CONSTRAINT "fk_party_list_entry_party_list1" FOREIGN KEY ("list") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_party_list_entry_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_party_list_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "party_list_entry" -- /*!40000 ALTER TABLE "party_list_entry" DISABLE KEYS */; /*!40000 ALTER TABLE "party_list_entry" ENABLE KEYS */; -- -- Table structure for table "person" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "person" ( "id" text NOT NULL, "name" text NOT NULL, "organizations" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "person_unique" */UNIQUE ("organizations","name"), /*KEY "person_organization_fkey1_idx" ("organizations")*/CHECK (true), /*CONSTRAINT "fk_organization_party10" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "person_organization_fkey1" FOREIGN KEY ("organizations") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "person" -- /*!40000 ALTER TABLE "person" DISABLE KEYS */; /*!40000 ALTER TABLE "person" ENABLE KEYS */; -- -- Table structure for table "place" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "place" ( "id" text NOT NULL, "rank" text NOT NULL /*COMMENT 'every place should have some kind of rank indicating what type of place it is, including lower ranks (e.g. plot, individual)'*/, "name" text NOT NULL /*COMMENT 'for geoplace, generated from the coordinates'*/, "parent" text DEFAULT NULL, "geopath" text DEFAULT NULL, "verbatim" hstore DEFAULT NULL /*COMMENT 'for verbatim coordinates, etc.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "place__unique" */UNIQUE ("parent","rank","name"), /*KEY "fk_place1_idx" ("parent")*/CHECK (true), /*KEY "fk_place_geopath1_idx" ("geopath")*/CHECK (true), /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_place_geopath1" FOREIGN KEY ("geopath") REFERENCES "geopath" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='"A spatial region" ("DwC":http://rs.tdwg.org/dwc/terms/#dcterms:Location) or point'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "place" -- /*!40000 ALTER TABLE "place" DISABLE KEYS */; /*!40000 ALTER TABLE "place" ENABLE KEYS */; -- -- Table structure for table "place_visit" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "place_visit" ( "id" text NOT NULL, "parent" text DEFAULT NULL /*COMMENT 'the concurrent observation of the parent place'*/, "subject" text NOT NULL, "project" text DEFAULT NULL, "community" text DEFAULT NULL, "geological_context" text DEFAULT NULL, "observations" hstore DEFAULT NULL, "elevation_m" double precision DEFAULT NULL, "slope_incline_deg" double precision DEFAULT NULL, "slope_direction_deg_N" double precision DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_place_observation_place1_idx" ("subject")*/CHECK (true), /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true), /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true), /*KEY "place_observation_id_fkey1_idx" ("project")*/CHECK (true), /*KEY "place_visit_id_fkey1_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("subject") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "place_observation_id_fkey1" FOREIGN KEY ("project") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "place_visit_id_fkey1" FOREIGN KEY ("parent") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "place_visit" -- /*!40000 ALTER TABLE "place_visit" DISABLE KEYS */; /*!40000 ALTER TABLE "place_visit" ENABLE KEYS */; -- -- Table structure for table "plot" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "plot" ( "id" text NOT NULL, "area_m2" double precision DEFAULT NULL, "shape" text DEFAULT NULL, "length_m" text DEFAULT NULL, "width_m" text DEFAULT NULL, "azimuth_deg_N" text DEFAULT NULL, "boundary_WKT" text DEFAULT NULL, "dimensions" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "plot" -- /*!40000 ALTER TABLE "plot" DISABLE KEYS */; /*!40000 ALTER TABLE "plot" ENABLE KEYS */; -- -- Table structure for table "project" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "project" ( "id" text NOT NULL, "name" text NOT NULL, "dataset" text DEFAULT NULL, "info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "project__unique" */UNIQUE ("dataset","name"), /*KEY "project_id_fkey1_idx" ("dataset")*/CHECK (true), /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "project_id_fkey1" FOREIGN KEY ("dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "project" -- /*!40000 ALTER TABLE "project" DISABLE KEYS */; /*!40000 ALTER TABLE "project" ENABLE KEYS */; -- -- Table structure for table "record" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "record" ( "id" text NOT NULL, "scoping_dataset" text NOT NULL /*COMMENT 'the dataset that scopes the id_within_dataset'*/, "id_within_dataset" text NOT NULL, "attribution_dataset" text NOT NULL /*COMMENT 'the dataset that provides attribution information. defaults to the scoping_dataset.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "record_unique" */UNIQUE ("scoping_dataset","id_within_dataset"), /*KEY "fk_record_source1_idx" ("scoping_dataset")*/CHECK (true), /*KEY "record_id_fkey2_idx" ("attribution_dataset")*/CHECK (true), /*CONSTRAINT "fk_record_source10" FOREIGN KEY ("scoping_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_record_source2" FOREIGN KEY ("id") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "record_id_fkey2" FOREIGN KEY ("attribution_dataset") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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.'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "record" -- /*!40000 ALTER TABLE "record" DISABLE KEYS */; /*!40000 ALTER TABLE "record" ENABLE KEYS */; -- -- Table structure for table "referenced_class" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "referenced_class" ( "id" text NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "referenced_class" -- /*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */; /*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */; -- -- Table structure for table "reobservable" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "reobservable" ( "id" text NOT NULL, "orig_observation" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_reobservable_taxon_determination1_idx" ("orig_observation")*/CHECK (true), /*CONSTRAINT "fk_reobservable_taxon_determination1" FOREIGN KEY ("orig_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_reobservable_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Any entity on which [[VegCore#TaxonDetermination|TaxonDetermination]]s can be made'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "reobservable" -- /*!40000 ALTER TABLE "reobservable" DISABLE KEYS */; /*!40000 ALTER TABLE "reobservable" ENABLE KEYS */; -- -- Table structure for table "size_class" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "size_class" ( "id" text NOT NULL, "diameter_min_m" double precision NOT NULL, "diameter_max_m" double precision NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_layer_stratum10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "size_class" -- /*!40000 ALTER TABLE "size_class" DISABLE KEYS */; /*!40000 ALTER TABLE "size_class" ENABLE KEYS */; -- -- Table structure for table "soil_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "soil_observation" ( "id" text NOT NULL, "place_visit" text NOT NULL, "measurement_spot" text DEFAULT NULL, "observations" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_soil_observation_place_observation1_idx" ("place_visit")*/CHECK (true), /*KEY "fk_soil_observation_subplace1_idx" ("measurement_spot")*/CHECK (true), /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_soil_observation_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_soil_observation_subplace1" FOREIGN KEY ("measurement_spot") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A sampling of a [[VegCore#Location|Location]]''s soil'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "soil_observation" -- /*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */; -- -- Table structure for table "source" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "source" ( "id" text NOT NULL, "url" text NOT NULL /*COMMENT 'points to the source data and uniquely identifies the source'*/, "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.'*/, "info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "source__unique" */UNIQUE ("url") ) /*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'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "source" -- /*!40000 ALTER TABLE "source" DISABLE KEYS */; /*!40000 ALTER TABLE "source" ENABLE KEYS */; -- -- Table structure for table "specimen" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "specimen" ( "id" text NOT NULL, "individual_observation" text DEFAULT NULL /*COMMENT 'the plant the specimen was collected from and any observations about it'*/, "id_within_individual" text DEFAULT NULL, "orig_collection" text DEFAULT NULL, "barcode" text DEFAULT NULL, "accession_number" text DEFAULT NULL, "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.'*/, PRIMARY KEY ("id"), /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual_observation","id_within_individual"), /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"), /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"), /*CONSTRAINT "specimen_unique_in_individual_observation" */UNIQUE ("individual_observation","id_within_individual"), /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true), /*KEY "fk_specimen_individual_observation1_idx" ("individual_observation")*/CHECK (true), /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_specimen_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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.'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "specimen" -- /*!40000 ALTER TABLE "specimen" DISABLE KEYS */; /*!40000 ALTER TABLE "specimen" ENABLE KEYS */; -- -- Table structure for table "specimen_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "specimen_observation" ( "id" text NOT NULL, "subject" text NOT NULL, "current_collection" text DEFAULT NULL, "owner_collection" text DEFAULT NULL, "description" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_specimen_observation_specimen1_idx" ("subject")*/CHECK (true), /*KEY "specimen_observation_id_fkey1_idx" ("current_collection")*/CHECK (true), /*KEY "specimen_observation_id_fkey2_idx" ("owner_collection")*/CHECK (true), /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("subject") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "specimen_observation_id_fkey1" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "specimen_observation_id_fkey2" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "specimen_observation" -- /*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */; -- -- Table structure for table "stem" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "stem" ( "id" text NOT NULL, "individual" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true), /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "stem" -- /*!40000 ALTER TABLE "stem" DISABLE KEYS */; /*!40000 ALTER TABLE "stem" ENABLE KEYS */; -- -- Table structure for table "stem_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "stem_observation" ( "id" text NOT NULL, "subject" text DEFAULT NULL, "individual_observation" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","subject"), /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true), /*KEY "fk_stem_observation_stem1_idx" ("subject")*/CHECK (true), /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("subject") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of a [[VegCore#Stem|Stem]]'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "stem_observation" -- /*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */; -- -- Table structure for table "stratum" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "stratum" ( "id" text NOT NULL, "name" text NOT NULL, "height_min_m" text DEFAULT NULL, "height_max_m" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_layer_stratum1" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegBank.vegpath.org?stratumType'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "stratum" -- /*!40000 ALTER TABLE "stratum" DISABLE KEYS */; /*!40000 ALTER TABLE "stratum" ENABLE KEYS */; -- -- Table structure for table "subplace" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "subplace" ( "id" text NOT NULL, "parent" text NOT NULL, "x_m" double precision DEFAULT NULL, "y_m" double precision DEFAULT NULL, "coords" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_rel_place_place1_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_rel_place_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_subplot_place2" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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))'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "subplace" -- /*!40000 ALTER TABLE "subplace" DISABLE KEYS */; /*!40000 ALTER TABLE "subplace" ENABLE KEYS */; -- -- Table structure for table "subplot" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "subplot" ( "id" text NOT NULL, "parent" text NOT NULL /*COMMENT 'the parent plot'*/, PRIMARY KEY ("id"), /*KEY "fk_subplot_plot2_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_subplot_plot2" FOREIGN KEY ("parent") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_subplot_rel_place1" FOREIGN KEY ("id") REFERENCES "subplace" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "subplot" -- /*!40000 ALTER TABLE "subplot" DISABLE KEYS */; /*!40000 ALTER TABLE "subplot" ENABLE KEYS */; -- -- Table structure for table "taxa_sampling_event" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxa_sampling_event" ( "id" text NOT NULL, "parent" text DEFAULT NULL /*COMMENT 'the taxa_sampling_event for the parent stratum'*/, "place_visit" text NOT NULL, "subsetting_method" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "taxa_sampling_event__unique" */UNIQUE ("place_visit","subsetting_method"), /*KEY "fk_sampling_event_method1_idx" ("subsetting_method")*/CHECK (true), /*KEY "taxa_sampling_event_id_fkey1_idx" ("place_visit")*/CHECK (true), /*KEY "taxa_sampling_event_id_fkey2_idx" ("parent")*/CHECK (true), /*CONSTRAINT "fk_project_event10" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_sampling_event_method1" FOREIGN KEY ("subsetting_method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxa_sampling_event_id_fkey1" FOREIGN KEY ("place_visit") REFERENCES "place_visit" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxa_sampling_event_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= VegX.vegpath.org?stratumObservation, VegBank.vegpath.org?stratum (which was confusingly named)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxa_sampling_event" -- /*!40000 ALTER TABLE "taxa_sampling_event" DISABLE KEYS */; /*!40000 ALTER TABLE "taxa_sampling_event" ENABLE KEYS */; -- -- Table structure for table "taxon_absence" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_absence" ( "id" text NOT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_taxon_absence_taxa_sampling_event1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation that a [[VegCore#Taxon|Taxon]]''s does _not_ exist in a place'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_absence" -- /*!40000 ALTER TABLE "taxon_absence" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_absence" ENABLE KEYS */; -- -- Table structure for table "taxon_assertion" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_assertion" ( "id" text NOT NULL, "string" text NOT NULL /*COMMENT 'for parsed_taxon_assertion, this is the TNRS input name, not the concatenated matched name'*/, "taxon" text DEFAULT NULL, "cf_aff" text DEFAULT NULL, "annotations" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true), /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true), /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_assertion" -- /*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */; -- -- Table structure for table "taxon_concept" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_concept" ( "id" text NOT NULL, "according_to" text NOT NULL, "parent" text DEFAULT NULL, "accepted_taxon_concept" text DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"), /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true), /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true), /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true), /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "dataset" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A [[VegCore#Taxon|Taxon]] described by a specific [[VegCore#Reference|Reference]]'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_concept" -- /*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */; -- -- Table structure for table "taxon_determination" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_determination" ( "id" text NOT NULL, "taxon_assertion" text NOT NULL, "voucher" text DEFAULT NULL, "identified_by" text DEFAULT NULL, "fit_info" hstore DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"), /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true), /*KEY "fk_taxon_determination_party_list1_idx" ("identified_by")*/CHECK (true), /*KEY "taxon_determination_id_fkey1_idx" ("voucher")*/CHECK (true), /*CONSTRAINT "fk_taxon_determination_party_list1" FOREIGN KEY ("identified_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_determination_taxon_observation1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxon_determination_id_fkey1" FOREIGN KEY ("voucher") REFERENCES "reobservable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_determination" -- /*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */; -- -- Table structure for table "taxon_name" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_name" ( "id" text NOT NULL, "unique_name" text NOT NULL, "taxon_path" text DEFAULT NULL, "formal_name" text DEFAULT NULL, "taxon_name" text DEFAULT NULL, "author" text DEFAULT NULL, "common_name" text DEFAULT NULL, "rank" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true), /*KEY "fk_taxon_name_taxon_path1_idx" ("taxon_path")*/CHECK (true), /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_name_taxon_path1" FOREIGN KEY ("taxon_path") REFERENCES "taxon_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_name" -- /*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */; -- -- Table structure for table "taxon_observation" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_observation" ( "id" text NOT NULL, "parent" text DEFAULT NULL /*COMMENT 'the observation of the same taxon_occurrence in the parent sampling_event'*/, "subject" text DEFAULT NULL, "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'*/, "sampling_event" text NOT NULL /*COMMENT 'for specimens, this will have the same event information (date_range, participants, place) as the taxon_observation'*/, "primary_collector" text DEFAULT NULL, "collector_number" text DEFAULT NULL, "all_collectors" text DEFAULT NULL, "traits" hstore DEFAULT NULL, "growth_form" text DEFAULT NULL, "cultivated" integer DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_taxon_observation_taxon_occurrence1_idx" ("taxon_occurrence")*/CHECK (true), /*KEY "fk_taxon_observation_taxa_sampling_event1_idx" ("sampling_event")*/CHECK (true), /*KEY "taxon_observation_id_fkey1_idx" ("primary_collector")*/CHECK (true), /*KEY "fk_taxon_observation_party_list1_idx" ("all_collectors")*/CHECK (true), /*KEY "taxon_observation__unique" ("sampling_event","primary_collector","collector_number")*/CHECK (true), /*KEY "taxon_observation_id_fkey2_idx" ("parent")*/CHECK (true), /*KEY "taxon_observation_id_fkey3_idx" ("subject")*/CHECK (true), /*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("all_collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_observation_sampling_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_observation_taxa_sampling_event1" FOREIGN KEY ("sampling_event") REFERENCES "taxa_sampling_event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxon_observation_id_fkey1" FOREIGN KEY ("primary_collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxon_observation_id_fkey2" FOREIGN KEY ("parent") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "taxon_observation_id_fkey3" FOREIGN KEY ("subject") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='= DwC.vegpath.org?Occurrence (which actually represents an *observation* of an occurrence)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_observation" -- /*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */; -- -- Table structure for table "taxon_occurrence" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_occurrence" ( "id" text NOT NULL, "within_place" text NOT NULL, "current_observation" text DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_taxon_occurrence_taxon_determination3_idx" ("current_observation")*/CHECK (true), /*KEY "fk_taxon_occurrence_place1_idx" ("within_place")*/CHECK (true), /*CONSTRAINT "fk_taxon_occurrence_place1" FOREIGN KEY ("within_place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_occurrence_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_occurrence_taxon_determination3" FOREIGN KEY ("current_observation") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='*not* DwC.vegpath.org?Occurrence'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_occurrence" -- /*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */; -- -- Table structure for table "taxon_path" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_path" ( "id" text NOT NULL, "family" text DEFAULT NULL, "genus" text DEFAULT NULL, "specific_epithet" text DEFAULT NULL, "ranks" hstore DEFAULT NULL, PRIMARY KEY ("id") ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_path" -- /*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */; -- -- Table structure for table "taxon_presence" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_presence" ( "id" text NOT NULL, "cover_percent" double precision DEFAULT NULL, PRIMARY KEY ("id"), /*CONSTRAINT "fk_taxon_presence_taxon_determination1" FOREIGN KEY ("id") REFERENCES "aggregate_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*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).'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_presence" -- /*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */; -- -- Table structure for table "taxon_scrub" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_scrub" ( "id" text NOT NULL, "input_string" text NOT NULL, "parsed_taxon_assertion" text NOT NULL, "matched_taxon_concept" text DEFAULT NULL, "match_info" hstore DEFAULT NULL, "match_score" float DEFAULT NULL, PRIMARY KEY ("id"), /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true), /*KEY "fk_taxon_scrub_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true), /*KEY "fk_taxon_scrub_taxon_string1_idx" ("input_string")*/CHECK (true), /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_scrub_record1" FOREIGN KEY ("id") REFERENCES "traceable" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_scrub_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_taxon_scrub_taxon_string1" FOREIGN KEY ("input_string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_scrub" -- /*!40000 ALTER TABLE "taxon_scrub" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_scrub" ENABLE KEYS */; -- -- Table structure for table "taxon_string" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "taxon_string" ( "string" text NOT NULL, PRIMARY KEY ("string") ) /*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)'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "taxon_string" -- /*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */; /*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */; -- -- Table structure for table "traceable" -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE "traceable" ( "id" text NOT NULL, "ids_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'*/, "source" text NOT NULL, "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.'*/, "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'*/, PRIMARY KEY ("id"), /*CONSTRAINT "traceable_unique" */UNIQUE ("source","id_within_source"), /*CONSTRAINT "traceable__id_by_source" */UNIQUE ("ids_by_source"), /*KEY "traceable_id_fkey1_idx" ("authors")*/CHECK (true), /*CONSTRAINT "traceable_id_fkey1" FOREIGN KEY ("authors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) ) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a row that can have associated source information'*/; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table "traceable" -- /*!40000 ALTER TABLE "traceable" DISABLE KEYS */; /*!40000 ALTER TABLE "traceable" ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed