X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f7e3001b53e9f26fd1d413308093bb9700bb9287..bd5a371cc0f57aea20c0954f532db5890dae5c59:/services/api/db/migrate/20141208185217_search_index.rb diff --git a/services/api/db/migrate/20141208185217_search_index.rb b/services/api/db/migrate/20141208185217_search_index.rb index dc50fd16a3..c8e9fef872 100644 --- a/services/api/db/migrate/20141208185217_search_index.rb +++ b/services/api/db/migrate/20141208185217_search_index.rb @@ -1,10 +1,14 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class SearchIndex < ActiveRecord::Migration def tables_with_searchable_columns { "api_client_authorizations" => ["api_token", "created_by_ip_address", "last_used_by_ip_address", "default_owner_uuid"], "api_clients" => ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "url_prefix"], "authorized_keys" => ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "key_type", "authorized_user_uuid"], - "collections" => ["owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "portable_data_hash", "redundancy_confirmed_by_client_uuid", "uuid", "name", "description"], + "collections" => ["owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "portable_data_hash", "redundancy_confirmed_by_client_uuid", "uuid", "name", "file_names"], "groups" => ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "group_class"], "humans" => ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid"], "job_tasks" => ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "job_uuid", "created_by_job_task_uuid"], @@ -24,15 +28,9 @@ class SearchIndex < ActiveRecord::Migration } end - def up - tables_with_searchable_columns.each do |table, columns| - add_index(table.to_sym, columns, name: "#{table}_search_index") - end - end - - def down + def change tables_with_searchable_columns.each do |table, columns| - remove_index(table.to_sym, name: "#{table}_search_index") + add_index table.to_sym, columns, name: "#{table}_search_index" end end end