blob: 39c5496e4d31f93496b06a3aa19d85ca32e9355f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# 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
|