21855: Change RPM repo quoting in Python READMEs
[arvados.git] / services / api / db / migrate / 20240402162733_add_output_glob_index_to_containers.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require './db/migrate/20161213172944_full_text_search_indexes'
6
7 class AddOutputGlobIndexToContainers < ActiveRecord::Migration[4.2]
8   def up
9     ActiveRecord::Base.connection.execute 'DROP INDEX index_containers_on_reuse_columns'
10     ActiveRecord::Base.connection.execute 'CREATE INDEX index_containers_on_reuse_columns on containers (md5(command), cwd, md5(environment), output_path, md5(output_glob), container_image, md5(mounts), secret_mounts_md5, md5(runtime_constraints))'
11     FullTextSearchIndexes.new.replace_index('container_requests')
12   end
13   def down
14     ActiveRecord::Base.connection.execute 'DROP INDEX index_containers_on_reuse_columns'
15     ActiveRecord::Base.connection.execute 'CREATE INDEX index_containers_on_reuse_columns on containers (md5(command), cwd, md5(environment), output_path, container_image, md5(mounts), secret_mounts_md5, md5(runtime_constraints))'
16   end
17 end