Project

General

Profile

« Previous | Next » 

Revision 1057

vegbien.sql: Removed no longer used location.reference_id. Datasource scoping is now done on locationevent instead, so that locations can be shared across datasources that refer to the same plot or point.

View differences:

schemas/vegbien.my.sql
931 931
CREATE TABLE location (
932 932
    location_id int(11) NOT NULL,
933 933
    authorlocationcode text,
934
    reference_id int(11),
935 934
    parent_id int(11),
936 935
    centerlatitude double precision,
937 936
    centerlongitude double precision,
......
3831 3830

  
3832 3831

  
3833 3832
--
3834
-- Name: location_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3835
--
3836

  
3837
ALTER TABLE location
3838
    ADD CONSTRAINT location_keys_code UNIQUE (reference_id, authorlocationcode);
3839

  
3840

  
3841
--
3842 3833
-- Name: location_keys_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3843 3834
--
3844 3835

  
3845 3836
ALTER TABLE location
3846
    ADD CONSTRAINT location_keys_coords UNIQUE (reference_id, centerlatitude, centerlongitude);
3837
    ADD CONSTRAINT location_keys_coords UNIQUE (centerlatitude, centerlongitude);
3847 3838

  
3848 3839

  
3849 3840
--
......
4962 4953

  
4963 4954

  
4964 4955
--
4965
-- Name: location_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4966
--
4967

  
4968
CREATE INDEX location_reference_id_x ON location  (reference_id);
4969

  
4970

  
4971
--
4972 4956
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4973 4957
--
4974 4958

  
......
5997 5981

  
5998 5982

  
5999 5983
--
6000
-- Name: location_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6001
--
6002

  
6003

  
6004

  
6005

  
6006
--
6007 5984
-- Name: locationdetermination_identifier_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6008 5985
--
6009 5986

  
schemas/vegbien.sql
1092 1092
CREATE TABLE location (
1093 1093
    location_id integer NOT NULL,
1094 1094
    authorlocationcode text,
1095
    reference_id integer,
1096 1095
    parent_id integer,
1097 1096
    centerlatitude double precision,
1098 1097
    centerlongitude double precision,
......
4277 4276

  
4278 4277

  
4279 4278
--
4280
-- Name: location_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4281
--
4282

  
4283
ALTER TABLE ONLY location
4284
    ADD CONSTRAINT location_keys_code UNIQUE (reference_id, authorlocationcode);
4285

  
4286

  
4287
--
4288 4279
-- Name: location_keys_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4289 4280
--
4290 4281

  
4291 4282
ALTER TABLE ONLY location
4292
    ADD CONSTRAINT location_keys_coords UNIQUE (reference_id, centerlatitude, centerlongitude);
4283
    ADD CONSTRAINT location_keys_coords UNIQUE (centerlatitude, centerlongitude);
4293 4284

  
4294 4285

  
4295 4286
--
......
5408 5399

  
5409 5400

  
5410 5401
--
5411
-- Name: location_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5412
--
5413

  
5414
CREATE INDEX location_reference_id_x ON location USING btree (reference_id);
5415

  
5416

  
5417
--
5418 5402
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5419 5403
--
5420 5404

  
......
6452 6436

  
6453 6437

  
6454 6438
--
6455
-- Name: location_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6456
--
6457

  
6458
ALTER TABLE ONLY location
6459
    ADD CONSTRAINT location_reference_id FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
6460

  
6461

  
6462
--
6463 6439
-- Name: locationdetermination_identifier_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6464 6440
--
6465 6441

  

Also available in: Unified diff