Commit 31b5b104 authored by Krasimir Angelov's avatar Krasimir Angelov

Merge branch 'mo-add-original-filename-to-ci-job-artifacts' into 'master'

Add original_filename to CiJobArtifact

See merge request gitlab-org/gitlab!74822
parents 8951a428 7f1bf091
......@@ -2,6 +2,7 @@
module Ci
class JobArtifact < Ci::ApplicationRecord
include IgnorableColumns
include AfterCommitQueue
include ObjectStorage::BackgroundMove
include UpdateProjectStatistics
......@@ -120,6 +121,9 @@ module Ci
belongs_to :project
belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id
# We will start using this column once we complete https://gitlab.com/gitlab-org/gitlab/-/issues/285597
ignore_column :original_filename, remove_with: '14.7', remove_after: '2022-11-22'
mount_file_store_uploader JobArtifactUploader
skip_callback :save, :after, :store_file!, if: :store_after_commit?
......
# frozen_string_literal: true
class AddOrignalFilenameToCiJobArtifact < Gitlab::Database::Migration[1.0]
enable_lock_retries!
# rubocop:disable Migration/AddLimitToTextColumns
# limit is added in 20211119085036_add_text_limit_to_job_artifact_original_filename.rb
def up
add_column :ci_job_artifacts, :original_filename, :text
end
# rubocop:enable Migration/AddLimitToTextColumns
def down
remove_column :ci_job_artifacts, :original_filename, :text
end
end
# frozen_string_literal: true
class AddTextLimitToJobArtifactOriginalFilename < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
add_text_limit :ci_job_artifacts, :original_filename, 512
end
def down
remove_text_limit :ci_job_artifacts, :original_filename
end
end
88b289d724f98f75e0340cde4c6e2bc3cb55df2a979934fb2bc544d22e4c032d
\ No newline at end of file
2b2c28e0370ae1bb84bee5ff769c9b313902d1f1afc50fa54e23a1627b1121f3
\ No newline at end of file
......@@ -11699,7 +11699,9 @@ CREATE TABLE ci_job_artifacts (
id bigint NOT NULL,
job_id bigint NOT NULL,
locked smallint DEFAULT 2,
CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL))
original_filename text,
CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)),
CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512))
);
CREATE SEQUENCE ci_job_artifacts_id_seq
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment