Commit ea66022b authored by Stan Hu's avatar Stan Hu

Force the throttle_protected_paths_enabled toggle off

Because we already set the value to true in the previous migration, this
feature was switched on inadvertently in GitLab 12.4. This migration
toggles it back off to ensure we don't inadvertently block legitimate
users. The admin will have to re-enable it in the application settings.
parent 5bdba9cd
......@@ -3,10 +3,22 @@
class ChangeDefaultValueOfThrottleProtectedPaths < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def change
change_column_default :application_settings, :throttle_protected_paths_enabled, from: true, to: false
def up
change_column_default :application_settings, :throttle_protected_paths_enabled, false
# Because we already set the value to true in the previous
# migration, this feature was switched on inadvertently in GitLab
# 12.4. This migration toggles it back off to ensure we don't
# inadvertently block legitimate users. The admin will have to
# re-enable it in the application settings.
execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{false_value}"
end
def down
change_column_default :application_settings, :throttle_protected_paths_enabled, true
execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{true_value}"
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment