Ensure column information is up-to-date before creating full text indexes. refs ...
authorTom Clegg <tom@curoverse.com>
Thu, 22 Dec 2016 19:43:28 +0000 (14:43 -0500)
committerTom Clegg <tom@curoverse.com>
Thu, 22 Dec 2016 19:45:01 +0000 (14:45 -0500)
services/api/db/migrate/20161213172944_full_text_search_indexes.rb

index 4cb4d978a1bfb909ed8984c4622910c2308206e4..aac377385005d3cd31733a23ef3c0a2806053250 100644 (file)
@@ -14,6 +14,7 @@ class FullTextSearchIndexes < ActiveRecord::Migration
   def up
     # remove existing fts indexes and create up to date ones with no leading space
     fts_indexes.each do |t, i|
+      t.classify.constantize.reset_column_information
       ActiveRecord::Base.connection.indexes(t).each do |idx|
         if idx.name == i
           remove_index t.to_sym, :name => i