X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d7e559136a7ed5ee3f178b26aa2b5924cea1bca7..d13cc16ebbe287fe81d06c5faa1d15fe588bcf16:/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 c2465912b1..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,8 +1,21 @@ class AddUuidToApiTokenSearchIndex < ActiveRecord::Migration - def change - remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index' - add_index :api_client_authorizations, + 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