openstreetmap-website/db/migrate/20140115192822_add_text_index_to_note_comments.rb
Tom Hughes ac7bb003ec Cleanup migrations
Cleanup our migrations, replacing as much of our custom code
and monkey patching with modern standard rails methods.
2015-01-11 12:53:01 +00:00

11 lines
321 B
Ruby

require 'migrate'
class AddTextIndexToNoteComments < ActiveRecord::Migration
def up
add_index :note_comments, [], :columns => "to_tsvector('english', body)", :using => "GIN", :name => "index_note_comments_on_body"
end
def down
remove_index :note_comments, :name => "index_note_comments_on_body"
end
end