discourse/db/migrate/20141118011735_correct_username_search.rb
Sam b4844d4477 FIX: correct old username index
(in some cases search was not finding accounts)
2014-11-18 14:32:23 +11:00

12 lines
298 B
Ruby

class CorrectUsernameSearch < ActiveRecord::Migration
def up
execute "update user_search_data
set search_data = TO_TSVECTOR('simple', username_lower || ' ' || lower(name))
from users
where users.id = user_search_data.user_id"
end
def down
end
end