X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1d0aef8fb7bdad6d28976255919f58b719a4342b..737dcc58241a06e32615624877d3301b90574227:/services/api/db/migrate/20150303210106_fix_collection_portable_data_hash_with_hinted_manifest.rb diff --git a/services/api/db/migrate/20150303210106_fix_collection_portable_data_hash_with_hinted_manifest.rb b/services/api/db/migrate/20150303210106_fix_collection_portable_data_hash_with_hinted_manifest.rb index 9bbe113562..31fc683e20 100644 --- a/services/api/db/migrate/20150303210106_fix_collection_portable_data_hash_with_hinted_manifest.rb +++ b/services/api/db/migrate/20150303210106_fix_collection_portable_data_hash_with_hinted_manifest.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'has_uuid' require 'kind_and_etag' @@ -55,9 +59,12 @@ class FixCollectionPortableDataHashWithHintedManifest < ActiveRecord::Migration end def each_bad_collection + end_coll = Collection.order("id DESC").first + return if end_coll.nil? seen_uuids = [] ("A".."Z").each do |hint_char| - query = Collection.where("manifest_text LIKE '%+#{hint_char}%'") + query = Collection. + where("id <= ? AND manifest_text LIKE '%+#{hint_char}%'", end_coll.id) unless seen_uuids.empty? query = query.where("uuid NOT IN (?)", seen_uuids) end