X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7e5416c8d769fa6520dad72cd0612f1776d88219..df9955d76e3103e747360d2c27914d79b97fdf6f:/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..ee6865fbf0 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 @@ -55,9 +55,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