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

20200701221303_change_default_value_of_ci_max_artifact_size_terraform_of_plan_limits_from_0_to_5.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e295d2f601a1973e3edfd976d3284319a18aa019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

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

  DOWNTIME = false

  def up
    with_lock_retries do
      change_column_default :plan_limits, :ci_max_artifact_size_terraform, 5
      execute('UPDATE plan_limits SET ci_max_artifact_size_terraform = 5 WHERE ci_max_artifact_size_terraform = 0')
    end
  end

  def down
    with_lock_retries do
      change_column_default :plan_limits, :ci_max_artifact_size_terraform, 0
      execute('UPDATE plan_limits SET ci_max_artifact_size_terraform = 0 WHERE ci_max_artifact_size_terraform = 5')
    end
  end
end