Split sqlite/mysql record stuff

This commit is contained in:
Donal McBreen
2025-11-20 17:37:44 +00:00
parent a4850fbe73
commit 19b0e25eac
5 changed files with 172 additions and 204 deletions
+2 -2
View File
@@ -28,11 +28,11 @@ module SearchTestHelper
private
def clear_search_records
if Search::Record.sqlite?
if ActiveRecord::Base.connection.adapter_name == "SQLite"
ActiveRecord::Base.connection.execute("DELETE FROM search_records")
ActiveRecord::Base.connection.execute("DELETE FROM search_records_fts")
else
Search::Record::SHARD_COUNT.times do |shard_id|
Search::Record::Trilogy::SHARD_COUNT.times do |shard_id|
ActiveRecord::Base.connection.execute("DELETE FROM search_records_#{shard_id}")
end
end