diff --git a/crates/storage-pg/migrations/20260108175627_oauth_access_tokens_revoked_at_idx.sql b/crates/storage-pg/migrations/20260108175627_oauth_access_tokens_revoked_at_idx.sql new file mode 100644 index 000000000..aa119ec23 --- /dev/null +++ b/crates/storage-pg/migrations/20260108175627_oauth_access_tokens_revoked_at_idx.sql @@ -0,0 +1,9 @@ +-- no-transaction +-- Copyright 2026 Element Creations Ltd. +-- +-- SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial +-- Please see LICENSE in the repository root for full details. + +-- This adds an index on the revoked_at field on oauth2_access_tokens to speed up cleaning them up +CREATE INDEX CONCURRENTLY IF NOT EXISTS oauth_access_tokens_revoked_at_idx + ON oauth2_access_tokens (revoked_at) WHERE revoked_at IS NOT NULL;