Chatwoot/db/migrate/20221212061802_enable_multi_searchable.rb
2022-12-21 13:30:25 +05:30

12 lines
301 B
Ruby

class EnableMultiSearchable < ActiveRecord::Migration[6.1]
def up
Contact.rebuild_pg_search_documents
PgSearch::Multisearch.rebuild(Conversation)
PgSearch::Multisearch.rebuild(Message)
execute 'create extension pg_trgm;'
end
def down
PgSearch::Document.delete_all
end
end