Project

General

Profile

« Previous | Next » 

Revision 7623

inputs/NY/Ecatalog_all/create.sql: primary key: Combine table, key into one value so that the primary key has a single column. This is necessary because multi-column primary keys are not supported by the import algorithm.

View differences:

inputs/NY/Ecatalog_all/create.sql
1
SELECT 'Ecatalog_LatLong' AS "table", * FROM "Ecatalog_LatLong"
1
-- key is unique only within each Ecatalog* table
2
SELECT ('Ecatalog_LatLong', key)::pkey AS pkey, * FROM "Ecatalog_LatLong"
2 3
UNION ALL
3
SELECT 'Ecatalog' AS "table", * FROM "Ecatalog"
4
SELECT ('Ecatalog', key)::pkey AS pkey, * FROM "Ecatalog"
4 5
;
5 6

  
6
-- key is unique only within each Ecatalog* table.
7
-- UniqueNYInternalRecordNumber is sometimes duplicated.
8
ALTER TABLE :table ADD PRIMARY KEY ("table", "key");
7
-- UniqueNYInternalRecordNumber is sometimes duplicated
8
ALTER TABLE :table ADD PRIMARY KEY (pkey);
inputs/NY/Ecatalog_all/header.csv
1
table,key,DateLastModified,InstitutionCode,CollectionCode,CatalogNumber,ScientificName,BasisOfRecord,Kingdom,Phylum,Class,Order,Family,Genus,Species,Subspecies,ScientificNameAuthor,IdentifiedBy,YearIdentified,MonthIdentified,DayIdentified,TypeStatus,CollectorNumber,FieldNumber,Collector,YearCollected,MonthCollected,DayCollected,JulianDay,TimeOfDay,ContinentOcean,Country,StateProvince,County,Locality,Longitude,Latitude,CoordinatePrecision,BoundingBox,MinimumElevation,MaximumElevation,MinimumDepth,MaximumDepth,Sex,PreparationType,IndividualCount,PreviousCatalogNumber,RelationshipType,RelatedCatalogItem,Notes,Habitat,PlantFungDescription,Substrate,Vegetation,UniqueNYInternalRecordNumber
1
pkey,key,DateLastModified,InstitutionCode,CollectionCode,CatalogNumber,ScientificName,BasisOfRecord,Kingdom,Phylum,Class,Order,Family,Genus,Species,Subspecies,ScientificNameAuthor,IdentifiedBy,YearIdentified,MonthIdentified,DayIdentified,TypeStatus,CollectorNumber,FieldNumber,Collector,YearCollected,MonthCollected,DayCollected,JulianDay,TimeOfDay,ContinentOcean,Country,StateProvince,County,Locality,Longitude,Latitude,CoordinatePrecision,BoundingBox,MinimumElevation,MaximumElevation,MinimumDepth,MaximumDepth,Sex,PreparationType,IndividualCount,PreviousCatalogNumber,RelationshipType,RelatedCatalogItem,Notes,Habitat,PlantFungDescription,Substrate,Vegetation,UniqueNYInternalRecordNumber
inputs/NY/Ecatalog_all/map.csv
1 1
NY,VegCore,Filter,Comments
2
table,OMIT,,"CatalogNumber, etc. is a better pkey"
2
pkey,OMIT,,"CatalogNumber, etc. is a better pkey"
3 3
key,OMIT,,"CatalogNumber, etc. is a better pkey"
4 4
DateLastModified,modified,,
5 5
InstitutionCode,custodialInstitutions,,
inputs/NY/Ecatalog_all/VegBIEN.csv
90 90
TypeStatus,,** No join mapping for typeStatus ** 
91 91
UniqueNYInternalRecordNumber,,** No non-empty join mapping for OMIT ** Sometimes duplicated. Omitted to avoid confusion since this is an internal-only ID.
92 92
key,,"** No non-empty join mapping for OMIT ** CatalogNumber, etc. is a better pkey"
93
table,,"** No non-empty join mapping for OMIT ** CatalogNumber, etc. is a better pkey"
93
pkey,,"** No non-empty join mapping for OMIT ** CatalogNumber, etc. is a better pkey"
inputs/NY/Ecatalog_all/new_terms.csv
1
table,OMIT,,"CatalogNumber, etc. is a better pkey"
1
pkey,OMIT,,"CatalogNumber, etc. is a better pkey"
2 2
key,OMIT,,"CatalogNumber, etc. is a better pkey"
3 3
CoordinatePrecision,coordinateUncertaintyInMeters,,"Usage inconsistent with DwC definition, which only allows degrees. Assuming units based on the range and precision of values."
4 4
PlantFungDescription,organismNotes,"/_join/2/_label[label=""plant fungus""]/value",

Also available in: Unified diff