Updated

db/migrate / 20150605100049_add_search_indexes_for_petitions.rb

A
24 lines of codes
2 methods
3.0 complexity/method
1 churn
6.0 complexity
0 duplications
class AddSearchIndexesForPetitions < ActiveRecord::Migration
  1. AddSearchIndexesForPetitions has no descriptive comment
def up execute <<-SQL CREATE INDEX index_petitions_on_title ON petitions USING gin(to_tsvector('english', title)); SQL execute <<-SQL CREATE INDEX index_petitions_on_action ON petitions USING gin(to_tsvector('english', description)); SQL execute <<-SQL CREATE INDEX index_petitions_on_description ON petitions USING gin(to_tsvector('english', description)); SQL end def down execute "DROP INDEX index_petitions_on_title;" execute "DROP INDEX index_petitions_on_action;" execute "DROP INDEX index_petitions_on_description;" end end