Updated

db/migrate / 20160706060256_add_search_indexes_for_invalidations.rb

A
30 lines of codes
2 methods
4.0 complexity/method
1 churn
8.0 complexity
0 duplications
class AddSearchIndexesForInvalidations < ActiveRecord::Migration
  1. AddSearchIndexesForInvalidations has no descriptive comment
def up execute <<-SQL CREATE INDEX ft_index_invalidations_on_id ON invalidations USING gin(to_tsvector('english', id::text)); SQL execute <<-SQL CREATE INDEX ft_index_invalidations_on_summary ON invalidations USING gin(to_tsvector('english', summary)); SQL execute <<-SQL CREATE INDEX ft_index_invalidations_on_details ON invalidations USING gin(to_tsvector('english', details)); SQL execute <<-SQL CREATE INDEX ft_index_invalidations_on_petition_id ON invalidations USING gin(to_tsvector('english', petition_id::text)); SQL end def down execute "DROP INDEX ft_index_invalidations_on_id;" execute "DROP INDEX ft_index_invalidations_on_summary;" execute "DROP INDEX ft_index_invalidations_on_details;" execute "DROP INDEX ft_index_invalidations_on_petition_id;" end end