]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20140115192822_add_text_index_to_note_comments.rb
Reenable the note search API
[rails.git] / db / migrate / 20140115192822_add_text_index_to_note_comments.rb
diff --git a/db/migrate/20140115192822_add_text_index_to_note_comments.rb b/db/migrate/20140115192822_add_text_index_to_note_comments.rb
new file mode 100644 (file)
index 0000000..e433745
--- /dev/null
@@ -0,0 +1,11 @@
+require 'migrate'
+
+class AddTextIndexToNoteComments < ActiveRecord::Migration
+  def up
+    add_index :note_comments, [], :columns => "to_tsvector('english', body)", :method => "GIN", :name => "index_note_comments_on_body"
+  end
+
+  def down
+    remove_index :note_comments, :name => "index_note_comments_on_body"
+  end
+end