Commit dc42aae3 authored by James Brooks's avatar James Brooks Committed by Jacob Vosmaer

Fixes #7571

parent a044c4b1
......@@ -2,6 +2,12 @@ class MigrateTaggableLabels < ActiveRecord::Migration
def up
taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels')
taggings.find_each(batch_size: 500) do |tagging|
# Clean up orphaned taggings while we are here
if tagging.taggable.blank? || tagging.tag.nil?
tagging.destroy
print 'D'
next
end
create_label_from_tagging(tagging)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment