Project

General

Profile

« Previous | Next » 

Revision 592

vegbien.sql: taxonbinmethod points to stratumtype instead of stratum because stratumtype is a method table, but stratum is a measurements table. stratum does not point directly to stratummethod because it points to it via stratumtype.

View differences:

vegbien.sql
2363 2363
    stratum_id integer NOT NULL,
2364 2364
    locationevent_id integer NOT NULL,
2365 2365
    stratumtype_id integer NOT NULL,
2366
    stratummethod_id integer,
2367 2366
    stratumname character varying(30),
2368 2367
    stratumheight double precision,
2369 2368
    stratumbase double precision,
......
2497 2496
CREATE TABLE taxonbinmethod (
2498 2497
    taxonbinmethod_id integer NOT NULL,
2499 2498
    label character varying(255),
2500
    stratum_id integer,
2499
    stratumtype_id integer,
2501 2500
    sizeclass_id integer,
2502 2501
    coverindex_id integer,
2503 2502
    accessioncode character varying(255)
......
5059 5058

  
5060 5059

  
5061 5060
--
5061
-- Name: fki_taxonbinmethod_stratumtype_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5062
--
5063

  
5064
CREATE INDEX fki_taxonbinmethod_stratumtype_id ON taxonbinmethod USING btree (stratumtype_id);
5065

  
5066

  
5067
--
5062 5068
-- Name: graphic_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5063 5069
--
5064 5070

  
......
5584 5590

  
5585 5591

  
5586 5592
--
5587
-- Name: stratum_stratummethod_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5588
--
5589

  
5590
CREATE INDEX stratum_stratummethod_id_x ON stratum USING btree (stratummethod_id);
5591

  
5592

  
5593
--
5594 5593
-- Name: stratum_stratumtype_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5595 5594
--
5596 5595

  
......
5636 5635
-- Name: taxonbinmethod_keys; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5637 5636
--
5638 5637

  
5639
CREATE UNIQUE INDEX taxonbinmethod_keys ON taxonbinmethod USING btree ((COALESCE(label, ''::character varying)), stratum_id, sizeclass_id, coverindex_id);
5638
CREATE UNIQUE INDEX taxonbinmethod_keys ON taxonbinmethod USING btree ((COALESCE(label, ''::character varying)), stratumtype_id, sizeclass_id, coverindex_id);
5640 5639

  
5641 5640

  
5642 5641
--
......
6588 6587

  
6589 6588

  
6590 6589
--
6591
-- Name: stratum_stratummethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6592
--
6593

  
6594
ALTER TABLE ONLY stratum
6595
    ADD CONSTRAINT stratum_stratummethod_id FOREIGN KEY (stratummethod_id) REFERENCES stratummethod(stratummethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
6596

  
6597

  
6598
--
6599 6590
-- Name: stratum_stratumtype_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6600 6591
--
6601 6592

  
......
6644 6635

  
6645 6636

  
6646 6637
--
6638
-- Name: taxonbinmethod_stratumtype_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6639
--
6640

  
6641
ALTER TABLE ONLY taxonbinmethod
6642
    ADD CONSTRAINT taxonbinmethod_stratumtype_id FOREIGN KEY (stratumtype_id) REFERENCES stratumtype(stratumtype_id) ON UPDATE CASCADE ON DELETE CASCADE;
6643

  
6644

  
6645
--
6647 6646
-- Name: taxondetermination_party_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6648 6647
--
6649 6648

  

Also available in: Unified diff