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

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

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

  DOWNTIME = false

  disable_ddl_transaction!

  DEFAULT_SOURCE = 0 # Equvalent to Ci::JobVariable.internal_source

  def up
    add_column_with_default(:ci_job_variables, :source, :integer, limit: 2, default: DEFAULT_SOURCE, allow_null: false) # rubocop:disable Migration/AddColumnWithDefault
  end

  def down
    remove_column(:ci_job_variables, :source)
  end
end