Skip to content

Commit

Permalink
Add index on secret owner tables
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyworld committed Apr 11, 2024
1 parent e0415bf commit d53ce90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions domain/schema/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ CREATE TABLE
PRIMARY KEY (secret_id, application_uuid)
);
CREATE INDEX idx_secret_application_owner_secret_id ON secret_application_owner (secret_id);
-- We need to ensure the label is unique per the application.
CREATE UNIQUE INDEX idx_secret_application_owner_label ON secret_application_owner (label,application_uuid) WHERE label != '';
Expand All @@ -230,6 +231,7 @@ CREATE TABLE
PRIMARY KEY (secret_id, unit_uuid)
);
CREATE INDEX idx_secret_unit_owner_secret_id ON secret_unit_owner (secret_id);
-- We need to ensure the label is unique per unit.
CREATE UNIQUE INDEX idx_secret_unit_owner_label ON secret_unit_owner (label,unit_uuid) WHERE label != '';
Expand Down

0 comments on commit d53ce90

Please sign in to comment.