Class: Gitlab::BackgroundMigration::MigrateProjectTaggingsContextFromTagsToTopics

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb

Overview

The class to migrate the context of project taggings from `tags` to `topics`

Defined Under Namespace

Classes: Tagging

Instance Method Summary collapse

Instance Method Details

#perform(start_id, stop_id) ⇒ Object


14
15
16
17
18
# File 'lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb', line 14

def perform(start_id, stop_id)
  Tagging.where(taggable_type: 'Project', context: 'tags', id: start_id..stop_id).each_batch(of: 500) do |relation|
    relation.update_all(context: 'topics')
  end
end