diff --git a/internal/store/postgres/migrations/000017_create_grant_unique_index.up.sql b/internal/store/postgres/migrations/000017_create_grant_unique_index.up.sql index 398112dbb..317a7214b 100644 --- a/internal/store/postgres/migrations/000017_create_grant_unique_index.up.sql +++ b/internal/store/postgres/migrations/000017_create_grant_unique_index.up.sql @@ -1,3 +1,3 @@ -CREATE UNIQUE INDEX IF NOT EXISTS "unique_active_grants_index" ON "grants" ("account_id", "account_type", "permissions") +CREATE UNIQUE INDEX IF NOT EXISTS "unique_active_grants_index" ON "grants" ("account_id", "account_type", "resource_id", "permissions") WHERE - "status" = 'active'; \ No newline at end of file + "status" = 'active';