debian-mirror-gitlab/rubocop/cop/migration/background_migrations.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
816 B
Ruby
Raw Normal View History

2022-07-23 23:45:48 +05:30
# frozen_string_literal: true
require_relative '../../migration_helpers'
module RuboCop
module Cop
module Migration
class BackgroundMigrations < RuboCop::Cop::Cop
include MigrationHelpers
MSG = 'Background migrations are deprecated. Please use a Batched Background Migration instead.'\
' More info: https://docs.gitlab.com/ee/development/database/batched_background_migrations.html'
def on_send(node)
name = node.children[1]
disabled_methods = %i(
queue_background_migration_jobs_by_range_at_intervals
requeue_background_migration_jobs_by_range_at_intervals
migrate_in
)
add_offense(node, location: :selector) if disabled_methods.include? name
end
end
end
end
end