537 |
537 |
taxonlabel_id integer NOT NULL,
|
538 |
538 |
creator_id integer NOT NULL,
|
539 |
539 |
sourceaccessioncode text,
|
540 |
|
concept_reference_id integer,
|
541 |
540 |
creationdate date,
|
542 |
541 |
taxonstatus taxonomic_status,
|
543 |
542 |
canon_label_id integer,
|
... | ... | |
558 |
557 |
description text,
|
559 |
558 |
accessioncode text,
|
560 |
559 |
CONSTRAINT taxonlabel_matched_label_fit_fraction_range CHECK (((matched_label_fit_fraction >= (0)::double precision) AND (matched_label_fit_fraction <= (1)::double precision))),
|
561 |
|
CONSTRAINT taxonlabel_required_key CHECK ((((((((sourceaccessioncode IS NOT NULL) OR (taxonepithet IS NOT NULL)) OR (identifyingtaxonomicname IS NOT NULL)) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (morphospecies IS NOT NULL)) OR ((parent_id IS NOT NULL) AND (((concept_reference_id IS NOT NULL) OR (creationdate IS NOT NULL)) OR (author IS NOT NULL)))))
|
|
560 |
CONSTRAINT taxonlabel_required_key CHECK ((((((((sourceaccessioncode IS NOT NULL) OR (taxonepithet IS NOT NULL)) OR (identifyingtaxonomicname IS NOT NULL)) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (morphospecies IS NOT NULL)) OR ((parent_id IS NOT NULL) AND ((creationdate IS NOT NULL) OR (author IS NOT NULL)))))
|
562 |
561 |
);
|
563 |
562 |
|
564 |
563 |
|
... | ... | |
592 |
591 |
|
593 |
592 |
|
594 |
593 |
--
|
595 |
|
-- Name: COLUMN taxonlabel.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
|
596 |
|
--
|
597 |
|
|
598 |
|
COMMENT ON COLUMN taxonlabel.concept_reference_id IS 'The entity that defined the taxon concept. This is who the taxon label is according to.
|
599 |
|
|
600 |
|
Equivalent to "Name sec. x".';
|
601 |
|
|
602 |
|
|
603 |
|
--
|
604 |
594 |
-- Name: COLUMN taxonlabel.creationdate; Type: COMMENT; Schema: public; Owner: -
|
605 |
595 |
--
|
606 |
596 |
|
... | ... | |
3103 |
3093 |
|
3104 |
3094 |
|
3105 |
3095 |
--
|
|
3096 |
-- Name: taxonconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
3097 |
--
|
|
3098 |
|
|
3099 |
CREATE TABLE taxonconcept (
|
|
3100 |
taxonlabel_id integer NOT NULL,
|
|
3101 |
concept_reference_id integer
|
|
3102 |
);
|
|
3103 |
|
|
3104 |
|
|
3105 |
--
|
|
3106 |
-- Name: TABLE taxonconcept; Type: COMMENT; Schema: public; Owner: -
|
|
3107 |
--
|
|
3108 |
|
|
3109 |
COMMENT ON TABLE taxonconcept IS 'A circumscribed taxon concept. This extends taxonlabel with information about who the taxon concept is according to.';
|
|
3110 |
|
|
3111 |
|
|
3112 |
--
|
|
3113 |
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
|
|
3114 |
--
|
|
3115 |
|
|
3116 |
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The entity that defined the taxon concept. This is who the taxon concept is according to.
|
|
3117 |
|
|
3118 |
Equivalent to "Name sec. x".';
|
|
3119 |
|
|
3120 |
|
|
3121 |
--
|
|
3122 |
-- Name: taxonconcept_taxonlabel_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3123 |
--
|
|
3124 |
|
|
3125 |
CREATE SEQUENCE taxonconcept_taxonlabel_id_seq
|
|
3126 |
START WITH 1
|
|
3127 |
INCREMENT BY 1
|
|
3128 |
NO MINVALUE
|
|
3129 |
NO MAXVALUE
|
|
3130 |
CACHE 1;
|
|
3131 |
|
|
3132 |
|
|
3133 |
--
|
|
3134 |
-- Name: taxonconcept_taxonlabel_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3135 |
--
|
|
3136 |
|
|
3137 |
ALTER SEQUENCE taxonconcept_taxonlabel_id_seq OWNED BY taxonconcept.taxonlabel_id;
|
|
3138 |
|
|
3139 |
|
|
3140 |
--
|
3106 |
3141 |
-- Name: taxoncorrelation; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
3107 |
3142 |
--
|
3108 |
3143 |
|
... | ... | |
3746 |
3781 |
|
3747 |
3782 |
|
3748 |
3783 |
--
|
|
3784 |
-- Name: taxonlabel_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3785 |
--
|
|
3786 |
|
|
3787 |
ALTER TABLE taxonconcept ALTER COLUMN taxonlabel_id SET DEFAULT nextval('taxonconcept_taxonlabel_id_seq'::regclass);
|
|
3788 |
|
|
3789 |
|
|
3790 |
--
|
3749 |
3791 |
-- Name: taxoncorrelation_id; Type: DEFAULT; Schema: public; Owner: -
|
3750 |
3792 |
--
|
3751 |
3793 |
|
... | ... | |
4272 |
4314 |
|
4273 |
4315 |
|
4274 |
4316 |
--
|
|
4317 |
-- Name: taxonconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4318 |
--
|
|
4319 |
|
|
4320 |
ALTER TABLE ONLY taxonconcept
|
|
4321 |
ADD CONSTRAINT taxonconcept_pkey PRIMARY KEY (taxonlabel_id);
|
|
4322 |
|
|
4323 |
|
|
4324 |
--
|
4275 |
4325 |
-- Name: taxoncorrelation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
4276 |
4326 |
--
|
4277 |
4327 |
|
... | ... | |
4779 |
4829 |
-- Name: taxonlabel_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
4780 |
4830 |
--
|
4781 |
4831 |
|
4782 |
|
CREATE UNIQUE INDEX taxonlabel_unique ON taxonlabel USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonepithet, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(sourceaccessioncode, '\\N'::text)), (COALESCE(concept_reference_id, 2147483647)), (COALESCE(creationdate, 'infinity'::date)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)));
|
|
4832 |
CREATE UNIQUE INDEX taxonlabel_unique ON taxonlabel USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonepithet, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(sourceaccessioncode, '\\N'::text)), (COALESCE(creationdate, 'infinity'::date)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)));
|
4783 |
4833 |
|
4784 |
4834 |
|
4785 |
4835 |
--
|
... | ... | |
5671 |
5721 |
|
5672 |
5722 |
|
5673 |
5723 |
--
|
|
5724 |
-- Name: taxonconcept_concept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5725 |
--
|
|
5726 |
|
|
5727 |
ALTER TABLE ONLY taxonconcept
|
|
5728 |
ADD CONSTRAINT taxonconcept_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5729 |
|
|
5730 |
|
|
5731 |
--
|
|
5732 |
-- Name: taxonconcept_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5733 |
--
|
|
5734 |
|
|
5735 |
ALTER TABLE ONLY taxonconcept
|
|
5736 |
ADD CONSTRAINT taxonconcept_taxonlabel_id_fkey FOREIGN KEY (taxonlabel_id) REFERENCES taxonlabel(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5737 |
|
|
5738 |
|
|
5739 |
--
|
5674 |
5740 |
-- Name: taxoncorrelation_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
5675 |
5741 |
--
|
5676 |
5742 |
|
... | ... | |
5727 |
5793 |
|
5728 |
5794 |
|
5729 |
5795 |
--
|
5730 |
|
-- Name: taxonlabel_concept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
5731 |
|
--
|
5732 |
|
|
5733 |
|
ALTER TABLE ONLY taxonlabel
|
5734 |
|
ADD CONSTRAINT taxonlabel_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
5735 |
|
|
5736 |
|
|
5737 |
|
--
|
5738 |
5796 |
-- Name: taxonlabel_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
5739 |
5797 |
--
|
5740 |
5798 |
|
schemas/vegbien.sql: Moved taxonlabel.concept_reference_id to new taxonconcept table, which is a subclass of taxonlabel that adds information about who the taxon concept is according to