Project

General

Profile

« Previous | Next » 

Revision 526

vegbien.sql: Removed no longer needed taxondetermination.individualplant_id, specimen_id fields

View differences:

schemas/vegbien.sql
2508 2508

  
2509 2509
CREATE TABLE taxondetermination (
2510 2510
    taxondetermination_id integer NOT NULL,
2511
    taxonoccurrence_id integer,
2512
    individualplant_id integer,
2511
    taxonoccurrence_id integer NOT NULL,
2513 2512
    plantconcept_id integer,
2514 2513
    plantname_id integer NOT NULL,
2515 2514
    party_id integer NOT NULL,
......
2527 2526
    revisions boolean,
2528 2527
    determinationdate timestamp with time zone NOT NULL,
2529 2528
    emb_taxondetermination integer,
2530
    accessioncode character varying(255),
2531
    specimen_id integer,
2532
    CONSTRAINT taxondetermination_required_keys CHECK ((((taxonoccurrence_id IS NOT NULL) OR (individualplant_id IS NOT NULL)) OR (specimen_id IS NOT NULL)))
2529
    accessioncode character varying(255)
2533 2530
);
2534 2531

  
2535 2532

  
......
4362 4359

  
4363 4360

  
4364 4361
--
4365
-- Name: taxondetermination_keys_individualplant_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4366
--
4367

  
4368
ALTER TABLE ONLY taxondetermination
4369
    ADD CONSTRAINT taxondetermination_keys_individualplant_id UNIQUE (individualplant_id, role_id, plantname_id);
4370

  
4371

  
4372
--
4373
-- Name: taxondetermination_keys_specimen_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4374
--
4375

  
4376
ALTER TABLE ONLY taxondetermination
4377
    ADD CONSTRAINT taxondetermination_keys_specimen_id UNIQUE (specimen_id, role_id, plantname_id);
4378

  
4379

  
4380
--
4381 4362
-- Name: taxondetermination_keys_taxonoccurrence_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4382 4363
--
4383 4364

  
......
4922 4903

  
4923 4904

  
4924 4905
--
4925
-- Name: fki_r10taxondetermination_specimen_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4926
--
4927

  
4928
CREATE INDEX fki_r10taxondetermination_specimen_id ON taxondetermination USING btree (specimen_id);
4929

  
4930

  
4931
--
4932 4906
-- Name: fki_specimen_collector_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4933 4907
--
4934 4908

  
......
4957 4931

  
4958 4932

  
4959 4933
--
4960
-- Name: fki_taxondetermination_individualplant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4961
--
4962

  
4963
CREATE INDEX fki_taxondetermination_individualplant_id ON taxondetermination USING btree (individualplant_id);
4964

  
4965

  
4966
--
4967 4934
-- Name: graphic_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4968 4935
--
4969 4936

  
......
5580 5547

  
5581 5548

  
5582 5549
--
5583
-- Name: taxondetermination_stem_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5584
--
5585

  
5586
CREATE INDEX taxondetermination_stem_id_x ON taxondetermination USING btree (individualplant_id);
5587

  
5588

  
5589
--
5590 5550
-- Name: taxondetermination_taxonoccurrence_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5591 5551
--
5592 5552

  
......
6556 6516

  
6557 6517

  
6558 6518
--
6559
-- Name: taxondetermination_individualplant_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6560
--
6561

  
6562
ALTER TABLE ONLY taxondetermination
6563
    ADD CONSTRAINT taxondetermination_individualplant_id FOREIGN KEY (individualplant_id) REFERENCES individualplant(individualplant_id) ON UPDATE CASCADE ON DELETE CASCADE;
6564

  
6565

  
6566
--
6567 6519
-- Name: taxondetermination_party_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6568 6520
--
6569 6521

  
......
6604 6556

  
6605 6557

  
6606 6558
--
6607
-- Name: taxondetermination_specimen_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6608
--
6609

  
6610
ALTER TABLE ONLY taxondetermination
6611
    ADD CONSTRAINT taxondetermination_specimen_id FOREIGN KEY (specimen_id) REFERENCES specimen(specimen_id) ON UPDATE CASCADE ON DELETE CASCADE;
6612

  
6613

  
6614
--
6615 6559
-- Name: taxondetermination_taxonoccurrence_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6616 6560
--
6617 6561

  

Also available in: Unified diff