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 |
|
vegbien.sql: Added locationevent.datasource_id