Files
buzz/migrations/0053_owner_deletion_quota_reservation.sql
2026-09-28 21:58:29 +00:00

11 lines
399 B
SQL

-- Keep owner quota reservation lookups bounded after relay membership is
-- purged but logical deletion has not yet completed.
SET LOCAL lock_timeout = '5s';
CREATE INDEX community_deletion_requests_owner_quota_reservations
ON community_deletion_requests (owner_pubkey)
INCLUDE (community_id)
WHERE request_origin = 'owner'
AND stage <> 'aborted'
AND completed_at IS NULL;