Merge branch '8784-dir-listings'
[arvados.git] / services / api / db / migrate / 20160209155729_add_uuid_to_api_token_search_index.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class AddUuidToApiTokenSearchIndex < ActiveRecord::Migration
6   def up
7     begin
8       remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index'
9     rescue
10     end
11     add_index :api_client_authorizations,
12               ["api_token", "created_by_ip_address", "last_used_by_ip_address", "default_owner_uuid", "uuid"],
13               name: "api_client_authorizations_search_index"
14   end
15
16   def down
17     begin
18       remove_index :api_client_authorizations, :name => 'api_client_authorizations_search_index'
19     rescue
20     end
21           add_index :api_client_authorizations,
22               ["api_token", "created_by_ip_address", "last_used_by_ip_address", "default_owner_uuid"],
23               name: "api_client_authorizations_search_index"
24   end
25 end