summaryrefslogtreecommitdiff
path: root/db/migrate/20200225123228_insert_project_subscriptions_plan_limits.rb
blob: f04e0c68cf65e01dee23225b3eb3546682738974 (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 InsertProjectSubscriptionsPlanLimits < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    return unless Gitlab.com?

    create_or_update_plan_limit('ci_project_subscriptions', 'free', 2)
    create_or_update_plan_limit('ci_project_subscriptions', 'bronze', 2)
    create_or_update_plan_limit('ci_project_subscriptions', 'silver', 2)
    create_or_update_plan_limit('ci_project_subscriptions', 'gold', 2)
  end

  def down
    return unless Gitlab.com?

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