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

20210423164702_insert_runner_registration_plan_limits.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 36d13dfa120729bd4d6ae161c0b7bb45e6408a02 (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
26
# frozen_string_literal: true

class InsertRunnerRegistrationPlanLimits < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  def up
    create_or_update_plan_limit('ci_registered_group_runners', 'free', 50)
    create_or_update_plan_limit('ci_registered_group_runners', 'bronze', 1000)
    create_or_update_plan_limit('ci_registered_group_runners', 'silver', 1000)
    create_or_update_plan_limit('ci_registered_group_runners', 'gold', 1000)

    create_or_update_plan_limit('ci_registered_project_runners', 'free', 50)
    create_or_update_plan_limit('ci_registered_project_runners', 'bronze', 1000)
    create_or_update_plan_limit('ci_registered_project_runners', 'silver', 1000)
    create_or_update_plan_limit('ci_registered_project_runners', 'gold', 1000)
  end

  def down
    %w[group project].each do |scope|
      create_or_update_plan_limit("ci_registered_#{scope}_runners", 'free', 1000)
      create_or_update_plan_limit("ci_registered_#{scope}_runners", 'bronze', 1000)
      create_or_update_plan_limit("ci_registered_#{scope}_runners", 'silver', 1000)
      create_or_update_plan_limit("ci_registered_#{scope}_runners", 'gold', 1000)
    end
  end
end