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

20230201082038_drop_web_hook_calls_high_column.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76c93be0f42330232bf414b5a679f0999cb1df3b (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 DropWebHookCallsHighColumn < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      if column_exists?(:plan_limits, :web_hook_calls_high) # rubocop:disable Style/IfUnlessModifier
        remove_column :plan_limits, :web_hook_calls_high
      end
    end
  end

  def down
    with_lock_retries do
      unless column_exists?(:plan_limits, :web_hook_calls_high)
        add_column :plan_limits, :web_hook_calls_high, :integer, default: 0
      end
    end
  end
end