-class CollectionFileNames < ActiveRecord::Migration
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class CollectionFileNames < ActiveRecord::Migration[4.2]
include CurrentApiClient
def up
act_as_system_user do
Collection.find_each(batch_size: 20) do |c|
file_names = c.manifest_files
- update_sql "UPDATE collections
+ ActiveRecord::Base.connection.execute "UPDATE collections
SET file_names = #{ActiveRecord::Base.connection.quote(file_names)}
WHERE uuid = '#{c.uuid}'"
end