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

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

class AddThrottleAuthenticatedGitLfsColumns < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  def up
    with_lock_retries do
      add_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period, :integer, default: 1000, null: false
      add_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds, :integer, default: 60, null: false
      add_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean, default: false, null: false
    end
  end

  def down
    with_lock_retries do
      remove_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period
      remove_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds
      remove_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean
    end
  end
end