Project

General

Profile

« Previous | Next » 

Revision 1329

vegbien.sql: Moved scope_id from plantconcept to plantname, since plantnames themselves are scoped, not just the plantconcepts that use them (e.g. "sp. 1" has different meanings in different scopes, so it should not be shared between scopes). plantname: Added accessioncode.

View differences:

vegbien.my.sql
1347 1347
CREATE TABLE plantconcept (
1348 1348
    plantconcept_id int(11) NOT NULL,
1349 1349
    parent_id int(11),
1350
    scope_id int(11),
1351 1350
    plantname_id int(11) NOT NULL,
1352 1351
    plantcode text,
1353 1352
    plantdescription text,
......
1458 1457

  
1459 1458
CREATE TABLE plantname (
1460 1459
    plantname_id int(11) NOT NULL,
1460
    scope_id int(11),
1461
    rank text NOT NULL,
1461 1462
    plantname text NOT NULL,
1462
    rank text NOT NULL
1463
    accessioncode text
1463 1464
);
1464 1465

  
1465 1466

  
......
3934 3935

  
3935 3936

  
3936 3937
--
3937
-- Name: fki_plantconcept_scope_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3938
--
3939

  
3940
CREATE INDEX fki_plantconcept_scope_id ON plantconcept  (scope_id);
3941

  
3942

  
3943
--
3944 3938
-- Name: fki_plantconceptscope_locationevent_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3945 3939
--
3946 3940

  
......
3962 3956

  
3963 3957

  
3964 3958
--
3959
-- Name: fki_plantname_scope_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3960
--
3961

  
3962
CREATE INDEX fki_plantname_scope_id ON plantname  (scope_id);
3963

  
3964

  
3965
--
3965 3966
-- Name: fki_plantobservation_plant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3966 3967
--
3967 3968

  
......
5226 5227

  
5227 5228

  
5228 5229
--
5229
-- Name: plantconcept_scope_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5230
--
5231

  
5232
ALTER TABLE plantconcept
5233
    ADD CONSTRAINT plantconcept_scope_id FOREIGN KEY (scope_id) REFERENCES plantconceptscope(plantconceptscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5234

  
5235

  
5236
--
5237 5230
-- Name: plantconceptscope_locationevent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5238 5231
--
5239 5232

  
......
5290 5283

  
5291 5284

  
5292 5285
--
5286
-- Name: plantname_scope_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5287
--
5288

  
5289
ALTER TABLE plantname
5290
    ADD CONSTRAINT plantname_scope_id FOREIGN KEY (scope_id) REFERENCES plantconceptscope(plantconceptscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
5291

  
5292

  
5293
--
5293 5294
-- Name: plantobservation_plant_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5294 5295
--
5295 5296

  

Also available in: Unified diff