Project

General

Profile

« Previous | Next » 

Revision 1055

vegbien.sql: Added locationevent.datasource_id

View differences:

schemas/vegbien.my.sql
1066 1066
CREATE TABLE locationevent (
1067 1067
    locationevent_id int(11) NOT NULL,
1068 1068
    parent_id int(11),
1069
    datasource_id int(11),
1069 1070
    location_id int(11),
1070 1071
    project_id int(11),
1071 1072
    authoreventcode text,
......
4814 4815

  
4815 4816

  
4816 4817
--
4818
-- Name: fki_locationevent_datasource_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4819
--
4820

  
4821
CREATE INDEX fki_locationevent_datasource_id ON locationevent  (datasource_id);
4822

  
4823

  
4824
--
4817 4825
-- Name: fki_locationevent_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4818 4826
--
4819 4827

  
......
6019 6027

  
6020 6028

  
6021 6029
--
6030
-- Name: locationevent_datasource_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6031
--
6032

  
6033

  
6034

  
6035

  
6036
--
6022 6037
-- Name: locationevent_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6023 6038
--
6024 6039

  
schemas/vegbien.sql
1237 1237
CREATE TABLE locationevent (
1238 1238
    locationevent_id integer NOT NULL,
1239 1239
    parent_id integer,
1240
    datasource_id integer,
1240 1241
    location_id integer,
1241 1242
    project_id integer,
1242 1243
    authoreventcode text,
......
5260 5261

  
5261 5262

  
5262 5263
--
5264
-- Name: fki_locationevent_datasource_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5265
--
5266

  
5267
CREATE INDEX fki_locationevent_datasource_id ON locationevent USING btree (datasource_id);
5268

  
5269

  
5270
--
5263 5271
-- Name: fki_locationevent_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5264 5272
--
5265 5273

  
......
5431 5439
-- Name: locationevent_keys_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5432 5440
--
5433 5441

  
5434
CREATE UNIQUE INDEX locationevent_keys_accessioncode ON locationevent USING btree ((COALESCE(parent_id, 0)), location_id, project_id, sourceaccessioncode);
5442
CREATE UNIQUE INDEX locationevent_keys_accessioncode ON locationevent USING btree ((COALESCE(parent_id, 0)), (COALESCE(datasource_id, 0)), location_id, project_id, sourceaccessioncode);
5435 5443

  
5436 5444

  
5437 5445
--
5438 5446
-- Name: locationevent_keys_code; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5439 5447
--
5440 5448

  
5441
CREATE UNIQUE INDEX locationevent_keys_code ON locationevent USING btree ((COALESCE(parent_id, 0)), location_id, project_id, authoreventcode);
5449
CREATE UNIQUE INDEX locationevent_keys_code ON locationevent USING btree ((COALESCE(parent_id, 0)), (COALESCE(datasource_id, 0)), location_id, project_id, authoreventcode);
5442 5450

  
5443 5451

  
5444 5452
--
......
6476 6484

  
6477 6485

  
6478 6486
--
6487
-- Name: locationevent_datasource_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6488
--
6489

  
6490
ALTER TABLE ONLY locationevent
6491
    ADD CONSTRAINT locationevent_datasource_id FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
6492

  
6493

  
6494
--
6479 6495
-- Name: locationevent_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6480 6496
--
6481 6497

  

Also available in: Unified diff