Revision 11075
Added by Aaron Marcuse-Kubitza about 11 years ago
schemas/vegbien.sql | ||
---|---|---|
6667 | 6667 |
-- Name: locationevent_unique_within_location; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6668 | 6668 |
-- |
6669 | 6669 |
|
6670 |
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree ((COALESCE(location_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text)), (COALESCE(obsstartdate, 'infinity'::date))) WHERE ((parent_id IS NULL) AND (sourceaccessioncode IS NULL)); |
|
6670 |
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree ((COALESCE(location_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text)), (COALESCE(obsstartdate, 'infinity'::date)), (COALESCE(stratum_id, 2147483647))) WHERE ((parent_id IS NULL) AND (sourceaccessioncode IS NULL));
|
|
6671 | 6671 |
|
6672 | 6672 |
|
6673 | 6673 |
-- |
6674 | 6674 |
-- Name: locationevent_unique_within_parent_by_authoreventcode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6675 | 6675 |
-- |
6676 | 6676 |
|
6677 |
CREATE UNIQUE INDEX locationevent_unique_within_parent_by_authoreventcode ON locationevent USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text))) WHERE ((parent_id IS NOT NULL) AND (authoreventcode IS NOT NULL)); |
|
6677 |
CREATE UNIQUE INDEX locationevent_unique_within_parent_by_authoreventcode ON locationevent USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text)), (COALESCE(stratum_id, 2147483647))) WHERE ((parent_id IS NOT NULL) AND (authoreventcode IS NOT NULL));
|
|
6678 | 6678 |
|
6679 | 6679 |
|
6680 | 6680 |
-- |
6681 | 6681 |
-- Name: locationevent_unique_within_parent_by_location; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6682 | 6682 |
-- |
6683 | 6683 |
|
6684 |
CREATE UNIQUE INDEX locationevent_unique_within_parent_by_location ON locationevent USING btree ((COALESCE(parent_id, 2147483647)), location_id) WHERE (parent_id IS NOT NULL); |
|
6684 |
CREATE UNIQUE INDEX locationevent_unique_within_parent_by_location ON locationevent USING btree ((COALESCE(parent_id, 2147483647)), location_id, (COALESCE(stratum_id, 2147483647))) WHERE (parent_id IS NOT NULL);
|
|
6685 | 6685 |
|
6686 | 6686 |
|
6687 | 6687 |
-- |
6688 | 6688 |
-- Name: locationevent_unique_within_project; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6689 | 6689 |
-- |
6690 | 6690 |
|
6691 |
CREATE UNIQUE INDEX locationevent_unique_within_project ON locationevent USING btree ((COALESCE(project_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text)), (COALESCE(obsstartdate, 'infinity'::date))) WHERE ((((parent_id IS NULL) AND (project_id IS NOT NULL)) AND (authoreventcode IS NOT NULL)) AND (obsstartdate IS NOT NULL)); |
|
6691 |
CREATE UNIQUE INDEX locationevent_unique_within_project ON locationevent USING btree ((COALESCE(project_id, 2147483647)), (COALESCE(authoreventcode, '\N'::text)), (COALESCE(obsstartdate, 'infinity'::date)), (COALESCE(stratum_id, 2147483647))) WHERE ((((parent_id IS NULL) AND (project_id IS NOT NULL)) AND (authoreventcode IS NOT NULL)) AND (obsstartdate IS NOT NULL));
|
|
6692 | 6692 |
|
6693 | 6693 |
|
6694 | 6694 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: locationevent: added stratum_id to unique constraints, so that there can be multiple locationevents for the same underlying event but with different strata