Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 15:26:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 15:26:25 +0300
commita09983ae35713f5a2bbb100981116d31ce99826e (patch)
tree2ee2af7bd104d57086db360a7e6d8c9d5d43667a /rubocop/cop/migration
parent18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff)
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'rubocop/cop/migration')
-rw-r--r--rubocop/cop/migration/drop_table.rb5
-rw-r--r--rubocop/cop/migration/with_lock_retries_disallowed_method.rb1
2 files changed, 6 insertions, 0 deletions
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