1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class FullTextSearchIndexes < ActiveRecord::Migration
8 "collections" => "collections_full_text_search_idx",
9 "container_requests" => "container_requests_full_text_search_idx",
10 "groups" => "groups_full_text_search_idx",
11 "jobs" => "jobs_full_text_search_idx",
12 "pipeline_instances" => "pipeline_instances_full_text_search_idx",
13 "pipeline_templates" => "pipeline_templates_full_text_search_idx",
14 "workflows" => "workflows_full_text_search_idx",
19 # remove existing fts indexes and create up to date ones with no leading space
20 fts_indexes.each do |t, i|
21 t.classify.constantize.reset_column_information
22 ActiveRecord::Base.connection.indexes(t).each do |idx|
24 remove_index t.to_sym, :name => i
28 execute "CREATE INDEX #{i} ON #{t} USING gin(#{t.classify.constantize.full_text_tsvector});"
33 fts_indexes.each do |t, i|
34 remove_index t.to_sym, :name => i