Scope clear_search_records to the account being destroyed (#2847)

Account::Searchable#clear_search_records called
Search::Record.for(id).destroy_all which deleted every row in the
shard's table, wiping search records belonging to every other account
that happened to hash to the same shard.

ref: https://3.basecamp.com/2914079/buckets/27/card_tables/cards/9782824728
This commit is contained in:
Mike Dalessio
2026-04-16 15:43:55 -04:00
committed by GitHub
parent 8f3086daa9
commit 9a27ca8b42
2 changed files with 42 additions and 1 deletions
+1 -1
View File
@@ -9,6 +9,6 @@ module Account::Searchable
private
def clear_search_records
Search::Record.for(id).destroy_all
Search::Record.for(id).where(account_id: id).destroy_all
end
end