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

20200311141943_insert_ci_pipeline_schedules_plan_limits.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1ad5be5f85cc5900ff8957c44e826f4a70a5bb1 (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 InsertCiPipelineSchedulesPlanLimits < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def change
    return unless Gitlab.com?

    create_or_update_plan_limit('ci_pipeline_schedules', 'free', 10)
    create_or_update_plan_limit('ci_pipeline_schedules', 'bronze', 50)
    create_or_update_plan_limit('ci_pipeline_schedules', 'silver', 50)
    create_or_update_plan_limit('ci_pipeline_schedules', 'gold', 50)
  end

  def down
    return unless Gitlab.com?

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