2
3
4
5
6
7
8
9
10
11
12
|
# File 'lib/generators/bumble/templates/migrations/full_text_search.rb', line 2
def self.up
ActiveRecord::Base.connection.execute(" DROP index IF EXISTS posts_fts_idx\n eosql\n ActiveRecord::Base.connection.execute(<<-'eosql')\n CREATE index posts_fts_idx\n ON posts\n USING gin((to_tsvector('english', coalesce(posts.title, '') || ' ' || coalesce(posts.link_url, '') || ' ' || coalesce(posts.image_url, '') || ' ' || coalesce(posts.video_embed, '') || ' ' || coalesce(posts.description, '') || ' ' || coalesce(posts.quote, '') || ' ' || coalesce(posts.permalink, '') || ' ' || coalesce(posts.via, ''))))\n\n eosql\nend\n")
|