151_account_autopause_expiry_index_notx.sql 234 B

123456
  1. CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_accounts_autopause_expiry_due
  2. ON accounts (expires_at)
  3. WHERE deleted_at IS NULL
  4. AND schedulable = TRUE
  5. AND auto_pause_on_expired = TRUE
  6. AND expires_at IS NOT NULL;