Project

General

Profile

« Previous | Next » 

Revision 5228

schemas/vegbien.sql: taxonconcept: Renamed scope_id -> concept_reference_id as part of taxonomic schema refactoring at <https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/2012-10-03_conference_call#Taxonomic-schema-refactoring>

View differences:

schemas/vegbien.my.sql
786 786
    cultivar text,
787 787
    morphospecies text,
788 788
    otherranks text,
789
    scope_id int(11),
789
    concept_reference_id int(11),
790 790
    accessioncode text
791 791
);
792 792

  
......
939 939

  
940 940

  
941 941
--
942
-- Name: COLUMN taxonconcept.scope_id; Type: COMMENT; Schema: public; Owner: -
942
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
943 943
--
944 944

  
945 945

  
......
5076 5076

  
5077 5077

  
5078 5078
--
5079
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5079
-- Name: taxonconcept_concept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5080 5080
--
5081 5081

  
5082
ALTER TABLE taxonconcept
5083
    ADD CONSTRAINT taxonconcept_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5082 5084

  
5083 5085

  
5084

  
5085 5086
--
5086
-- Name: taxonconcept_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5087
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5087 5088
--
5088 5089

  
5089
ALTER TABLE taxonconcept
5090
    ADD CONSTRAINT taxonconcept_scope_id_fkey FOREIGN KEY (scope_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5091 5090

  
5092 5091

  
5092

  
5093 5093
--
5094 5094
-- Name: taxonconcept_taxon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5095 5095
--
schemas/vegbien.sql
1107 1107
    cultivar text,
1108 1108
    morphospecies text,
1109 1109
    otherranks rankedtaxonname[],
1110
    scope_id integer,
1110
    concept_reference_id integer,
1111 1111
    accessioncode text,
1112 1112
    CONSTRAINT taxonconcept_required_key CHECK (((((((identifyingtaxonomicname IS NOT NULL) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (family IS NOT NULL)) OR (genus IS NOT NULL)) OR (otherranks IS NOT NULL)))
1113 1113
);
......
1272 1272

  
1273 1273

  
1274 1274
--
1275
-- Name: COLUMN taxonconcept.scope_id; Type: COMMENT; Schema: public; Owner: -
1275
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
1276 1276
--
1277 1277

  
1278
COMMENT ON COLUMN taxonconcept.scope_id IS 'The morphospecies scope.';
1278
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The morphospecies scope.';
1279 1279

  
1280 1280

  
1281 1281
--
......
4756 4756
-- Name: taxonconcept_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4757 4757
--
4758 4758

  
4759
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_name ON taxonconcept USING btree (datasource_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[])), (COALESCE(scope_id, 2147483647))) WHERE (identifyingtaxonomicname IS NULL);
4759
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_name ON taxonconcept USING btree (datasource_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[])), (COALESCE(concept_reference_id, 2147483647))) WHERE (identifyingtaxonomicname IS NULL);
4760 4760

  
4761 4761

  
4762 4762
--
......
5755 5755

  
5756 5756

  
5757 5757
--
5758
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5758
-- Name: taxonconcept_concept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5759 5759
--
5760 5760

  
5761 5761
ALTER TABLE ONLY taxonconcept
5762
    ADD CONSTRAINT taxonconcept_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5762
    ADD CONSTRAINT taxonconcept_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5763 5763

  
5764 5764

  
5765 5765
--
5766
-- Name: taxonconcept_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5766
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5767 5767
--
5768 5768

  
5769 5769
ALTER TABLE ONLY taxonconcept
5770
    ADD CONSTRAINT taxonconcept_scope_id_fkey FOREIGN KEY (scope_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5770
    ADD CONSTRAINT taxonconcept_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5771 5771

  
5772 5772

  
5773 5773
--

Also available in: Unified diff