Commit 4ffcf850 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mo-remove-uniqueness-contraint-pipeline-artifact' into 'master'

Remove file_type uniqueness for PipelineArtifact

See merge request gitlab-org/gitlab!39226
parents ab0748dc caf428b3
......@@ -20,7 +20,7 @@ module Ci
validates :pipeline, :project, :file_format, :file, presence: true
validates :file_store, presence: true, inclusion: { in: FILE_STORE_SUPPORTED }
validates :size, presence: true, numericality: { less_than_or_equal_to: FILE_SIZE_LIMIT }
validates :file_type, presence: true, uniqueness: { scope: [:pipeline_id] }
validates :file_type, presence: true
enum file_type: {
code_coverage: 1
......
......@@ -19,7 +19,6 @@ RSpec.describe Ci::PipelineArtifact, type: :model do
it { is_expected.to validate_presence_of(:file_format) }
it { is_expected.to validate_presence_of(:size) }
it { is_expected.to validate_presence_of(:file) }
it { is_expected.to validate_uniqueness_of(:file_type).scoped_to([:pipeline_id]).ignoring_case_sensitivity }
context 'when attributes are valid' do
it 'returns no errors' do
......
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