1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class FixContainersIndex < ActiveRecord::Migration[4.2]
7 execute "CREATE INDEX container_requests_full_text_search_idx ON container_requests USING gin(#{ContainerRequest.full_text_tsvector});"
8 add_index :container_requests, ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "state", "requesting_container_uuid", "container_uuid", "container_image", "cwd", "output_path"], name: 'container_requests_search_index'
9 add_index :containers, ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "state", "log", "cwd", "output_path", "output", "container_image"], name: 'containers_search_index'
10 add_index :container_requests, :owner_uuid
11 add_index :containers, :owner_uuid
15 remove_index :container_requests, :name => 'container_requests_full_text_search_idx'
16 remove_index :container_requests, :name => 'container_requests_search_index'
17 remove_index :containers, :name => 'containers_search_index'
18 remove_index :container_requests, :owner_uuid
19 remove_index :containers, :owner_uuid