Revision 5231
Added by Aaron Marcuse-Kubitza about 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
2589 | 2589 |
|
2590 | 2590 |
|
2591 | 2591 |
-- |
2592 |
-- Name: taxonscope; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
2593 |
-- |
|
2594 |
|
|
2595 |
CREATE TABLE taxonscope ( |
|
2596 |
taxonscope_id int(11) NOT NULL, |
|
2597 |
locationevent_id int(11), |
|
2598 |
project_id int(11), |
|
2599 |
place_id int(11) |
|
2600 |
); |
|
2601 |
|
|
2602 |
|
|
2603 |
-- |
|
2604 |
-- Name: TABLE taxonscope; Type: COMMENT; Schema: public; Owner: - |
|
2605 |
-- |
|
2606 |
|
|
2607 |
|
|
2608 |
|
|
2609 |
|
|
2610 |
-- |
|
2611 |
-- Name: taxonscope_taxonscope_id_seq; Type: SEQUENCE; Schema: public; Owner: - |
|
2612 |
-- |
|
2613 |
|
|
2614 |
|
|
2615 |
|
|
2616 |
|
|
2617 |
-- |
|
2618 |
-- Name: taxonscope_taxonscope_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - |
|
2619 |
-- |
|
2620 |
|
|
2621 |
|
|
2622 |
|
|
2623 |
|
|
2624 |
-- |
|
2625 | 2592 |
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace: |
2626 | 2593 |
-- |
2627 | 2594 |
|
... | ... | |
3121 | 3088 |
|
3122 | 3089 |
|
3123 | 3090 |
-- |
3124 |
-- Name: taxonscope_id; Type: DEFAULT; Schema: public; Owner: - |
|
3125 |
-- |
|
3126 |
|
|
3127 |
|
|
3128 |
|
|
3129 |
|
|
3130 |
-- |
|
3131 | 3091 |
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: - |
3132 | 3092 |
-- |
3133 | 3093 |
|
... | ... | |
3692 | 3652 |
|
3693 | 3653 |
|
3694 | 3654 |
-- |
3695 |
-- Name: taxonscope_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3696 |
-- |
|
3697 |
|
|
3698 |
ALTER TABLE taxonscope |
|
3699 |
ADD CONSTRAINT taxonscope_pkey PRIMARY KEY (taxonscope_id); |
|
3700 |
|
|
3701 |
|
|
3702 |
-- |
|
3703 | 3655 |
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3704 | 3656 |
-- |
3705 | 3657 |
|
... | ... | |
4161 | 4113 |
|
4162 | 4114 |
|
4163 | 4115 |
-- |
4164 |
-- Name: taxonscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4165 |
-- |
|
4166 |
|
|
4167 |
|
|
4168 |
|
|
4169 |
|
|
4170 |
-- |
|
4171 | 4116 |
-- Name: userdefined_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4172 | 4117 |
-- |
4173 | 4118 |
|
... | ... | |
5079 | 5024 |
-- Name: taxonconcept_concept_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5080 | 5025 |
-- |
5081 | 5026 |
|
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; |
|
5084 | 5027 |
|
5085 | 5028 |
|
5029 |
|
|
5086 | 5030 |
-- |
5087 | 5031 |
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5088 | 5032 |
-- |
... | ... | |
5144 | 5088 |
|
5145 | 5089 |
|
5146 | 5090 |
-- |
5147 |
-- Name: taxonscope_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5148 |
-- |
|
5149 |
|
|
5150 |
|
|
5151 |
|
|
5152 |
|
|
5153 |
-- |
|
5154 |
-- Name: taxonscope_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5155 |
-- |
|
5156 |
|
|
5157 |
|
|
5158 |
|
|
5159 |
|
|
5160 |
-- |
|
5161 |
-- Name: taxonscope_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5162 |
-- |
|
5163 |
|
|
5164 |
|
|
5165 |
|
|
5166 |
|
|
5167 |
-- |
|
5168 | 5091 |
-- Name: telephone_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5169 | 5092 |
-- |
5170 | 5093 |
|
schemas/vegbien.sql | ||
---|---|---|
1277 | 1277 |
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: - |
1278 | 1278 |
-- |
1279 | 1279 |
|
1280 |
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The morphospecies scope.';
|
|
1280 |
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The entity that defined the taxon concept.';
|
|
1281 | 1281 |
|
1282 | 1282 |
|
1283 | 1283 |
-- |
... | ... | |
3206 | 3206 |
|
3207 | 3207 |
|
3208 | 3208 |
-- |
3209 |
-- Name: taxonscope; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
3210 |
-- |
|
3211 |
|
|
3212 |
CREATE TABLE taxonscope ( |
|
3213 |
taxonscope_id integer NOT NULL, |
|
3214 |
locationevent_id integer, |
|
3215 |
project_id integer, |
|
3216 |
place_id integer, |
|
3217 |
CONSTRAINT taxonscope_required_key CHECK ((((locationevent_id IS NOT NULL) OR (project_id IS NOT NULL)) OR (place_id IS NOT NULL))) |
|
3218 |
); |
|
3219 |
|
|
3220 |
|
|
3221 |
-- |
|
3222 |
-- Name: TABLE taxonscope; Type: COMMENT; Schema: public; Owner: - |
|
3223 |
-- |
|
3224 |
|
|
3225 |
COMMENT ON TABLE taxonscope IS 'The scope of a morphospecies name.'; |
|
3226 |
|
|
3227 |
|
|
3228 |
-- |
|
3229 |
-- Name: taxonscope_taxonscope_id_seq; Type: SEQUENCE; Schema: public; Owner: - |
|
3230 |
-- |
|
3231 |
|
|
3232 |
CREATE SEQUENCE taxonscope_taxonscope_id_seq |
|
3233 |
START WITH 1 |
|
3234 |
INCREMENT BY 1 |
|
3235 |
NO MINVALUE |
|
3236 |
NO MAXVALUE |
|
3237 |
CACHE 1; |
|
3238 |
|
|
3239 |
|
|
3240 |
-- |
|
3241 |
-- Name: taxonscope_taxonscope_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - |
|
3242 |
-- |
|
3243 |
|
|
3244 |
ALTER SEQUENCE taxonscope_taxonscope_id_seq OWNED BY taxonscope.taxonscope_id; |
|
3245 |
|
|
3246 |
|
|
3247 |
-- |
|
3248 | 3209 |
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace: |
3249 | 3210 |
-- |
3250 | 3211 |
|
... | ... | |
3764 | 3725 |
|
3765 | 3726 |
|
3766 | 3727 |
-- |
3767 |
-- Name: taxonscope_id; Type: DEFAULT; Schema: public; Owner: - |
|
3768 |
-- |
|
3769 |
|
|
3770 |
ALTER TABLE taxonscope ALTER COLUMN taxonscope_id SET DEFAULT nextval('taxonscope_taxonscope_id_seq'::regclass); |
|
3771 |
|
|
3772 |
|
|
3773 |
-- |
|
3774 | 3728 |
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: - |
3775 | 3729 |
-- |
3776 | 3730 |
|
... | ... | |
4335 | 4289 |
|
4336 | 4290 |
|
4337 | 4291 |
-- |
4338 |
-- Name: taxonscope_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4339 |
-- |
|
4340 |
|
|
4341 |
ALTER TABLE ONLY taxonscope |
|
4342 |
ADD CONSTRAINT taxonscope_pkey PRIMARY KEY (taxonscope_id); |
|
4343 |
|
|
4344 |
|
|
4345 |
-- |
|
4346 | 4292 |
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4347 | 4293 |
-- |
4348 | 4294 |
|
... | ... | |
4804 | 4750 |
|
4805 | 4751 |
|
4806 | 4752 |
-- |
4807 |
-- Name: taxonscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4808 |
-- |
|
4809 |
|
|
4810 |
CREATE UNIQUE INDEX taxonscope_unique ON taxonscope USING btree ((COALESCE(locationevent_id, 2147483647)), (COALESCE(project_id, 2147483647)), (COALESCE(place_id, 2147483647))); |
|
4811 |
|
|
4812 |
|
|
4813 |
-- |
|
4814 | 4753 |
-- Name: userdefined_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4815 | 4754 |
-- |
4816 | 4755 |
|
... | ... | |
5761 | 5700 |
-- |
5762 | 5701 |
|
5763 | 5702 |
ALTER TABLE ONLY taxonconcept |
5764 |
ADD CONSTRAINT taxonconcept_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5703 |
ADD CONSTRAINT taxonconcept_concept_reference_id_fkey FOREIGN KEY (concept_reference_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5765 | 5704 |
|
5766 | 5705 |
|
5767 | 5706 |
-- |
... | ... | |
5829 | 5768 |
|
5830 | 5769 |
|
5831 | 5770 |
-- |
5832 |
-- Name: taxonscope_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5833 |
-- |
|
5834 |
|
|
5835 |
ALTER TABLE ONLY taxonscope |
|
5836 |
ADD CONSTRAINT taxonscope_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
5837 |
|
|
5838 |
|
|
5839 |
-- |
|
5840 |
-- Name: taxonscope_place_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5841 |
-- |
|
5842 |
|
|
5843 |
ALTER TABLE ONLY taxonscope |
|
5844 |
ADD CONSTRAINT taxonscope_place_id_fkey FOREIGN KEY (place_id) REFERENCES place(place_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
5845 |
|
|
5846 |
|
|
5847 |
-- |
|
5848 |
-- Name: taxonscope_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5849 |
-- |
|
5850 |
|
|
5851 |
ALTER TABLE ONLY taxonscope |
|
5852 |
ADD CONSTRAINT taxonscope_project_id_fkey FOREIGN KEY (project_id) REFERENCES project(project_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
5853 |
|
|
5854 |
|
|
5855 |
-- |
|
5856 | 5771 |
-- Name: telephone_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5857 | 5772 |
-- |
5858 | 5773 |
|
Also available in: Unified diff
schemas/vegbien.sql: concept_reference_id: Made it an fkey to party instead of taxonscope, because this is now the entity that defined the taxon concept, and is no longer specific to morphospecies. Removed no longer used table taxonscope.