X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2d6884f5b20c349e7fd28a51cd876d40524186ad..d2f9e7809bd1f63638600c7fc8189182c0f327c0:/services/api/db/migrate/20160209155729_add_uuid_to_api_token_search_index.rb 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 59637880b5..1bbc16ae97 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,13 +1,19 @@ class AddUuidToApiTokenSearchIndex < ActiveRecord::Migration def up - remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' - add_index :api_client_authorizations, + 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 - remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' + 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"