summaryrefslogtreecommitdiff
path: root/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb
blob: b2c0121dd24268024cb331b68970cf1e006349b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class InsertProjectHooksPlanLimits < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    return unless Gitlab.com?

    create_or_update_plan_limit('project_hooks', 'free', 10)
    create_or_update_plan_limit('project_hooks', 'bronze', 20)
    create_or_update_plan_limit('project_hooks', 'silver', 30)
    create_or_update_plan_limit('project_hooks', 'gold', 100)
  end

  def down
    return unless Gitlab.com?

    create_or_update_plan_limit('project_hooks', 'free', 0)
    create_or_update_plan_limit('project_hooks', 'bronze', 0)
    create_or_update_plan_limit('project_hooks', 'silver', 0)
    create_or_update_plan_limit('project_hooks', 'gold', 0)
  end
end