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

20230412152538_add_text_limit_to_ci_job_artifacts_file_final_path.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ee83486cc51aa4d9737f0a39a81f0fa87745909 (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 AddTextLimitToCiJobArtifactsFileFinalPath < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    add_text_limit :ci_job_artifacts, :file_final_path, 1024, constraint_name: constraint_name, validate: false
    prepare_async_check_constraint_validation(:ci_job_artifacts, name: constraint_name)
  end

  def down
    unprepare_async_check_constraint_validation(:ci_job_artifacts, name: constraint_name)
    remove_text_limit :ci_job_artifacts, :file_final_path
  end

  private

  def constraint_name
    text_limit_name(:ci_job_artifacts, :file_final_path)
  end
end