Updated

db/migrate / 20150603112821_add_search_indexes_for_archived_petitions.rb

A
32 lines of codes
2 methods
4.0 complexity/method
1 churn
8.0 complexity
0 duplications
class AddSearchIndexesForArchivedPetitions < ActiveRecord::Migration
  1. AddSearchIndexesForArchivedPetitions has no descriptive comment
def up execute <<-SQL CREATE INDEX index_archived_petitions_on_title ON archived_petitions USING gin(to_tsvector('english', title)); SQL execute <<-SQL CREATE INDEX index_archived_petitions_on_description ON archived_petitions USING gin(to_tsvector('english', description)); SQL execute <<-SQL CREATE INDEX index_archived_petitions_on_state_and_closed_at ON archived_petitions USING btree (state, closed_at); SQL execute <<-SQL CREATE INDEX index_archived_petitions_on_signature_count ON archived_petitions USING btree (signature_count); SQL end def down execute "DROP INDEX index_archived_petitions_on_title;" execute "DROP INDEX index_archived_petitions_on_description;" execute "DROP INDEX index_archived_petitions_on_state;" execute "DROP INDEX index_archived_petitions_on_signature_count;" end end