1 class CollectionFileNames < ActiveRecord::Migration
2 include CurrentApiClient
5 add_column :collections, :file_names, :string, :limit => 2**13
8 Collection.find_each(batch_size: 20) do |c|
9 file_names = c.manifest_files
10 ActiveRecord::Base.connection.execute "UPDATE collections
11 SET file_names = #{ActiveRecord::Base.connection.quote(file_names)}
12 WHERE uuid = '#{c.uuid}'"
18 remove_column :collections, :file_names