2020-03-17 18:09:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class InsertCiPipelineSchedulesPlanLimits < ActiveRecord::Migration[6.0]
|
2020-03-18 12:09:13 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2020-03-17 18:09:44 +00:00
|
|
|
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
|