chatwoot-develop/db/migrate/20230727065605_add_partial_index_contact_account_id.rb

9 lines
334 B
Ruby
Executable File

class AddPartialIndexContactAccountId < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_index :contacts, [:account_id], where: "(email <> '' OR phone_number <> '' OR identifier <> '')",
name: 'index_resolved_contact_account_id', algorithm: :concurrently
end
end