class FixSearchIndexInPackages < ActiveRecord::Migration def up execute "drop index packages_name" execute "drop index packages_description" execute "create index packages_fts on packages using gin(( to_tsvector('english', coalesce(\"packages\".\"name\"::text, '')) || to_tsvector('english', coalesce(\"packages\".\"description\"::text, '')) || to_tsvector('english', coalesce(\"packages\".\"long_description\"::text, '')) ))" end def down execute "drop index packages_fts" end end