X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1aa3f43606ba5e31633c063851d25b8fab4b93e2..f69605f9427aa401b0f83c1e131e3c455eae4e38:/services/api/db/migrate/20170216170823_no_cr_mounts_and_workflow_def_in_full_text_search_index.rb diff --git a/services/api/db/migrate/20170216170823_no_cr_mounts_and_workflow_def_in_full_text_search_index.rb b/services/api/db/migrate/20170216170823_no_cr_mounts_and_workflow_def_in_full_text_search_index.rb index 3d4a6062b4..2d641c1729 100644 --- a/services/api/db/migrate/20170216170823_no_cr_mounts_and_workflow_def_in_full_text_search_index.rb +++ b/services/api/db/migrate/20170216170823_no_cr_mounts_and_workflow_def_in_full_text_search_index.rb @@ -1,4 +1,8 @@ -class NoCrMountsAndWorkflowDefInFullTextSearchIndex < ActiveRecord::Migration +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +class NoCrMountsAndWorkflowDefInFullTextSearchIndex < ActiveRecord::Migration[4.2] def fts_indexes { "container_requests" => "container_requests_full_text_search_idx", @@ -22,7 +26,13 @@ class NoCrMountsAndWorkflowDefInFullTextSearchIndex < ActiveRecord::Migration def down fts_indexes.each do |t, i| - remove_index t.to_sym, :name => i + t.classify.constantize.reset_column_information + ActiveRecord::Base.connection.indexes(t).each do |idx| + if idx.name == i + remove_index t.to_sym, :name => i + break + end + end end end end