summaryrefslogtreecommitdiff
path: root/db/migrate/20200212134201_insert_group_hooks_plan_limits.rb
blob: a2963cfaf4da35b7a7ac646425e09012764449bb (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 InsertGroupHooksPlanLimits < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    return unless Gitlab.com?

    create_or_update_plan_limit('group_hooks', 'bronze', 50)
    create_or_update_plan_limit('group_hooks', 'silver', 50)
    create_or_update_plan_limit('group_hooks', 'gold', 50)
  end

  def down
    return unless Gitlab.com?

    create_or_update_plan_limit('group_hooks', 'bronze', 0)
    create_or_update_plan_limit('group_hooks', 'silver', 0)
    create_or_update_plan_limit('group_hooks', 'gold', 0)
  end
end