projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '15286-fixes'
[arvados.git]
/
services
/
api
/
db
/
migrate
/
20141208174653_collection_file_names.rb
diff --git
a/services/api/db/migrate/20141208174653_collection_file_names.rb
b/services/api/db/migrate/20141208174653_collection_file_names.rb
index fdcd95f2bbd5f1c6ff9bbd09a3931beb786f5dfa..7abd778c045d75f15d5ce41e10d6a027d88c56c4 100644
(file)
--- a/
services/api/db/migrate/20141208174653_collection_file_names.rb
+++ b/
services/api/db/migrate/20141208174653_collection_file_names.rb
@@
-1,4
+1,8
@@
-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
include CurrentApiClient
def up
@@
-7,7
+11,7
@@
class CollectionFileNames < ActiveRecord::Migration
act_as_system_user do
Collection.find_each(batch_size: 20) do |c|
file_names = c.manifest_files
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
SET file_names = #{ActiveRecord::Base.connection.quote(file_names)}
WHERE uuid = '#{c.uuid}'"
end