Project

General

Profile

« Previous | Next » 

Revision 1032

vegbien.sql: Added plotmethod. locationevent points to plotmethod instead of directly to method

View differences:

vegbien.my.sql
1080 1080
    sourceaccessioncode text,
1081 1081
    previous_id int(11),
1082 1082
    dateaccuracy text,
1083
    method_id int(11),
1083
    plotmethod_id int(11),
1084 1084
    methodnarrative text,
1085 1085
    taxonoccurrencearea double precision,
1086 1086
    coverdispersion text,
......
1775 1775

  
1776 1776

  
1777 1777
--
1778
-- Name: plotmethod; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1779
--
1780

  
1781
CREATE TABLE plotmethod (
1782
    plotmethod_id int(11) NOT NULL,
1783
    reference_id int(11),
1784
    name text NOT NULL,
1785
    description text,
1786
    accessioncode text,
1787
    method_id int(11),
1788
    shape text,
1789
    length text,
1790
    width text,
1791
    radius text,
1792
    area text
1793
);
1794

  
1795

  
1796
--
1797
-- Name: plotmethod_plotmethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1798
--
1799

  
1800

  
1801

  
1802

  
1803
--
1804
-- Name: plotmethod_plotmethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1805
--
1806

  
1807

  
1808

  
1809

  
1810
--
1778 1811
-- Name: project; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1779 1812
--
1780 1813

  
......
3244 3277

  
3245 3278

  
3246 3279
--
3280
-- Name: plotmethod_id; Type: DEFAULT; Schema: public; Owner: -
3281
--
3282

  
3283

  
3284

  
3285

  
3286
--
3247 3287
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: -
3248 3288
--
3249 3289

  
......
3986 4026

  
3987 4027

  
3988 4028
--
4029
-- Name: plotmethod_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4030
--
4031

  
4032
ALTER TABLE plotmethod
4033
    ADD CONSTRAINT plotmethod_pkey PRIMARY KEY (plotmethod_id);
4034

  
4035

  
4036
--
3989 4037
-- Name: project_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3990 4038
--
3991 4039

  
......
4725 4773
-- Name: fki_locationevent_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4726 4774
--
4727 4775

  
4728
CREATE INDEX fki_locationevent_method_id ON locationevent  (method_id);
4776
CREATE INDEX fki_locationevent_method_id ON locationevent  (plotmethod_id);
4729 4777

  
4730 4778

  
4731 4779
--
......
4792 4840

  
4793 4841

  
4794 4842
--
4843
-- Name: fki_plotmethod_reference_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4844
--
4845

  
4846
CREATE INDEX fki_plotmethod_reference_id ON plotmethod  (reference_id);
4847

  
4848

  
4849
--
4795 4850
-- Name: fki_specimenreplicate_museum_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4796 4851
--
4797 4852

  
......
5261 5316

  
5262 5317

  
5263 5318
--
5319
-- Name: plotmethod_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5320
--
5321

  
5322
CREATE UNIQUE INDEX plotmethod_accessioncode ON plotmethod  (accessioncode);
5323

  
5324

  
5325
--
5264 5326
-- Name: project_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5265 5327
--
5266 5328

  
......
5921 5983

  
5922 5984

  
5923 5985
--
5924
-- Name: locationevent_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5986
-- Name: locationevent_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5925 5987
--
5926 5988

  
5927 5989
ALTER TABLE locationevent
5928
    ADD CONSTRAINT locationevent_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
5990
    ADD CONSTRAINT locationevent_parent_id FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
5929 5991

  
5930 5992

  
5931 5993
--
5932
-- Name: locationevent_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5994
-- Name: locationevent_plotmethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5933 5995
--
5934 5996

  
5935 5997
ALTER TABLE locationevent
5936
    ADD CONSTRAINT locationevent_parent_id FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
5998
    ADD CONSTRAINT locationevent_plotmethod_id FOREIGN KEY (plotmethod_id) REFERENCES plotmethod(plotmethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
5937 5999

  
5938 6000

  
5939 6001
--
......
6271 6333

  
6272 6334

  
6273 6335
--
6336
-- Name: plotmethod_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6337
--
6338

  
6339
ALTER TABLE plotmethod
6340
    ADD CONSTRAINT plotmethod_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
6341

  
6342

  
6343
--
6344
-- Name: plotmethod_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6345
--
6346

  
6347

  
6348

  
6349

  
6350
--
6274 6351
-- Name: project_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6275 6352
--
6276 6353

  

Also available in: Unified diff