diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-22 19:56:38 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-22 19:56:38 +0100 |
commit | 08faeedff7838e339488cfcddf02d95241557ffb (patch) | |
tree | f7f2fd55bf288b5380732b03460750e2ba519ec1 /db/migrate/20170322162804_add_search_index_to_tags.rb | |
parent | 22e06a4077bef6317e72385a05052105f3804d68 (diff) | |
parent | d6ed2eb512f09600d7cd8150bb9b547442a9d68b (diff) |
Merge branch 'feature-omnisearch'
Diffstat (limited to 'db/migrate/20170322162804_add_search_index_to_tags.rb')
-rw-r--r-- | db/migrate/20170322162804_add_search_index_to_tags.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20170322162804_add_search_index_to_tags.rb b/db/migrate/20170322162804_add_search_index_to_tags.rb new file mode 100644 index 000000000..415dff9a0 --- /dev/null +++ b/db/migrate/20170322162804_add_search_index_to_tags.rb @@ -0,0 +1,9 @@ +class AddSearchIndexToTags < ActiveRecord::Migration[5.0] + def up + execute 'CREATE INDEX hashtag_search_index ON tags USING gin(to_tsvector(\'simple\', tags.name));' + end + + def down + remove_index :tags, name: :hashtag_search_index + end +end |