X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/07a7c1ca8ea3fb014a7eb4922ef762af7da5a0b5..5c1db683ce8a1192508fb6e84993b139252b7d60:/services/api/db/migrate/20140117231056_normalize_collection_uuid.rb diff --git a/services/api/db/migrate/20140117231056_normalize_collection_uuid.rb b/services/api/db/migrate/20140117231056_normalize_collection_uuid.rb index bec7ec7c4a..b26c0a8f2f 100644 --- a/services/api/db/migrate/20140117231056_normalize_collection_uuid.rb +++ b/services/api/db/migrate/20140117231056_normalize_collection_uuid.rb @@ -25,7 +25,7 @@ EOS update_sql <<-EOS UPDATE collections SET uuid = regexp_replace(uuid,'\\+.*','') || '+' || length(manifest_text) - WHERE uuid !~ '^[0-9a-f]{32,}\\+[0-9]+' + WHERE uuid !~ '^[0-9a-f]{32,}\\+[0-9]+$' AND (regexp_replace(uuid,'\\+.*','') || '+' || length(manifest_text)) NOT IN (SELECT uuid FROM collections) EOS @@ -60,7 +60,7 @@ UPDATE links AND (#{ht}_kind='arvados#collection' or #{ht}_uuid ~ '^[0-9a-f]{32,}') AND #{ht}_uuid NOT IN (SELECT uuid FROM collections) AND regexp_replace(#{ht}_uuid,'\\+.*','') = regexp_replace(c.uuid,'\\+.*','') - AND c.uuid ~ '^[0-9a-f]{32,}\\+[0-9]+' + AND c.uuid ~ '^[0-9a-f]{32,}\\+[0-9]+$' EOS end