summaryrefslogtreecommitdiff
path: root/db/migrate/20200811194848_add_default_value_for_file_store_to_pipeline_artifact.rb
blob: f689a505809b12ccc6225813c3d1cd1ff9b89300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

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

  DOWNTIME = false
  PIPELINE_ARTIFACT_LOCAL_FILE_STORE = 1

  def up
    with_lock_retries do
      change_column_default :ci_pipeline_artifacts, :file_store, PIPELINE_ARTIFACT_LOCAL_FILE_STORE
    end
  end

  def down
    with_lock_retries do
      change_column_default :ci_pipeline_artifacts, :file_store, nil
    end
  end
end