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

20210908140437_add_sidekiq_limits_to_application_settings.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd0796a1c86687837100920f5e751d873157692f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class AddSidekiqLimitsToApplicationSettings < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction! # needed for now to avoid subtransactions

  def up
    with_lock_retries do
      add_column :application_settings, :sidekiq_job_limiter_mode, :smallint, default: 1, null: false
      add_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes, :integer, default: 100_000, null: false
      add_column :application_settings, :sidekiq_job_limiter_limit_bytes, :integer, default: 0, null: false
    end
  end

  def down
    with_lock_retries do
      remove_column :application_settings, :sidekiq_job_limiter_mode
      remove_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes
      remove_column :application_settings, :sidekiq_job_limiter_limit_bytes
    end
  end
end