Revision 10455
Added by Aaron Marcuse-Kubitza almost 11 years ago
VegCore.pg.sql | ||
---|---|---|
171 | 171 |
/*KEY "fk_event1_idx" ("parent")*/CHECK (true), |
172 | 172 |
/*KEY "fk_event_method1_idx" ("method")*/CHECK (true), |
173 | 173 |
/*KEY "fk_event_party_list1_idx" ("participants")*/CHECK (true), |
174 |
/*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
175 |
/*CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
174 |
/*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
176 | 175 |
/*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
177 | 176 |
/*CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
178 |
/*CONSTRAINT "fk_event_party_list1" FOREIGN KEY ("participants") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
177 |
/*CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
178 |
/*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
179 | 179 |
) /*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)'*/; |
180 | 180 |
/*!40101 SET character_set_client = @saved_cs_client */; |
181 | 181 |
|
... | ... | |
187 | 187 |
/*!40000 ALTER TABLE "event" ENABLE KEYS */; |
188 | 188 |
|
189 | 189 |
-- |
190 |
-- Table structure for table "event_participant" |
|
191 |
-- |
|
192 |
|
|
193 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
|
194 |
/*!40101 SET character_set_client = utf8 */; |
|
195 |
CREATE TABLE "event_participant" ( |
|
196 |
"event" text NOT NULL, |
|
197 |
"party" text NOT NULL, |
|
198 |
"sort_order" integer DEFAULT NULL, |
|
199 |
PRIMARY KEY ("event","party"), |
|
200 |
/*KEY "fk_event_has_party_party1_idx" ("party")*/CHECK (true), |
|
201 |
/*KEY "fk_event_has_party_event1_idx" ("event")*/CHECK (true), |
|
202 |
/*CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
203 |
/*CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
204 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; |
|
205 |
/*!40101 SET character_set_client = @saved_cs_client */; |
|
206 |
|
|
207 |
-- |
|
208 |
-- Dumping data for table "event_participant" |
|
209 |
-- |
|
210 |
|
|
211 |
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */; |
|
212 |
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */; |
|
213 |
|
|
214 |
-- |
|
215 | 190 |
-- Table structure for table "geological_context" |
216 | 191 |
-- |
217 | 192 |
|
... | ... | |
291 | 266 |
"traits" hstore DEFAULT NULL, |
292 | 267 |
PRIMARY KEY ("id"), |
293 | 268 |
/*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true), |
294 |
/*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
|
295 |
/*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
269 |
/*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
|
270 |
/*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
296 | 271 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An observation of an [[VegCore#Individual|Individual]]'*/; |
297 | 272 |
/*!40101 SET character_set_client = @saved_cs_client */; |
298 | 273 |
|
... | ... | |
385 | 360 |
"info" hstore DEFAULT NULL, |
386 | 361 |
PRIMARY KEY ("id"), |
387 | 362 |
/*KEY "fk_party_organization1_idx" ("organization")*/CHECK (true), |
388 |
/*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
|
389 |
/*CONSTRAINT "fk_party_organization1" FOREIGN KEY ("organization") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
363 |
/*CONSTRAINT "fk_party_organization1" FOREIGN KEY ("organization") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
|
364 |
/*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
390 | 365 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; |
391 | 366 |
/*!40101 SET character_set_client = @saved_cs_client */; |
392 | 367 |
|
... | ... | |
730 | 705 |
/*KEY "fk_specimen_collection2_idx" ("current_collection")*/CHECK (true), |
731 | 706 |
/*KEY "fk_specimen_organization3_idx" ("owner_collection")*/CHECK (true), |
732 | 707 |
/*KEY "fk_specimen_party_list1_idx" ("specimenholder_institutions")*/CHECK (true), |
733 |
/*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
734 |
/*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
735 | 708 |
/*CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
736 | 709 |
/*CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
737 | 710 |
/*CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
738 | 711 |
/*CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
739 |
/*CONSTRAINT "fk_specimen_party_list1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
712 |
/*CONSTRAINT "fk_specimen_party_list1" FOREIGN KEY ("specimenholder_institutions") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
713 |
/*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
714 |
/*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
740 | 715 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='A "part of a plant" ("Wikipedia":http://en.wikipedia.org/wiki/Specimen) which was collected from it'*/; |
741 | 716 |
/*!40101 SET character_set_client = @saved_cs_client */; |
742 | 717 |
|
... | ... | |
772 | 747 |
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */; |
773 | 748 |
|
774 | 749 |
-- |
775 |
-- Table structure for table "specimenholder_institution" |
|
776 |
-- |
|
777 |
|
|
778 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
|
779 |
/*!40101 SET character_set_client = utf8 */; |
|
780 |
CREATE TABLE "specimenholder_institution" ( |
|
781 |
"specimen" text NOT NULL, |
|
782 |
"institution" text NOT NULL, |
|
783 |
"sort_order" integer DEFAULT NULL, |
|
784 |
PRIMARY KEY ("specimen","institution"), |
|
785 |
/*KEY "fk_specimen_has_organization_organization1_idx" ("institution")*/CHECK (true), |
|
786 |
/*KEY "fk_specimen_has_organization_specimen1_idx" ("specimen")*/CHECK (true), |
|
787 |
/*CONSTRAINT "fk_specimen_has_organization_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
788 |
/*CONSTRAINT "fk_specimen_has_organization_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true) |
|
789 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; |
|
790 |
/*!40101 SET character_set_client = @saved_cs_client */; |
|
791 |
|
|
792 |
-- |
|
793 |
-- Dumping data for table "specimenholder_institution" |
|
794 |
-- |
|
795 |
|
|
796 |
/*!40000 ALTER TABLE "specimenholder_institution" DISABLE KEYS */; |
|
797 |
/*!40000 ALTER TABLE "specimenholder_institution" ENABLE KEYS */; |
|
798 |
|
|
799 |
-- |
|
800 | 750 |
-- Table structure for table "stem" |
801 | 751 |
-- |
802 | 752 |
|
... | ... | |
963 | 913 |
PRIMARY KEY ("id"), |
964 | 914 |
/*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"), |
965 | 915 |
/*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true), |
966 |
/*KEY "fk_taxon_determination_party1_idx" ("identified_by")*/CHECK (true), |
|
916 |
/*KEY "fk_taxon_determination_party_list1_idx" ("identified_by")*/CHECK (true),
|
|
967 | 917 |
/*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
968 | 918 |
/*CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
969 |
/*CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
919 |
/*CONSTRAINT "fk_taxon_determination_party_list1" FOREIGN KEY ("identified_by") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
970 | 920 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='An assertion that a [[VegCore#TaxonOccurrence|TaxonOccurrence]] is a particular [[VegCore#Taxon|Taxon]]'*/; |
971 | 921 |
/*!40101 SET character_set_client = @saved_cs_client */; |
972 | 922 |
|
... | ... | |
1014 | 964 |
CREATE TABLE "taxon_observation" ( |
1015 | 965 |
"id" text NOT NULL, |
1016 | 966 |
"taxon_occurrence" text NOT NULL, |
1017 |
"collector" text DEFAULT NULL, |
|
967 |
"collectors" text DEFAULT NULL,
|
|
1018 | 968 |
"collector_number" text DEFAULT NULL, |
1019 | 969 |
"voucher" text DEFAULT NULL, |
1020 | 970 |
"growth_form" text DEFAULT NULL, |
... | ... | |
1023 | 973 |
PRIMARY KEY ("id"), |
1024 | 974 |
/*KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence")*/CHECK (true), |
1025 | 975 |
/*KEY "fk_taxon_observation_specimen1_idx" ("voucher")*/CHECK (true), |
1026 |
/*KEY "fk_taxon_observation_party1_idx" ("collector")*/CHECK (true), |
|
976 |
/*KEY "fk_taxon_observation_party_list1_idx" ("collectors")*/CHECK (true), |
|
977 |
/*CONSTRAINT "fk_taxon_observation_party_list1" FOREIGN KEY ("collectors") REFERENCES "party_list" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
1027 | 978 |
/*CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
1028 |
/*CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
|
1029 | 979 |
/*CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true), |
1030 |
/*CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
980 |
/*CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
|
1031 | 981 |
) /*ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin*/; |
1032 | 982 |
/*!40101 SET character_set_client = @saved_cs_client */; |
1033 | 983 |
|
Also available in: Unified diff
schemas/VegCore/VegCore.ERD.mwb: collector, identified_by: allow multiple parties for these fields, using the new party_list array table