Project

General

Profile

« Previous | Next » 

Revision 1032

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

View differences:

vegbien.sql
1254 1254
    sourceaccessioncode text,
1255 1255
    previous_id integer,
1256 1256
    dateaccuracy text,
1257
    method_id integer,
1257
    plotmethod_id integer,
1258 1258
    methodnarrative text,
1259 1259
    taxonoccurrencearea double precision,
1260 1260
    coverdispersion text,
......
2049 2049

  
2050 2050

  
2051 2051
--
2052
-- Name: plotmethod; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2053
--
2054

  
2055
CREATE TABLE plotmethod (
2056
    plotmethod_id integer NOT NULL,
2057
    reference_id integer,
2058
    name text NOT NULL,
2059
    description text,
2060
    accessioncode text,
2061
    method_id integer,
2062
    shape text,
2063
    length text,
2064
    width text,
2065
    radius text,
2066
    area text
2067
);
2068

  
2069

  
2070
--
2071
-- Name: plotmethod_plotmethod_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2072
--
2073

  
2074
CREATE SEQUENCE plotmethod_plotmethod_id_seq
2075
    START WITH 1
2076
    INCREMENT BY 1
2077
    NO MINVALUE
2078
    NO MAXVALUE
2079
    CACHE 1;
2080

  
2081

  
2082
--
2083
-- Name: plotmethod_plotmethod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2084
--
2085

  
2086
ALTER SEQUENCE plotmethod_plotmethod_id_seq OWNED BY plotmethod.plotmethod_id;
2087

  
2088

  
2089
--
2052 2090
-- Name: project; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2053 2091
--
2054 2092

  
......
3688 3726

  
3689 3727

  
3690 3728
--
3729
-- Name: plotmethod_id; Type: DEFAULT; Schema: public; Owner: -
3730
--
3731

  
3732
ALTER TABLE plotmethod ALTER COLUMN plotmethod_id SET DEFAULT nextval('plotmethod_plotmethod_id_seq'::regclass);
3733

  
3734

  
3735
--
3691 3736
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: -
3692 3737
--
3693 3738

  
......
4430 4475

  
4431 4476

  
4432 4477
--
4478
-- Name: plotmethod_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4479
--
4480

  
4481
ALTER TABLE ONLY plotmethod
4482
    ADD CONSTRAINT plotmethod_pkey PRIMARY KEY (plotmethod_id);
4483

  
4484

  
4485
--
4433 4486
-- Name: project_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4434 4487
--
4435 4488

  
......
5169 5222
-- Name: fki_locationevent_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5170 5223
--
5171 5224

  
5172
CREATE INDEX fki_locationevent_method_id ON locationevent USING btree (method_id);
5225
CREATE INDEX fki_locationevent_method_id ON locationevent USING btree (plotmethod_id);
5173 5226

  
5174 5227

  
5175 5228
--
......
5236 5289

  
5237 5290

  
5238 5291
--
5292
-- Name: fki_plotmethod_reference_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5293
--
5294

  
5295
CREATE INDEX fki_plotmethod_reference_id ON plotmethod USING btree (reference_id);
5296

  
5297

  
5298
--
5239 5299
-- Name: fki_specimenreplicate_museum_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5240 5300
--
5241 5301

  
......
5705 5765

  
5706 5766

  
5707 5767
--
5768
-- Name: plotmethod_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5769
--
5770

  
5771
CREATE UNIQUE INDEX plotmethod_accessioncode ON plotmethod USING btree (accessioncode);
5772

  
5773

  
5774
--
5708 5775
-- Name: project_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5709 5776
--
5710 5777

  
......
6376 6443

  
6377 6444

  
6378 6445
--
6379
-- Name: locationevent_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6446
-- Name: locationevent_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6380 6447
--
6381 6448

  
6382 6449
ALTER TABLE ONLY locationevent
6383
    ADD CONSTRAINT locationevent_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
6450
    ADD CONSTRAINT locationevent_parent_id FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
6384 6451

  
6385 6452

  
6386 6453
--
6387
-- Name: locationevent_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6454
-- Name: locationevent_plotmethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6388 6455
--
6389 6456

  
6390 6457
ALTER TABLE ONLY locationevent
6391
    ADD CONSTRAINT locationevent_parent_id FOREIGN KEY (parent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
6458
    ADD CONSTRAINT locationevent_plotmethod_id FOREIGN KEY (plotmethod_id) REFERENCES plotmethod(plotmethod_id) ON UPDATE CASCADE ON DELETE CASCADE;
6392 6459

  
6393 6460

  
6394 6461
--
......
6736 6803

  
6737 6804

  
6738 6805
--
6806
-- Name: plotmethod_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6807
--
6808

  
6809
ALTER TABLE ONLY plotmethod
6810
    ADD CONSTRAINT plotmethod_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
6811

  
6812

  
6813
--
6814
-- Name: plotmethod_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6815
--
6816

  
6817
ALTER TABLE ONLY plotmethod
6818
    ADD CONSTRAINT plotmethod_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
6819

  
6820

  
6821
--
6739 6822
-- Name: project_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6740 6823
--
6741 6824

  

Also available in: Unified diff