Skip to content

Commit

Permalink
Make a few more database indexes unique (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaecker authored Jul 26, 2022
1 parent fb0b6cf commit 948e537
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/src/sql/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ CREATE TABLE omicron.public.metric_producer (
oximeter_id UUID NOT NULL
);

CREATE INDEX ON omicron.public.metric_producer (
CREATE UNIQUE INDEX ON omicron.public.metric_producer (
oximeter_id,
id
);
Expand Down Expand Up @@ -1135,8 +1135,9 @@ CREATE UNIQUE INDEX ON omicron.public.instance_external_ip (
)
WHERE time_deleted IS NULL;

CREATE INDEX ON omicron.public.instance_external_ip (
instance_id
CREATE UNIQUE INDEX ON omicron.public.instance_external_ip (
instance_id,
id
)
WHERE instance_id IS NOT NULL AND time_deleted IS NULL;

Expand Down

0 comments on commit 948e537

Please sign in to comment.