X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/54e24a7233fe2dd4c84c9c6a54262f2858400f92..442a871e7f3476938d0ebb3adbe3b9a7742f03ad:/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb?ds=inline diff --git a/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb b/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb index c2465912b1..c8a8b5c445 100644 --- a/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb +++ b/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb @@ -1,8 +1,25 @@ -class AddUuidToApiTokenSearchIndex < ActiveRecord::Migration - def change - remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' - add_index :api_client_authorizations, +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +class AddUuidToApiTokenSearchIndex < ActiveRecord::Migration[4.2] + def up + begin + remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' + rescue + end + add_index :api_client_authorizations, ["api_token", "created_by_ip_address", "last_used_by_ip_address", "default_owner_uuid", "uuid"], name: "api_client_authorizations_search_index" end + + def down + begin + remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' + rescue + end + add_index :api_client_authorizations, + ["api_token", "created_by_ip_address", "last_used_by_ip_address", "default_owner_uuid"], + name: "api_client_authorizations_search_index" + end end