From a09983ae35713f5a2bbb100981116d31ce99826e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Jul 2020 12:26:25 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-2-stable-ee --- rubocop/cop/migration/drop_table.rb | 5 +++++ rubocop/cop/migration/with_lock_retries_disallowed_method.rb | 1 + 2 files changed, 6 insertions(+) (limited to 'rubocop/cop/migration') diff --git a/rubocop/cop/migration/drop_table.rb b/rubocop/cop/migration/drop_table.rb index 2a0f57c0c13..531cbb14021 100644 --- a/rubocop/cop/migration/drop_table.rb +++ b/rubocop/cop/migration/drop_table.rb @@ -17,6 +17,7 @@ module RuboCop def on_def(node) return unless in_deployment_migration?(node) + return if down_method?(node) node.each_descendant(:send) do |send_node| next unless offensible?(send_node) @@ -27,6 +28,10 @@ module RuboCop private + def down_method?(node) + node.method?(:down) + end + def offensible?(node) drop_table?(node) || drop_table_in_execute?(node) end diff --git a/rubocop/cop/migration/with_lock_retries_disallowed_method.rb b/rubocop/cop/migration/with_lock_retries_disallowed_method.rb index 309ddcc9746..9bf81e7db0c 100644 --- a/rubocop/cop/migration/with_lock_retries_disallowed_method.rb +++ b/rubocop/cop/migration/with_lock_retries_disallowed_method.rb @@ -10,6 +10,7 @@ module RuboCop ALLOWED_MIGRATION_METHODS = %i[ create_table + create_hash_partitions drop_table add_foreign_key remove_foreign_key -- cgit v1.2.3