class AddSearchIndexToPackages < ActiveRecord::Migration def up execute "create index packages_name on packages using gin(to_tsvector('english', name))" execute "create index packages_description on packages using gin(to_tsvector('english', description))" end def down execute "drop index packages_name" execute "drop index packages_description" end end