Sha256: 0644555d8970c1b5023f04b9bde0e9e6920be7098d4d2f6d060c679939ddc5a7
Contents?: true
Size: 722 Bytes
Versions: 6
Compression:
Stored size: 722 Bytes
Contents
class AddSearchIndexToCasContents < ActiveRecord::Migration[4.2] def up add_column :cas_contents, :tags_cache, :string execute <<-SQL CREATE INDEX cas_contents_search_with_fulltext ON cas_contents USING gist (( to_tsvector('simple', coalesce("cas_contents"."title"::text, '')) || to_tsvector('simple', coalesce("cas_contents"."text"::text, '')) || to_tsvector('simple', coalesce("cas_contents"."location"::text, '')) || to_tsvector('simple', coalesce("cas_contents"."tags_cache"::text, '')) )); SQL end def down execute <<-SQL DROP INDEX cas_contents_search_with_fulltext; SQL remove_column :cas_contents, :tags_cache end end
Version data entries
6 entries across 6 versions & 1 rubygems