1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class CollectionFileNames < ActiveRecord::Migration
6 include CurrentApiClient
9 add_column :collections, :file_names, :string, :limit => 2**13
12 Collection.find_each(batch_size: 20) do |c|
13 file_names = c.manifest_files
14 ActiveRecord::Base.connection.execute "UPDATE collections
15 SET file_names = #{ActiveRecord::Base.connection.quote(file_names)}
16 WHERE uuid = '#{c.uuid}'"
22 remove_column :collections, :file_names